Ugly script to add tracing.
authorRonald G. Minnich <rminnich@google.com>
Thu, 15 May 2014 03:10:42 +0000 (20:10 -0700)
committerRonald G. Minnich <rminnich@google.com>
Thu, 15 May 2014 03:10:42 +0000 (20:10 -0700)
This could be better but it's a start. I quick tested it with
ip and it seems to produce data.

Signed-off-by: Ronald G. Minnich <rminnich@google.com>
scripts/spatch/optrace.cocci [new file with mode: 0644]

diff --git a/scripts/spatch/optrace.cocci b/scripts/spatch/optrace.cocci
new file mode 100644 (file)
index 0000000..5fa393a
--- /dev/null
@@ -0,0 +1,18 @@
+// prints entry/exit when entering/leaving a function
+
+// for example, spatch with:
+// $ for i in kern/src/ns/ kern/src/net kern/drivers/; do \
+//       spatch --sp-file scripts/spatch/poor-ftrace.cocci  --in-place $i; done 
+// if you have functions you want to ignore, add them to the blacklist in
+// kern/src/kdebug.c
+@@
+type t;
+function f;
+@@
+t f(...) {
++TRACEME();
+<...
++TRACEME();
+return ...;
+...>
+}