diff options
author | jeff <jeff@FreeBSD.org> | 2002-09-23 05:50:07 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2002-09-23 05:50:07 +0000 |
commit | a1e3465870765c85d6a73efbf4c808531126ede9 (patch) | |
tree | 0640b62a87dde8188e95e92643ca7260797c3564 /sys/tools | |
parent | 48fb4349d069ed2be24f05aeb9a1b7c3f6e67fe4 (diff) | |
download | FreeBSD-src-a1e3465870765c85d6a73efbf4c808531126ede9.zip FreeBSD-src-a1e3465870765c85d6a73efbf4c808531126ede9.tar.gz |
- Automatically generate and insert KTR points in all VOPs.
Diffstat (limited to 'sys/tools')
-rw-r--r-- | sys/tools/vnode_if.awk | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/sys/tools/vnode_if.awk b/sys/tools/vnode_if.awk index d40bd41..7ff30c1 100644 --- a/sys/tools/vnode_if.awk +++ b/sys/tools/vnode_if.awk @@ -191,6 +191,9 @@ while ((getline < srcfile) > 0) { # Get the function name. name = $1; uname = toupper(name); + + # Start constructing a ktrpoint string + ctrstr = "\"" uname; # Get the function arguments. for (numargs = 0; ; ++numargs) { if ((getline < srcfile) <= 0) { @@ -233,7 +236,27 @@ 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; + else + ctrargs = numargs; + ctrstr = "\tCTR" ctrargs "(KTR_VOP, " ctrstr ")\""; + for (i = 0; i < ctrargs; ++i) + ctrstr = ctrstr ", " args[i]; + ctrstr = ctrstr ");"; if (hfile) { # Print out the vop_F_args structure. @@ -260,6 +283,7 @@ while ((getline < srcfile) > 0) { add_debug_code(name, args[i], "Entry"); add_debug_pre(name); printh("\trc = VCALL(" args[0] ", VOFFSET(" name "), &a);"); + printh(ctrstr); printh("if (rc == 0) {"); for (i = 0; i < numargs; ++i) add_debug_code(name, args[i], "OK"); |