diff options
author | Frank Ch. Eigler <fche@elastic.org> | 2009-02-03 15:40:41 -0500 |
---|---|---|
committer | Frank Ch. Eigler <fche@elastic.org> | 2009-02-03 15:40:41 -0500 |
commit | 22f8b401b35f9d3fc17dc682dcf1785309206647 (patch) | |
tree | 6e480fc5479a303194c05a99b1490f3766109a7c | |
parent | 0c44723c0834224111db09284218d3104d149b44 (diff) | |
download | systemtap-steved-22f8b401b35f9d3fc17dc682dcf1785309206647.tar.gz systemtap-steved-22f8b401b35f9d3fc17dc682dcf1785309206647.tar.xz systemtap-steved-22f8b401b35f9d3fc17dc682dcf1785309206647.zip |
PR9810: Mostly revert "PR6961: initial sketch: set up dummy pt_regs for non-trap based probes"
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | tapset/ChangeLog | 5 | ||||
-rw-r--r-- | tapset/context-unwind.stp | 17 | ||||
-rw-r--r-- | tapsets.cxx | 37 | ||||
-rw-r--r-- | translate.cxx | 1 |
5 files changed, 31 insertions, 35 deletions
@@ -1,3 +1,9 @@ +2009-02-03 Frank Ch. Eigler <fche@elastic.org> + + PR6961/9810. + * tapsets.cxx (common_probe_entryfn_prologue): Revert. + * translate.cxx (emit_common_header): Revert. + 2009-02-03 Dave Brolley <brolley@redhat.com> * NEWS: Update status of client/server. diff --git a/tapset/ChangeLog b/tapset/ChangeLog index da184191..1a7df352 100644 --- a/tapset/ChangeLog +++ b/tapset/ChangeLog @@ -1,3 +1,8 @@ +2009-02-03 Frank Ch. Eigler <fche@elastic.org> + + PR 6961/9810. + * context-unwind.stp (print_backtrace, backtrace): Revert. + 2009-01-06 Frank Ch. Eigler <fche@elastic.org> PR 9699. diff --git a/tapset/context-unwind.stp b/tapset/context-unwind.stp index 4c5ed34b..a0836ed6 100644 --- a/tapset/context-unwind.stp +++ b/tapset/context-unwind.stp @@ -23,10 +23,11 @@ * except that deeper stack nesting may be supported. Return nothing. */ function print_backtrace () %{ - if (! CONTEXT->regs) - WARN_ON (! CONTEXT->regs); - else - _stp_stack_print(CONTEXT->regs, 1, CONTEXT->pi, MAXTRACE); + if (CONTEXT->regs) { + _stp_stack_print(CONTEXT->regs, 1, CONTEXT->pi, MAXTRACE); + } else { + _stp_printf("Systemtap probe: %s\n", CONTEXT->probe_point); + } %} /** @@ -36,10 +37,10 @@ function print_backtrace () %{ * stack. It may be truncated due to maximum string length. */ function backtrace:string () %{ /* pure */ - if (! CONTEXT->regs) - WARN_ON (! CONTEXT->regs); - else - _stp_stack_snprint (THIS->__retvalue, MAXSTRINGLEN, CONTEXT->regs, 0, CONTEXT->pi, MAXTRACE); + if (CONTEXT->regs) + _stp_stack_snprint (THIS->__retvalue, MAXSTRINGLEN, CONTEXT->regs, 0, CONTEXT->pi, MAXTRACE); + else + strlcpy (THIS->__retvalue, "", MAXSTRINGLEN); %} /** diff --git a/tapsets.cxx b/tapsets.cxx index 86e4a1e3..c8742fbd 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -159,8 +159,7 @@ be_derived_probe::join_group (systemtap_session& s) void common_probe_entryfn_prologue (translator_output* o, string statestr, bool overload_processing = true, - bool interruptible = true, - bool fakeregs = false) + bool interruptible = true) { o->newline() << "struct context* __restrict__ c;"; if (! interruptible) @@ -216,6 +215,7 @@ common_probe_entryfn_prologue (translator_output* o, string statestr, o->newline() << "c->last_stmt = 0;"; o->newline() << "c->last_error = 0;"; o->newline() << "c->nesting = 0;"; + o->newline() << "c->regs = 0;"; o->newline() << "c->unwaddr = 0;"; // reset unwound address cache o->newline() << "c->pi = 0;"; @@ -240,20 +240,6 @@ common_probe_entryfn_prologue (translator_output* o, string statestr, o->newline() << "c->cycles_base = 0;"; o->newline() << "#endif"; */ - - /* PR6961: Let's prep a bare-bones pt_regs struct, just in case our - kind of probe point does not supply one. */ - if (fakeregs) - { - o->newline() << "#ifdef STP_NEED_UNWIND_DATA"; - o->newline() << "memset (& c->regs_buffer, 0, sizeof (c->regs_buffer));"; - o->newline() << "REG_IP((& c->regs_buffer)) = (unsigned long)__builtin_return_address (0);"; - o->newline() << "REG_SP((& c->regs_buffer)) = (unsigned long)& c;"; - o->newline() << "c->regs = & c->regs_buffer;"; - o->newline() << "#endif"; - } - else - o->newline() << "c->regs = 0;"; } @@ -352,7 +338,7 @@ be_derived_probe_group::emit_module_decls (systemtap_session& s) s.op->newline() << "/* ---- begin/end probes ---- */"; s.op->newline() << "static void enter_begin_probe (void (*fn)(struct context*), const char* pp) {"; s.op->indent(1); - common_probe_entryfn_prologue (s.op, "STAP_SESSION_STARTING", false, true, true); + common_probe_entryfn_prologue (s.op, "STAP_SESSION_STARTING", false, true); s.op->newline() << "c->probe_point = pp;"; s.op->newline() << "(*fn) (c);"; common_probe_entryfn_epilogue (s.op, false, true); @@ -360,7 +346,7 @@ be_derived_probe_group::emit_module_decls (systemtap_session& s) s.op->newline() << "static void enter_end_probe (void (*fn)(struct context*), const char* pp) {"; s.op->indent(1); - common_probe_entryfn_prologue (s.op, "STAP_SESSION_STOPPING", false, true, true); + common_probe_entryfn_prologue (s.op, "STAP_SESSION_STOPPING", false, true); s.op->newline() << "c->probe_point = pp;"; s.op->newline() << "(*fn) (c);"; common_probe_entryfn_epilogue (s.op, false, true); @@ -368,7 +354,7 @@ be_derived_probe_group::emit_module_decls (systemtap_session& s) s.op->newline() << "static void enter_error_probe (void (*fn)(struct context*), const char* pp) {"; s.op->indent(1); - common_probe_entryfn_prologue (s.op, "STAP_SESSION_ERROR", false, true, true); + common_probe_entryfn_prologue (s.op, "STAP_SESSION_ERROR", false, true); s.op->newline() << "c->probe_point = pp;"; s.op->newline() << "(*fn) (c);"; common_probe_entryfn_epilogue (s.op, false, true); @@ -6699,7 +6685,7 @@ utrace_derived_probe_group::emit_module_decls (systemtap_session& s) s.op->newline() << "static void stap_utrace_probe_handler(struct task_struct *tsk, struct stap_utrace_probe *p) {"; s.op->indent(1); - common_probe_entryfn_prologue (s.op, "STAP_SESSION_RUNNING", true, true, true); + common_probe_entryfn_prologue (s.op, "STAP_SESSION_RUNNING"); s.op->newline() << "c->probe_point = p->pp;"; // call probe function @@ -7553,7 +7539,7 @@ timer_derived_probe_group::emit_module_decls (systemtap_session& s) s.op->line() << ");"; s.op->newline(-1) << "{"; s.op->indent(1); - common_probe_entryfn_prologue (s.op, "STAP_SESSION_RUNNING", true, true, true); + common_probe_entryfn_prologue (s.op, "STAP_SESSION_RUNNING"); s.op->newline() << "c->probe_point = stp->pp;"; s.op->newline() << "(*stp->ph) (c);"; common_probe_entryfn_epilogue (s.op); @@ -7932,7 +7918,7 @@ procfs_derived_probe_group::emit_module_decls (systemtap_session& s) s.op->newline() << "int bytes = 0;"; s.op->newline() << "string_t strdata = {'\\0'};"; - common_probe_entryfn_prologue (s.op, "STAP_SESSION_RUNNING", true, true, true); + common_probe_entryfn_prologue (s.op, "STAP_SESSION_RUNNING"); s.op->newline() << "c->probe_point = spp->read_pp;"; s.op->newline() << "if (c->data == NULL)"; @@ -7975,7 +7961,7 @@ procfs_derived_probe_group::emit_module_decls (systemtap_session& s) s.op->newline(1) << "struct stap_procfs_probe *spp = (struct stap_procfs_probe *)data;"; s.op->newline() << "string_t strdata = {'\\0'};"; - common_probe_entryfn_prologue (s.op, "STAP_SESSION_RUNNING", true, true, true); + common_probe_entryfn_prologue (s.op, "STAP_SESSION_RUNNING"); s.op->newline() << "c->probe_point = spp->write_pp;"; s.op->newline() << "if (count > (MAXSTRINGLEN - 1))"; @@ -8737,7 +8723,7 @@ mark_derived_probe_group::emit_module_decls (systemtap_session& s) s.op->newline(); s.op->newline() << "static void enter_marker_probe (void *probe_data, void *call_data, const char *fmt, va_list *args) {"; s.op->newline(1) << "struct stap_marker_probe *smp = (struct stap_marker_probe *)probe_data;"; - common_probe_entryfn_prologue (s.op, "STAP_SESSION_RUNNING", true, true, true); + common_probe_entryfn_prologue (s.op, "STAP_SESSION_RUNNING"); s.op->newline() << "c->probe_point = smp->pp;"; s.op->newline() << "c->marker_name = smp->name;"; s.op->newline() << "c->marker_format = smp->format;"; @@ -8920,7 +8906,6 @@ mark_builder::build(systemtap_session & sess, it->first, it->second, base, loc); finished_results.push_back (dp); - sess.unwindsym_modules.insert ("kernel"); } } } @@ -9067,7 +9052,7 @@ hrtimer_derived_probe_group::emit_module_decls (systemtap_session& s) s.op->newline(-1) << "}"; s.op->newline() << "{"; s.op->indent(1); - common_probe_entryfn_prologue (s.op, "STAP_SESSION_RUNNING", true, true, true); + common_probe_entryfn_prologue (s.op, "STAP_SESSION_RUNNING"); s.op->newline() << "c->probe_point = stp->pp;"; s.op->newline() << "(*stp->ph) (c);"; common_probe_entryfn_epilogue (s.op); diff --git a/translate.cxx b/translate.cxx index d3298802..0d430ea3 100644 --- a/translate.cxx +++ b/translate.cxx @@ -884,7 +884,6 @@ c_unparser::emit_common_header () // While it's 0, execution continues // When it's "something", probe code unwinds, _stp_error's, sets error state o->newline() << "const char *last_stmt;"; - o->newline() << "struct pt_regs regs_buffer;"; // reserved for synthetic o->newline() << "struct pt_regs *regs;"; o->newline() << "unsigned long *unwaddr;"; // unwaddr is caching unwound address in each probe handler on ia64. |