summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@elastic.org>2008-08-07 13:50:09 -0400
committerFrank Ch. Eigler <fche@elastic.org>2008-08-07 13:50:09 -0400
commit12a7f85b2dd19fbfa34c81f6cba15015a8a2723d (patch)
treea6281a0a52c2bada70748f6fef8c5b65e3d7cac8
parent104c6237f97a4a04b5473210ed6cde7509b12b08 (diff)
downloadsystemtap-steved-12a7f85b2dd19fbfa34c81f6cba15015a8a2723d.tar.gz
systemtap-steved-12a7f85b2dd19fbfa34c81f6cba15015a8a2723d.tar.xz
systemtap-steved-12a7f85b2dd19fbfa34c81f6cba15015a8a2723d.zip
rework utrace $syscall var to expand to tapset fn, not synthetic hard-coded one
-rw-r--r--ChangeLog6
-rw-r--r--tapset/ChangeLog3
-rw-r--r--tapset/utrace.stp11
-rw-r--r--tapsets.cxx21
4 files changed, 21 insertions, 20 deletions
diff --git a/ChangeLog b/ChangeLog
index 09e2ff37..5fe46e57 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-08-07 Frank Ch. Eigler <fche@elastic.org>
+
+ * tapsetes.cxx
+ (utrace_var_expanding_copy_visitor::visit_target_symbol):
+ Defer to new tapset function instead of synthesized embedded-c.
+
2008-08-05 Stan Cox <scox@redhat.com>
* NEWS: Updated $$vars, $$parms, $$locals.
diff --git a/tapset/ChangeLog b/tapset/ChangeLog
index b2592e1e..779a2e30 100644
--- a/tapset/ChangeLog
+++ b/tapset/ChangeLog
@@ -1,3 +1,6 @@
+2008-08-07 Frank Ch. Eigler <fche@elastic.org>
+
+ * utrace.stp: New file, for use by utrace $var expansions.
2008-08-04 Wenji Huang <wenji.huang@oracle.com>
diff --git a/tapset/utrace.stp b/tapset/utrace.stp
new file mode 100644
index 00000000..3831ca3c
--- /dev/null
+++ b/tapset/utrace.stp
@@ -0,0 +1,11 @@
+/* utrace-only subset of register accessors */
+
+
+%{
+#include "syscall.h"
+%}
+
+
+function _utrace_syscall_nr:long () %{
+ THIS->__retvalue = __stp_user_syscall_nr(CONTEXT->regs); /* pure */
+%}
diff --git a/tapsets.cxx b/tapsets.cxx
index 4823bb9c..ab5713b0 100644
--- a/tapsets.cxx
+++ b/tapsets.cxx
@@ -5799,14 +5799,11 @@ struct utrace_var_expanding_copy_visitor: public var_expanding_copy_visitor
string probe_name;
enum utrace_derived_probe_flags flags;
bool target_symbol_seen;
- static bool syscall_function_added;
void visit_target_symbol (target_symbol* e);
};
-bool utrace_var_expanding_copy_visitor::syscall_function_added = false;
-
utrace_derived_probe::utrace_derived_probe (systemtap_session &s,
probe* p, probe_point* l,
@@ -5874,27 +5871,11 @@ 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 to grab the syscall .
- if (! syscall_function_added)
- {
- functiondecl *fdecl = new functiondecl;
- fdecl->tok = e->tok;
- embeddedcode *ec = new embeddedcode;
- ec->tok = e->tok;
- ec->code = string("THIS->__retvalue = __stp_user_syscall_nr(CONTEXT->regs); /* pure */");
-
- fdecl->name = string("_syscall_nr_get");
- fdecl->body = ec;
- fdecl->type = pe_long;
- sess.functions.push_back(fdecl);
- syscall_function_added = true;
- }
-
// We're going to substitute a synthesized '_syscall_nr_get'
// function call for the '$syscall' reference.
functioncall* n = new functioncall;
n->tok = e->tok;
- n->function = "_syscall_nr_get";
+ n->function = "_utrace_syscall_nr";
n->referent = 0; // NB: must not resolve yet, to ensure inclusion in session
provide <functioncall*> (this, n);