summaryrefslogtreecommitdiffstats
path: root/tapsets.cxx
diff options
context:
space:
mode:
authorJosh Stone <jistone@redhat.com>2009-05-22 19:55:50 -0700
committerJosh Stone <jistone@redhat.com>2009-05-22 19:55:50 -0700
commitc9116e9980ad6e417697737f8d54a4a625811245 (patch)
treefc136ff1a6ba9673c3dbef395cba81791d2c00e8 /tapsets.cxx
parentb350f56b13f4e5acd5744cd71e4b26343aae8e6b (diff)
downloadsystemtap-steved-c9116e9980ad6e417697737f8d54a4a625811245.tar.gz
systemtap-steved-c9116e9980ad6e417697737f8d54a4a625811245.tar.xz
systemtap-steved-c9116e9980ad6e417697737f8d54a4a625811245.zip
Fix another kernel/kprobe.function conflict
Both kernel.function and kprobe.function were defining a global array stap_unreg_kprobes to use in bulk kprobes unregistration. The compiler allowed the duplicate definition as long as they were the same size, as it was when exercised in buildok/thirtyone. kprobe.function now uses a separate stap_unreg_kprobes2, and the testcase is modified to produce an imbalanced number of probes.
Diffstat (limited to 'tapsets.cxx')
-rw-r--r--tapsets.cxx14
1 files changed, 7 insertions, 7 deletions
diff --git a/tapsets.cxx b/tapsets.cxx
index 5335ea9c..e88928dc 100644
--- a/tapsets.cxx
+++ b/tapsets.cxx
@@ -4599,7 +4599,7 @@ kprobe_derived_probe_group::emit_module_decls (systemtap_session& s)
// Emit an array of kprobe/kretprobe pointers
s.op->newline() << "#if defined(STAPCONF_UNREGISTER_KPROBES)";
- s.op->newline() << "static void * stap_unreg_kprobes[" << probes_by_module.size() << "];";
+ s.op->newline() << "static void * stap_unreg_kprobes2[" << probes_by_module.size() << "];";
s.op->newline() << "#endif";
// Emit the actual probe list.
@@ -4795,27 +4795,27 @@ kprobe_derived_probe_group::emit_module_exit (systemtap_session& s)
s.op->newline() << "struct stap_dwarfless_kprobe *kp = & stap_dwarfless_kprobes[i];";
s.op->newline() << "if (! sdp->registered_p) continue;";
s.op->newline() << "if (!sdp->return_p)";
- s.op->newline(1) << "stap_unreg_kprobes[j++] = &kp->u.kp;";
+ s.op->newline(1) << "stap_unreg_kprobes2[j++] = &kp->u.kp;";
s.op->newline(-2) << "}";
- s.op->newline() << "unregister_kprobes((struct kprobe **)stap_unreg_kprobes, j);";
+ s.op->newline() << "unregister_kprobes((struct kprobe **)stap_unreg_kprobes2, j);";
s.op->newline() << "j = 0;";
s.op->newline() << "for (i=0; i<" << probes_by_module.size() << "; i++) {";
s.op->newline(1) << "struct stap_dwarfless_probe *sdp = & stap_dwarfless_probes[i];";
s.op->newline() << "struct stap_dwarfless_kprobe *kp = & stap_dwarfless_kprobes[i];";
s.op->newline() << "if (! sdp->registered_p) continue;";
s.op->newline() << "if (sdp->return_p)";
- s.op->newline(1) << "stap_unreg_kprobes[j++] = &kp->u.krp;";
+ s.op->newline(1) << "stap_unreg_kprobes2[j++] = &kp->u.krp;";
s.op->newline(-2) << "}";
- s.op->newline() << "unregister_kretprobes((struct kretprobe **)stap_unreg_kprobes, j);";
+ s.op->newline() << "unregister_kretprobes((struct kretprobe **)stap_unreg_kprobes2, j);";
s.op->newline() << "#ifdef __ia64__";
s.op->newline() << "j = 0;";
s.op->newline() << "for (i=0; i<" << probes_by_module.size() << "; i++) {";
s.op->newline(1) << "struct stap_dwarfless_probe *sdp = & stap_dwarfless_probes[i];";
s.op->newline() << "struct stap_dwarfless_kprobe *kp = & stap_dwarfless_kprobes[i];";
s.op->newline() << "if (! sdp->registered_p) continue;";
- s.op->newline() << "stap_unreg_kprobes[j++] = &kp->dummy;";
+ s.op->newline() << "stap_unreg_kprobes2[j++] = &kp->dummy;";
s.op->newline(-1) << "}";
- s.op->newline() << "unregister_kprobes((struct kprobe **)stap_unreg_kprobes, j);";
+ s.op->newline() << "unregister_kprobes((struct kprobe **)stap_unreg_kprobes2, j);";
s.op->newline() << "#endif";
s.op->newline() << "#endif";