Page MenuHomeFreeBSD

D47822.1791246851.diff
No OneTemporary

Size
3 KB
Referenced Files
None
Subscribers
None

D47822.1791246851.diff

diff --git a/sys/kern/kern_rwlock.c b/sys/kern/kern_rwlock.c
--- a/sys/kern/kern_rwlock.c
+++ b/sys/kern/kern_rwlock.c
@@ -462,8 +462,10 @@
int64_t sleep_time = 0;
int64_t all_time = 0;
#endif
-#if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING)
+#if defined(KDTRACE_HOOKS)
uintptr_t state = 0;
+#endif
+#if defined(LOCK_PROFILING)
int doing_lockprof = 0;
#endif
@@ -471,14 +473,16 @@
if (LOCKSTAT_PROFILE_ENABLED(rw__acquire)) {
if (__rw_rlock_try(rw, td, &v, false LOCK_FILE_LINE_ARG))
goto out_lockstat;
+#ifdef LOCK_PROFILING
doing_lockprof = 1;
+#endif
all_time -= lockstat_nsecs(&rw->lock_object);
state = v;
}
+ state = v;
#endif
#ifdef LOCK_PROFILING
doing_lockprof = 1;
- state = v;
#endif
if (SCHEDULER_STOPPED())
@@ -645,7 +649,7 @@
v = RW_READ_VALUE(rw);
}
THREAD_CONTENTION_DONE(&rw->lock_object);
-#if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING)
+#if defined(LOCK_PROFILING)
if (__predict_true(!doing_lockprof))
return;
#endif
@@ -937,8 +941,10 @@
int64_t sleep_time = 0;
int64_t all_time = 0;
#endif
-#if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING)
+#if defined(KDTRACE_HOOKS)
uintptr_t state = 0;
+#endif
+#if defined(LOCK_PROFILING)
int doing_lockprof = 0;
#endif
int extra_work = 0;
@@ -953,15 +959,17 @@
goto out_lockstat;
}
extra_work = 1;
+#ifdef LOCK_PROFILING
doing_lockprof = 1;
+#endif
all_time -= lockstat_nsecs(&rw->lock_object);
state = v;
}
+ state = v;
#endif
#ifdef LOCK_PROFILING
extra_work = 1;
doing_lockprof = 1;
- state = v;
#endif
if (SCHEDULER_STOPPED())
@@ -1191,7 +1199,7 @@
if (in_critical)
critical_exit();
#endif
-#if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING)
+#if defined(LOCK_PROFILING)
if (__predict_true(!doing_lockprof))
return;
#endif
diff --git a/sys/kern/kern_sx.c b/sys/kern/kern_sx.c
--- a/sys/kern/kern_sx.c
+++ b/sys/kern/kern_sx.c
@@ -583,8 +583,10 @@
int64_t sleep_time = 0;
int64_t all_time = 0;
#endif
-#if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING)
+#if defined(KDTRACE_HOOKS)
uintptr_t state = 0;
+#endif
+#if defined(LOCK_PROFILING)
int doing_lockprof = 0;
#endif
int extra_work = 0;
@@ -598,15 +600,17 @@
goto out_lockstat;
}
extra_work = 1;
+#if defined(LOCK_PROFILING)
doing_lockprof = 1;
+#endif
all_time -= lockstat_nsecs(&sx->lock_object);
state = x;
}
+ state = x;
#endif
#ifdef LOCK_PROFILING
extra_work = 1;
doing_lockprof = 1;
- state = x;
#endif
if (SCHEDULER_STOPPED())
@@ -883,7 +887,7 @@
critical_exit();
#endif
GIANT_RESTORE();
-#if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING)
+#if defined(LOCK_PROFILING)
if (__predict_true(!doing_lockprof))
return (error);
#endif
@@ -1035,7 +1039,7 @@
int64_t sleep_time = 0;
int64_t all_time = 0;
#endif
-#if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING)
+#if defined(KDTRACE_HOOKS)
uintptr_t state = 0;
#endif
int extra_work __sdt_used = 0;
@@ -1050,10 +1054,10 @@
all_time -= lockstat_nsecs(&sx->lock_object);
state = x;
}
+ state = x;
#endif
#ifdef LOCK_PROFILING
extra_work = 1;
- state = x;
#endif
if (SCHEDULER_STOPPED())

File Metadata

Mime Type
text/plain
Expires
Tue, Oct 6, 12:34 AM (17 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30185006
Default Alt Text
D47822.1791246851.diff (3 KB)

Event Timeline