summaryrefslogtreecommitdiffstats
path: root/sys/sys/lockstat.h
diff options
context:
space:
mode:
authoravg <avg@FreeBSD.org>2015-06-12 10:01:24 +0000
committeravg <avg@FreeBSD.org>2015-06-12 10:01:24 +0000
commit2d008d4579eea1dabbd9175371c3b0c3d9437bf8 (patch)
tree151265eec4ae2b78e6b1302a08ef943cd0068dec /sys/sys/lockstat.h
parentecdfc8f10abb6d2e0917e148f37aafc2b8ed76f8 (diff)
downloadFreeBSD-src-2d008d4579eea1dabbd9175371c3b0c3d9437bf8.zip
FreeBSD-src-2d008d4579eea1dabbd9175371c3b0c3d9437bf8.tar.gz
several lockstat improvements
0. For spin events report time spent spinning, not a loop count. While loop count is much easier and cheaper to obtain it is hard to reason about the reported numbers, espcially for adaptive locks where both spinning and sleeping can happen. So, it's better to compare apples and apples. 1. Teach lockstat about FreeBSD rw locks. This is done in part by changing the corresponding probes and in part by changing what probes lockstat should expect. 2. Teach lockstat that rw locks are adaptive and can spin on FreeBSD. 3. Report lock acquisition events for successful rw try-lock operations. 4. Teach lockstat about FreeBSD sx locks. Reporting of events for those locks completely mirrors rw locks. 5. Report spin and block events before acquisition event. This is behavior documented for the upstream, so it makes sense to stick to it. Note that because of FreeBSD adaptive lock implementations both the spin and block events may be reported for the same acquisition while the upstream reports only one of them. Differential Revision: https://reviews.freebsd.org/D2727 Reviewed by: markj MFC after: 17 days Relnotes: yes Sponsored by: ClusterHQ
Diffstat (limited to 'sys/sys/lockstat.h')
-rw-r--r--sys/sys/lockstat.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/sys/lockstat.h b/sys/sys/lockstat.h
index ed9cffa..2a7853f 100644
--- a/sys/sys/lockstat.h
+++ b/sys/sys/lockstat.h
@@ -198,6 +198,9 @@ extern uint64_t lockstat_nsecs(void);
(*lockstat_probe_func)(id, (uintptr_t)(lp), 0, 0, 0, 0); \
} while (0)
+#define LOCKSTAT_WRITER 0
+#define LOCKSTAT_READER 1
+
#else /* !KDTRACE_HOOKS */
#define LOCKSTAT_RECORD(probe, lp, arg1)
OpenPOWER on IntegriCloud