[CTRACER]: Print the number of registered probes at module load time

vmlinux sk_buff example:

[ 1933.122713] ctracer: registered 331 probes

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
This commit is contained in:
Arnaldo Carvalho de Melo 2006-12-23 20:22:40 -02:00
parent 4c08435f55
commit d1a6c173b9
1 changed files with 5 additions and 1 deletions

View File

@ -181,15 +181,19 @@ static void emit_module_init(void)
printf("static int __attribute__ "
"((__section__ (\".init.text\"))) jprobe_init(void)\n"
"{\n"
" int i = 0;\n"
" unsigned int i = 0, n = 0;\n"
" while (jprobes[i] != (void *)0) {\n"
" int err = register_jprobe(jprobes[i]);\n"
" if (err != 0)\n"
" printk(\"register_jprobe(%%s) failed, "
"returned %%d\\n\",\n"
" jprobes[i]->kp.symbol_name, err);\n"
" else\n"
" ++n;\n"
" ++i;\n"
" }\n\n"
" printk(\"ctracer: registered %%u probes\\n\", n);\n"
"\n"
" return 0;\n"
"}\n\n");
emit_module_initcall("jprobe_init");