summaryrefslogtreecommitdiffstats
path: root/sys/tools
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2012-12-19 20:10:00 +0000
committerjeff <jeff@FreeBSD.org>2012-12-19 20:10:00 +0000
commit0a985cfcdeb6ea9385d67b191d021ed1b74c3702 (patch)
treecd571f104bffb0f3f5a4efd15e32b9a8308f6e50 /sys/tools
parentc3865e85e8e1cef7a04d07ee0792b609bb665706 (diff)
downloadFreeBSD-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/tools')
-rw-r--r--sys/tools/vnode_if.awk27
1 files changed, 7 insertions, 20 deletions
diff --git a/sys/tools/vnode_if.awk b/sys/tools/vnode_if.awk
index 5e194a8..fc12ce9 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");
OpenPOWER on IntegriCloud