[Tiny PATCH] kernel/ksyms.c: export do_fork() for event tracing

Ben Gertzfield (che@debian.org)
27 Oct 1998 12:40:45 -0800


I'm working with a group of researchers on implementing the DFSTrace
filesystem and process event tracing system from CMU in the Linux
kernel, and in order to intercept calls to do_fork(), we replace the
sys_call_table[] entry for __NR_fork with our own function that
performs the trace then calls do_fork() with the same struct pt_regs
that was passed to it.

However, since do_fork() is not exported from kernel/ksyms.c, we can't
make our DFSTrace code into a module without requiring a kernel patch
to export do_fork() from kernel/ksyms.c.

Here's a tiny patch to export this function for anyone who wishes to
trace fork() in this manner. Of course, if it made it into the
upstream kernel, it'd make the DFSTrace porting team's life much
easier ;)

Thanks,

Ben

--- kernel/ksyms.c.orig Tue Oct 27 12:28:01 1998
+++ kernel/ksyms.c Tue Oct 27 12:28:25 1998
@@ -405,3 +405,6 @@

/* library functions */
EXPORT_SYMBOL(strnicmp);
+
+/* DFSTrace event tracing */
+EXPORT_SYMBOL(do_fork);

-- 
Brought to you by the letters G and O and the number 6.
"Oh, all right, Uncle Ulty REALLY wants you to do his portrait." -- FF6
Debian GNU/Linux -- where do you want to go tomorrow? http://www.debian.org/
I'm on FurryMUCK as Che, and EFNet and YiffNet IRC as Che_Fox.

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/