[CTRACER]: Fully qualify the probe by using the CU name

I.e. now we use this systemtap syntax:

probe mtrr_write = kernel.function("mtrr_write@arch/i386/kernel/cpu/mtrr/if.c")

mtrr_write is the function, followed by @ and then the CU, i.e. the source for
the object file (CU) where the function is.

This way we can support global namespace clashes.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Arnaldo Carvalho de Melo 2007-11-17 18:10:37 -02:00
parent 06b3a1073e
commit 4e406446d0
1 changed files with 2 additions and 1 deletions

View File

@ -745,13 +745,14 @@ static int function__emit_probes(struct function *self, const struct cu *cu,
struct parameter *pos;
const char *name = function__name(self, cu);
fprintf(fp_methods, "probe %s%s = kernel.function(\"%s\")%s\n"
fprintf(fp_methods, "probe %s%s = kernel.function(\"%s@%s\")%s\n"
"{\n"
"}\n\n"
"probe %s%s\n"
"{\n", name,
probe_type == 0 ? "" : "__return",
name,
cu->name,
probe_type == 0 ? "" : ".return",
name,
probe_type == 0 ? "" : "__return");