summaryrefslogtreecommitdiffstats
path: root/tapsets.cxx
diff options
context:
space:
mode:
authorDavid Smith <dsmith@redhat.com>2008-06-09 13:10:14 -0500
committerDavid Smith <dsmith@redhat.com>2008-06-09 13:13:01 -0500
commit14cdaa0b0196d5ce8e45beae9f82de73e0c4a28d (patch)
treecf214150e1f3ef88dc5a5573e4ba209d6b191e18 /tapsets.cxx
parent0c8b7d37152767709273c0e3de0f881f0d13b1b2 (diff)
downloadsystemtap-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.
Diffstat (limited to 'tapsets.cxx')
-rw-r--r--tapsets.cxx46
1 files changed, 18 insertions, 28 deletions
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);