Create a module which declares ipc tracepoint probes, using markers. Signed-off-by: Mathieu Desnoyers CC: Alexander Viro CC: 'Peter Zijlstra' CC: "Frank Ch. Eigler" CC: 'Ingo Molnar' CC: 'Hideo AOKI' CC: Takashi Nishiie CC: 'Steven Rostedt' CC: Masami Hiramatsu --- ipc/Makefile | 2 +- ipc/ipc-trace.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 1 deletion(-) Index: linux-2.6-lttng/ipc/Makefile =================================================================== --- linux-2.6-lttng.orig/ipc/Makefile 2008-07-04 10:04:27.000000000 -0400 +++ linux-2.6-lttng/ipc/Makefile 2008-07-04 10:04:32.000000000 -0400 @@ -8,4 +8,4 @@ obj-$(CONFIG_SYSVIPC_SYSCTL) += ipc_sysc obj_mq-$(CONFIG_COMPAT) += compat_mq.o obj-$(CONFIG_POSIX_MQUEUE) += mqueue.o msgutil.o $(obj_mq-y) obj-$(CONFIG_IPC_NS) += namespace.o - +obj-$(CONFIG_TRACEPROBES) += ipc-trace.o Index: linux-2.6-lttng/ipc/ipc-trace.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ linux-2.6-lttng/ipc/ipc-trace.c 2008-07-04 10:15:10.000000000 -0400 @@ -0,0 +1,52 @@ +/* + * ipc/ipc-trace.c + * + * IPC tracepoint probes. + */ + +#include +#include "ipc-trace.h" + +static void probe_ipc_msg_create(long id, int flags) +{ + trace_mark(ipc_msg_create, "id %ld flags %d", id, flags); +} + +static void probe_ipc_sem_create(long id, int flags) +{ + trace_mark(ipc_sem_create, "id %ld flags %d", id, flags); +} + +static void probe_ipc_shm_create(long id, int flags) +{ + trace_mark(ipc_shm_create, "id %ld flags %d", id, flags); +} + +int __init ipc_trace_init(void) +{ + int ret; + + ret = register_trace_ipc_msg_create(probe_ipc_msg_create); + WARN_ON(ret); + ret = register_trace_ipc_sem_create(probe_ipc_sem_create); + WARN_ON(ret); + ret = register_trace_ipc_shm_create(probe_ipc_shm_create); + WARN_ON(ret); + + return 0; +} + +module_init(ipc_trace_init); + +void __exit ipc_trace_exit(void) +{ + unregister_trace_ipc_shm_create(probe_ipc_shm_create); + unregister_trace_ipc_sem_create(probe_ipc_sem_create); + unregister_trace_ipc_msg_create(probe_ipc_msg_create); +} + +module_exit(ipc_trace_exit); + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Mathieu Desnoyers"); +MODULE_DESCRIPTION("IPC Tracepoint Probes"); -- Mathieu Desnoyers Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/