summaryrefslogtreecommitdiffstats
path: root/tapset-perfmon.cxx
diff options
context:
space:
mode:
authorJosh Stone <jistone@redhat.com>2009-09-02 16:14:08 -0700
committerJosh Stone <jistone@redhat.com>2009-09-02 16:14:08 -0700
commitaca66a36681ac7cbf7fcc2eac4dafc83d6559ef9 (patch)
tree0e8f39ae14f5793b37b0565c4a17811b696c9f9b /tapset-perfmon.cxx
parentd185503c723ded087ff987e8fa08c2418e60006b (diff)
downloadsystemtap-steved-aca66a36681ac7cbf7fcc2eac4dafc83d6559ef9.tar.gz
systemtap-steved-aca66a36681ac7cbf7fcc2eac4dafc83d6559ef9.tar.xz
systemtap-steved-aca66a36681ac7cbf7fcc2eac4dafc83d6559ef9.zip
Unify lex_cast* and avoid string copies
We always use lex_cast either to string or from string, so I made that explicit, and got rid of some string copies in the process. There was also stringify(), which was redundant to lex_cast<string>. We also always used lex_cast_hex to string, so that's now hard-coded and again eliminated a string copy. For lex_cast_qstring<string>, there's no need to write the streamify the input, so a specialization now operates directly on the input. Hopefully this is a bit cleaner, and I do measure it to be a little faster on scripts with many probes.
Diffstat (limited to 'tapset-perfmon.cxx')
-rw-r--r--tapset-perfmon.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/tapset-perfmon.cxx b/tapset-perfmon.cxx
index 827e88ca..56abb997 100644
--- a/tapset-perfmon.cxx
+++ b/tapset-perfmon.cxx
@@ -59,7 +59,7 @@ perfmon_var_expanding_visitor::visit_target_symbol (target_symbol *e)
string fname = string("_perfmon_tvar_get")
+ "_" + e->base_name.substr(1)
- + "_" + lex_cast<string>(counter_number);
+ + "_" + lex_cast(counter_number);
if (e->base_name != "$counter")
throw semantic_error ("target variables not available to perfmon probes");
@@ -70,7 +70,7 @@ perfmon_var_expanding_visitor::visit_target_symbol (target_symbol *e)
e->assert_no_components("perfmon");
ec->code = "THIS->__retvalue = _pfm_pmd_x[" +
- lex_cast<string>(counter_number) + "].reg_num;";
+ lex_cast(counter_number) + "].reg_num;";
ec->code += "/* pure */";
fdecl->name = fname;
fdecl->body = ec;
@@ -390,7 +390,7 @@ perfmon_derived_probe_group::emit_module_init (translator_output* o)
/* output the needed bits for pmc here */
for (unsigned i=0; i < outp.pfp_pmc_count; i++) {
o->newline() << "{.reg_num=" << pc[i].reg_num << ", "
- << ".reg_value=" << lex_cast_hex<string>(pc[i].reg_value)
+ << ".reg_value=" << lex_cast_hex(pc[i].reg_value)
<< "},";
}