diff options
author | David Smith <dsmith@redhat.com> | 2008-06-09 13:10:14 -0500 |
---|---|---|
committer | David Smith <dsmith@redhat.com> | 2008-06-09 13:13:01 -0500 |
commit | 14cdaa0b0196d5ce8e45beae9f82de73e0c4a28d (patch) | |
tree | cf214150e1f3ef88dc5a5573e4ba209d6b191e18 | |
parent | 0c8b7d37152767709273c0e3de0f881f0d13b1b2 (diff) | |
download | systemtap-steved-14cdaa0b0196d5ce8e45beae9f82de73e0c4a28d.tar.gz systemtap-steved-14cdaa0b0196d5ce8e45beae9f82de73e0c4a28d.tar.xz systemtap-steved-14cdaa0b0196d5ce8e45beae9f82de73e0c4a28d.zip |
Made 2.6.25 kernel updates.
2008-06-09 David Smith <dsmith@redhat.com>
* tapsets.cxx (utrace_derived_probe::join_group): Removed
generated inclusion of tracehook.h.
(utrace_var_expanding_copy_visitor::visit_target_symbol): Uses
'_stp_arg(0)' to get value of '$syscall'.
2008-06-09 David Smith <dsmith@redhat.com>
* task_finder.c (__stp_utrace_task_finder_report_exec): Handles
2.6.25 kernels.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | runtime/ChangeLog | 5 | ||||
-rw-r--r-- | runtime/task_finder.c | 8 | ||||
-rw-r--r-- | tapsets.cxx | 46 |
4 files changed, 36 insertions, 30 deletions
@@ -1,3 +1,10 @@ +2008-06-09 David Smith <dsmith@redhat.com> + + * tapsets.cxx (utrace_derived_probe::join_group): Removed + generated inclusion of tracehook.h. + (utrace_var_expanding_copy_visitor::visit_target_symbol): Uses + '_stp_arg(0)' to get value of '$syscall'. + 2008-06-06 Stan Cox <scox@redhat.com> * tapsets.cxx (dwflpp::iterate_over_srcfile_lines): diff --git a/runtime/ChangeLog b/runtime/ChangeLog index 8ef5550f..373cbc16 100644 --- a/runtime/ChangeLog +++ b/runtime/ChangeLog @@ -1,3 +1,8 @@ +2008-06-09 David Smith <dsmith@redhat.com> + + * task_finder.c (__stp_utrace_task_finder_report_exec): Handles + 2.6.25 kernels. + 2008-06-06 David Smith <dsmith@redhat.com> * task_finder.c: Added some debug logic. Use diff --git a/runtime/task_finder.c b/runtime/task_finder.c index e233d463..9c8acfa0 100644 --- a/runtime/task_finder.c +++ b/runtime/task_finder.c @@ -418,10 +418,14 @@ __stp_utrace_task_finder_report_exec(struct utrace_attached_engine *engine, // '/bin/bash' clones and then execs '/bin/ls'. If the user // was probing '/bin/bash', the cloned thread is still // '/bin/bash' up until the exec. - if (tsk != NULL && tsk->parent != NULL && tsk->parent->pid > 1) { +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25) +#define real_parent parent +#endif + if (tsk != NULL && tsk->real_parent != NULL + && tsk->real_parent->pid > 1) { // We'll hardcode this as a process end, but a thread // *could* call exec (although they aren't supposed to). - __stp_utrace_attach_match_tsk(tsk->parent, tsk, 0, 1); + __stp_utrace_attach_match_tsk(tsk->real_parent, tsk, 0, 1); } // On exec, check bprm diff --git a/tapsets.cxx b/tapsets.cxx index 527272fa..a3b026d6 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -5207,15 +5207,9 @@ void utrace_derived_probe::join_group (systemtap_session& s) { if (! s.utrace_derived_probes) - { + { s.utrace_derived_probes = new utrace_derived_probe_group (); - - // Make sure <linux/tracehook.h> is included early. - embeddedcode *ec = new embeddedcode; - ec->tok = NULL; - ec->code = string("#include <linux/tracehook.h>\n"); - s.embeds.push_back(ec); - } + } s.utrace_derived_probes->enroll (this); task_finder_derived_probe_group::create_session_group (s); @@ -5261,28 +5255,24 @@ utrace_var_expanding_copy_visitor::visit_target_symbol (target_symbol* e) // Remember that we've seen a target variable. target_symbol_seen = true; - // Synthesize a function. - functiondecl *fdecl = new functiondecl; - fdecl->tok = e->tok; - embeddedcode *ec = new embeddedcode; - ec->tok = e->tok; - - string fname = (string("_utrace_syscall_get") + "_" - + lex_cast<string>(tick++)); - string locvalue = "CONTEXT->data"; - - ec->code = string("THIS->__retvalue = *tracehook_syscall_callno(CONTEXT->regs); /* pure */"); - - fdecl->name = fname; - fdecl->body = ec; - fdecl->type = pe_long; - - sess.functions.push_back(fdecl); - - // Synthesize a functioncall. + // We're going to substitute '_stp_arg(0)' for the '$syscall' + // reference. + + // First, synthesize the '0' argument. We can't use 'e->tok' as the + // token, since the token's type gets checked during pass 3. So, + // we'll synthesize a new token. + literal_number* arg = new literal_number(0); + token* arg_tok = new token; + arg_tok->type = tok_number; + arg_tok->location = e->tok->location; + arg_tok->content = e->tok->content; + arg->tok = arg_tok; + + // Synthesize a functioncall with our argument. functioncall* n = new functioncall; n->tok = e->tok; - n->function = fname; + n->function = "_stp_arg"; + n->args.push_back(arg); n->referent = 0; // NB: must not resolve yet, to ensure inclusion in session provide <functioncall*> (this, n); |