diff options
author | jeff <jeff@FreeBSD.org> | 2012-12-19 20:10:00 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2012-12-19 20:10:00 +0000 |
commit | 0a985cfcdeb6ea9385d67b191d021ed1b74c3702 (patch) | |
tree | cd571f104bffb0f3f5a4efd15e32b9a8308f6e50 /sys/sys/ktr.h | |
parent | c3865e85e8e1cef7a04d07ee0792b609bb665706 (diff) | |
download | FreeBSD-src-0a985cfcdeb6ea9385d67b191d021ed1b74c3702.zip FreeBSD-src-0a985cfcdeb6ea9385d67b191d021ed1b74c3702.tar.gz |
- Add new machine parsable KTR macros for timing events.
- Use this new format to automatically handle syscalls and VOPs. This
changes the earlier format but is still human readable.
Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'sys/sys/ktr.h')
-rw-r--r-- | sys/sys/ktr.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/sys/sys/ktr.h b/sys/sys/ktr.h index c440a41..28442e2 100644 --- a/sys/sys/ktr.h +++ b/sys/sys/ktr.h @@ -244,6 +244,50 @@ void ktr_tracepoint(u_int mask, const char *file, int line, point, a0, (v0), a1, (v1), a2, (v2), a3, (v3)) /* + * Start functions denote the start of a region of code or operation + * and should be paired with stop functions for timing of nested + * sequences. + * + * Specifying extra attributes with the name "key" will result in + * multi-part keys. For example a block device and offset pair + * might be used to describe a buf undergoing I/O. + */ +#define KTR_START0(m, egroup, ident, key) \ + KTR_EVENT0(m, egroup, ident, "start:0x%jX", (uintmax_t)key) +#define KTR_START1(m, egroup, ident, key, a0, v0) \ + KTR_EVENT1(m, egroup, ident, "start:0x%jX", (uintmax_t)key, a0, (v0)) +#define KTR_START2(m, egroup, ident, key, a0, v0, a1, v1) \ + KTR_EVENT2(m, egroup, ident, "start:0x%jX", (uintmax_t)key, \ + a0, (v0), a1, (v1)) +#define KTR_START3(m, egroup, ident, key, a0, v0, a1, v1, a2, v2)\ + KTR_EVENT3(m, egroup, ident, "start:0x%jX", (uintmax_t)key, \ + a0, (v0), a1, (v1), a2, (v2)) +#define KTR_START4(m, egroup, ident, key, \ + a0, v0, a1, v1, a2, v2, a3, v3) \ + KTR_EVENT4(m, egroup, ident, "start:0x%jX", (uintmax_t)key, \ + a0, (v0), a1, (v1), a2, (v2), a3, (v3)) + +/* + * Stop functions denote the end of a region of code or operation + * and should be paired with start functions for timing of nested + * sequences. + */ +#define KTR_STOP0(m, egroup, ident, key) \ + KTR_EVENT0(m, egroup, ident, "stop:0x%jX", (uintmax_t)key) +#define KTR_STOP1(m, egroup, ident, key, a0, v0) \ + KTR_EVENT1(m, egroup, ident, "stop:0x%jX", (uintmax_t)key, a0, (v0)) +#define KTR_STOP2(m, egroup, ident, key, a0, v0, a1, v1) \ + KTR_EVENT2(m, egroup, ident, "stop:0x%jX", (uintmax_t)key, \ + a0, (v0), a1, (v1)) +#define KTR_STOP3(m, egroup, ident, key, a0, v0, a1, v1, a2, v2)\ + KTR_EVENT3(m, egroup, ident, "stop:0x%jX", (uintmax_t)key, \ + a0, (v0), a1, (v1), a2, (v2)) +#define KTR_STOP4(m, egroup, ident, \ + key, a0, v0, a1, v1, a2, v2, a3, v3) \ + KTR_EVENT4(m, egroup, ident, "stop:0x%jX", (uintmax_t)key, \ + a0, (v0), a1, (v1), a2, (v2), a3, (v3)) + +/* * Trace initialization events, similar to CTR with KTR_INIT, but * completely ifdef'ed out if KTR_INIT isn't in KTR_COMPILE (to * save string space, the compiler doesn't optimize out strings |