summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMasami Hiramatsu <mhiramat@redhat.com>2008-11-04 10:05:39 -0500
committerFrank Ch. Eigler <fche@elastic.org>2008-11-04 10:05:39 -0500
commitb95e2b79d84654ca890f7f2b02ae2c5f4e836eaf (patch)
tree272ab84a1bcd381c7cd1ddab4651d846aa328cfc
parentbbd2860f9c95fbef790a2f414c8fc6548c5fec3d (diff)
downloadsystemtap-steved-b95e2b79d84654ca890f7f2b02ae2c5f4e836eaf.tar.gz
systemtap-steved-b95e2b79d84654ca890f7f2b02ae2c5f4e836eaf.tar.xz
systemtap-steved-b95e2b79d84654ca890f7f2b02ae2c5f4e836eaf.zip
PR6028 / BZ468143: ia64 fetch-register speedup
-rw-r--r--ChangeLog9
-rw-r--r--runtime/ChangeLog5
-rw-r--r--runtime/regs-ia64.c13
-rw-r--r--tapsets.cxx15
4 files changed, 36 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 6e9cd7f4..f7ecbb90 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2008-11-04 Frank Ch. Eigler <fche@elastic.org>
+
+ From Masami Hiramatsu <mhiramat@redhat.com>, PR 6028.
+ * tapsets.cxx (dwarf_derived_probe): New field access_vars, for
+ tracking result from ..
+ (dwarf_var_expanding_copy_visitor): Collect a flag about whether
+ any $expressions appear within.
+ (emit_probe_local_init): ... and run ia64 bspcache() on if true.
+
2008-11-03 Jim Keniston <jkenisto@us.ibm.com>
Add a version of uprobes that works with the 2.6.27 version of utrace.
diff --git a/runtime/ChangeLog b/runtime/ChangeLog
index a59af1b7..e4ea3330 100644
--- a/runtime/ChangeLog
+++ b/runtime/ChangeLog
@@ -1,3 +1,8 @@
+2008-11-04 Frank Ch. Eigler <fche@elastic.org>
+
+ From Masami Hiramatsu <mhiramat@redhat.com>, PR 6028.
+ * regs-ia64.c (bspcache): Expand documentation.
+
2008-10-28 Frank Ch. Eigler <fche@elastic.org>
From Jim Keniston:
diff --git a/runtime/regs-ia64.c b/runtime/regs-ia64.c
index f884c5f8..c78a757e 100644
--- a/runtime/regs-ia64.c
+++ b/runtime/regs-ia64.c
@@ -36,8 +36,17 @@ static void ia64_stap_get_arbsp(struct unw_frame_info *info, void *arg)
}
/*
- * bspcache: get cached unwound address and
- * set a probe local cache of the offset of unwound address.
+ * bspcache: get cached unwound address from current BSP and
+ * set a static local cache of the offset of unwound address
+ * if the static local cache(variable) is not set.
+ * The unwound address means the BSP value when the kprobe
+ * was hit. This macro stores the difference of BSP between
+ * when the kprobe was hit and when this macro was called.
+ * Since the difference depends on how much stack is consumed
+ * from when the kprobe was hit, this macro *MUST NOT* be put
+ * on the path which several functions execute (in that case,
+ * each time the difference is changed and this macro can't
+ * return correct unwound address).
*/
#define bspcache(cache, regs)\
if(regs) {\
diff --git a/tapsets.cxx b/tapsets.cxx
index 0df55d51..5acf50cb 100644
--- a/tapsets.cxx
+++ b/tapsets.cxx
@@ -2397,6 +2397,7 @@ struct dwarf_derived_probe: public derived_probe
bool has_return;
bool has_maxactive;
long maxactive_val;
+ bool access_vars;
void printsig (std::ostream &o) const;
void join_group (systemtap_session& s);
@@ -4104,9 +4105,10 @@ struct dwarf_var_expanding_copy_visitor: public var_expanding_copy_visitor
block *add_block;
probe *add_probe;
std::map<std::string, symbol *> return_ts_map;
+ bool visited;
dwarf_var_expanding_copy_visitor(dwarf_query & q, Dwarf_Die *sd, Dwarf_Addr a):
- q(q), scope_die(sd), addr(a), add_block(NULL), add_probe(NULL) {}
+ q(q), scope_die(sd), addr(a), add_block(NULL), add_probe(NULL), visited(false) {}
void visit_target_symbol (target_symbol* e);
};
@@ -4172,6 +4174,7 @@ void
dwarf_var_expanding_copy_visitor::visit_target_symbol (target_symbol *e)
{
assert(e->base_name.size() > 0 && e->base_name[0] == '$');
+ visited = true;
bool lvalue = is_active_lvalue(e);
if (lvalue && !q.sess.guru_mode)
@@ -4709,6 +4712,7 @@ dwarf_derived_probe::dwarf_derived_probe(const string& funcname,
throw semantic_error ("inconsistent relocation address", q.base_loc->tok);
this->tok = q.base_probe->tok;
+ this->access_vars = false;
// XXX: hack for strange g++/gcc's
#ifndef USHRT_MAX
@@ -4726,12 +4730,12 @@ dwarf_derived_probe::dwarf_derived_probe(const string& funcname,
{
dwarf_var_expanding_copy_visitor v (q, scope_die, dwfl_addr);
require <statement*> (&v, &(this->body), this->body);
+ this->access_vars = v.visited;
// If during target-variable-expanding the probe, we added a new block
// of code, add it to the start of the probe.
if (v.add_block)
this->body = new block(v.add_block, this->body);
-
// If when target-variable-expanding the probe, we added a new
// probe, add it in a new file to the list of files to be processed.
if (v.add_probe)
@@ -4857,8 +4861,11 @@ dwarf_derived_probe::register_patterns(match_node * root)
void
dwarf_derived_probe::emit_probe_local_init(translator_output * o)
{
- // emit bsp cache setup
- o->newline() << "bspcache(c->unwaddr, c->regs);";
+ if (access_vars)
+ {
+ // if accessing $variables, emit bsp cache setup for speeding up
+ o->newline() << "bspcache(c->unwaddr, c->regs);";
+ }
}
// ------------------------------------------------------------------------