summaryrefslogtreecommitdiffstats
path: root/staptree.cxx
diff options
context:
space:
mode:
authorfche <fche>2006-05-18 23:11:22 +0000
committerfche <fche>2006-05-18 23:11:22 +0000
commitc1d5f3f6338b04f3a1f5892f2a90baeb752de8d9 (patch)
tree15ba83f67626c8632dbdd2dc0f2737bcc623d2e6 /staptree.cxx
parent1e6f6015ab7a5918fc3a84bbeef34876169f1ff9 (diff)
downloadsystemtap-steved-c1d5f3f6338b04f3a1f5892f2a90baeb752de8d9.tar.gz
systemtap-steved-c1d5f3f6338b04f3a1f5892f2a90baeb752de8d9.tar.xz
systemtap-steved-c1d5f3f6338b04f3a1f5892f2a90baeb752de8d9.zip
2006-05-18 Frank Ch. Eigler <fche@elastic.org>
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.
Diffstat (limited to 'staptree.cxx')
-rw-r--r--staptree.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/staptree.cxx b/staptree.cxx
index 75c2c17d..676a4ec3 100644
--- a/staptree.cxx
+++ b/staptree.cxx
@@ -38,6 +38,17 @@ lex_cast_qstring(IN const & in)
}
+template <typename OUT, typename IN> inline OUT
+lex_cast(IN const & in)
+{
+ stringstream ss;
+ OUT out;
+ if (!(ss << in && ss >> out))
+ throw runtime_error("bad lexical cast");
+ return out;
+}
+
+
expression::expression ():
type (pe_unknown), tok (0)
{
@@ -101,9 +112,11 @@ probe_point::probe_point ():
}
+unsigned probe::last_probeidx = 0;
probe::probe ():
body (0), tok (0)
{
+ this->name = string ("probe_") + lex_cast<string>(last_probeidx ++);
}