aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/lockstat.h
diff options
context:
space:
mode:
authorAndriy Gapon <avg@FreeBSD.org>2015-06-12 10:01:24 +0000
committerAndriy Gapon <avg@FreeBSD.org>2015-06-12 10:01:24 +0000
commit076dd8eb2e324857fe989e58f7c9f6f8fb4804eb (patch)
tree151265eec4ae2b78e6b1302a08ef943cd0068dec /sys/sys/lockstat.h
parent112cacaee40818994261a7030e8c640ea0d54851 (diff)
downloadsrc-076dd8eb2e324857fe989e58f7c9f6f8fb4804eb.tar.gz
src-076dd8eb2e324857fe989e58f7c9f6f8fb4804eb.zip
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
Notes
Notes: svn path=/head/; revision=284297
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 ed9cffa92b62..2a7853fb95bf 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)