From c1d5f3f6338b04f3a1f5892f2a90baeb752de8d9 Mon Sep 17 00:00:00 2001 From: fche Date: Thu, 18 May 2006 23:11:22 +0000 Subject: 2006-05-18 Frank Ch. Eigler Organize "-t" output by script/parse level probes rather than derived-probes. * elaborate.cxx (derived_probe ctor): Remove name field setting. (alias_derived_probe): New class. (alias_expandion_builder::build): Create an instance of the above instead of parse-tree-level plain probe. * elaborate.h: Corresponding changes. (derived_probe::basest): Define. * staptree.cxx (probe ctor): Set new name field. * staptree.h (probe): Corresponding changes. (probe::basest): New field. * tapsets.cxx (emit_probe_prologue, emit_probe_entries): Switch to basest() probe name for Stat instance. (dwarf_derived_probe ctor): Stash away base probe. * translate.cxx (unparser::emit_probe): Remove index operand, just use probe name to generate symbols. (emit_module_init): Reorganize -t output in unregister functions. (translate_pass): Remove unparser::current_probenum field and all uses. * translate.h: Corresponding changes. --- tapsets.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tapsets.cxx') diff --git a/tapsets.cxx b/tapsets.cxx index d562677b..9cb93e68 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -151,7 +151,7 @@ derived_probe::emit_probe_epilogue (translator_output* o) o->newline() << "int64_t cycles_elapsed = (cycles_atend > cycles_atstart)"; o->newline(1) << "? (int64_t) (cycles_atend - cycles_atstart)"; o->newline() << ": (int64_t) (~(cycles_t)0) - cycles_atstart + cycles_atend + 1;"; - o->newline() << "_stp_stat_add(time_" << name << ",cycles_elapsed);"; + o->newline() << "_stp_stat_add(time_" << basest()->name << ",cycles_elapsed);"; o->indent(-1); o->newline(-1) << "}"; o->newline() << "#endif"; @@ -215,7 +215,7 @@ void be_derived_probe::emit_probe_entries (translator_output* o) { o->newline() << "#ifdef STP_TIMING"; - o->newline() << "static __cacheline_aligned Stat " << "time_" << name << ";"; + o->newline() << "static __cacheline_aligned Stat " << "time_" << basest()->name << ";"; o->newline() << "#endif"; for (unsigned i=0; inewline(); o->newline() << "#ifdef STP_TIMING"; - o->newline() << "static __cacheline_aligned Stat " << "time_" << name << ";"; + o->newline() << "static __cacheline_aligned Stat " << "time_" << basest()->name << ";"; o->newline() << "#endif"; // Construct a single entry function, and a struct kprobe pointing into -- cgit