diff options
author | Jeff Roberson <jeff@FreeBSD.org> | 2012-12-19 20:10:00 +0000 |
---|---|---|
committer | Jeff Roberson <jeff@FreeBSD.org> | 2012-12-19 20:10:00 +0000 |
commit | 4c44811c9d6ec11b7762e183596123b89c04317d (patch) | |
tree | cd571f104bffb0f3f5a4efd15e32b9a8308f6e50 /sys/tools | |
parent | 5b39d5c7393cbbb7258aa6202ca94c9e45508609 (diff) | |
download | src-4c44811c9d6ec11b7762e183596123b89c04317d.tar.gz src-4c44811c9d6ec11b7762e183596123b89c04317d.zip |
- 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
Notes
Notes:
svn path=/head/; revision=244445
Diffstat (limited to 'sys/tools')
-rw-r--r-- | sys/tools/vnode_if.awk | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/sys/tools/vnode_if.awk b/sys/tools/vnode_if.awk index 5e194a89b5a1..fc12ce99cb31 100644 --- a/sys/tools/vnode_if.awk +++ b/sys/tools/vnode_if.awk @@ -222,8 +222,6 @@ while ((getline < srcfile) > 0) { name = $1; uname = toupper(name); - # Start constructing a ktrpoint string - ctrstr = "\"" uname; # Get the function arguments. for (numargs = 0; ; ++numargs) { if ((getline < srcfile) <= 0) { @@ -267,27 +265,15 @@ while ((getline < srcfile) > 0) { # remove trailing space (if any) sub(/ $/, ""); types[numargs] = $0; - - # We can do a maximum of 6 arguments to CTR* - if (numargs <= 6) { - if (numargs == 0) - ctrstr = ctrstr "(" args[numargs]; - else - ctrstr = ctrstr ", " args[numargs]; - if (types[numargs] ~ /\*/) - ctrstr = ctrstr " 0x%lX"; - else - ctrstr = ctrstr " %ld"; - } } - if (numargs > 6) - ctrargs = 6; + if (numargs > 4) + ctrargs = 4; else ctrargs = numargs; - ctrstr = "\tCTR" ctrargs "(KTR_VOP,\n\t " ctrstr ")\",\n\t "; - ctrstr = ctrstr "a->a_" args[0]; + ctrstr = ctrargs "(KTR_VOP, \"VOP\", \"" uname "\", a,\n\t "; + ctrstr = ctrstr "\"" args[0] ":0x%jX\", (uintptr_t)a->a_" args[0]; for (i = 1; i < ctrargs; ++i) - ctrstr = ctrstr ", a->a_" args[i]; + ctrstr = ctrstr ", \"" args[i] ":0x%jX\", a->a_" args[i]; ctrstr = ctrstr ");"; if (pfile) { @@ -377,12 +363,12 @@ while ((getline < srcfile) > 0) { printc("\tSDT_PROBE(vfs, vop, " name ", entry, a->a_" args[0] ", a, 0, 0, 0);\n"); for (i = 0; i < numargs; ++i) add_debug_code(name, args[i], "Entry", "\t"); + printc("\tKTR_START" ctrstr); add_pre(name); printc("\tif (vop->"name" != NULL)") printc("\t\trc = vop->"name"(a);") printc("\telse") printc("\t\trc = vop->vop_bypass(&a->a_gen);") - printc(ctrstr); printc("\tSDT_PROBE(vfs, vop, " name ", return, a->a_" args[0] ", a, rc, 0, 0);\n"); printc("\tif (rc == 0) {"); for (i = 0; i < numargs; ++i) @@ -392,6 +378,7 @@ while ((getline < srcfile) > 0) { add_debug_code(name, args[i], "Error", "\t\t"); printc("\t}"); add_post(name); + printc("\tKTR_STOP" ctrstr); printc("\treturn (rc);"); printc("}\n"); |