diff options
author | fche <fche> | 2005-11-24 21:18:37 +0000 |
---|---|---|
committer | fche <fche> | 2005-11-24 21:18:37 +0000 |
commit | ded98b334e86a6f6aed6a30a20b67aecc0ae1bf4 (patch) | |
tree | 8dc3c5dddde991dd4b34a0d17563e68048ed9970 /tapsets.cxx | |
parent | 07c17d677a8080492b4a67b664f4cc9557f5dda3 (diff) | |
download | systemtap-steved-ded98b334e86a6f6aed6a30a20b67aecc0ae1bf4.tar.gz systemtap-steved-ded98b334e86a6f6aed6a30a20b67aecc0ae1bf4.tar.xz systemtap-steved-ded98b334e86a6f6aed6a30a20b67aecc0ae1bf4.zip |
2005-11-24 Frank Ch. Eigler <fche@redhat.com>
PR 1917
* translate.cxx (emit_common_header, emit_module_init,
emit_module_exit): Switch context array to per-cpu kmalloc variant.
* tapsets (*::emit_probe_entires): Use per_cpu_ptr() for my context.
Diffstat (limited to 'tapsets.cxx')
-rw-r--r-- | tapsets.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tapsets.cxx b/tapsets.cxx index fdf1b999..415bc31a 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -146,7 +146,7 @@ be_derived_probe::emit_probe_entries (translator_output* o, unsigned j) // While begin/end probes are executed single-threaded, we // still code defensively and use a per-cpu context. - o->newline(1) << "struct context* c = & contexts [smp_processor_id()];"; + o->newline(1) << "struct context* c = per_cpu_ptr (contexts, smp_processor_id());"; o->newline() << "const char* probe_point = " << lex_cast_qstring(*l) << ";"; @@ -2754,7 +2754,7 @@ dwarf_derived_probe::emit_probe_entries (translator_output* o, { o->newline() << "int stap_kprobe_fault_handler (struct kprobe* kp, " << "struct pt_regs* regs, int trapnr) {"; - o->newline(1) << "struct context *c = & contexts [smp_processor_id()];"; + o->newline(1) << "struct context* c = per_cpu_ptr (contexts, smp_processor_id());"; o->newline() << "_stp_warn (\"systemtap probe fault\\n\");"; o->newline() << "_stp_warn (\"cpu %d, probe %s, near %s\\n\", "; o->newline(1) << "smp_processor_id(), "; @@ -2851,7 +2851,7 @@ dwarf_derived_probe::emit_probe_entries (translator_output* o, else o->line() << "struct kprobe *probe_instance"; o->line() << ", struct pt_regs *regs) {"; - o->newline(1) << "struct context *c = & contexts [smp_processor_id()];"; + o->newline(1) << "struct context* c = per_cpu_ptr (contexts, smp_processor_id());"; // Calculate the name of the current probe by finding its index in the probe array. if (has_return) @@ -3017,7 +3017,7 @@ timer_derived_probe::emit_probe_entries (translator_output* o, unsigned j) o->newline() << "static struct timer_list timer_" << j << ";"; o->newline() << "void enter_" << j << " (unsigned long val) {"; - o->newline(1) << "struct context* c = & contexts [smp_processor_id()];"; + o->newline(1) << "struct context* c = per_cpu_ptr (contexts, smp_processor_id());"; o->newline() << "const char* probe_point = " << lex_cast_qstring(*locations[0]) << ";"; o->newline() << "(void) val;"; |