summaryrefslogtreecommitdiffstats
path: root/buildrun.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 /buildrun.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 'buildrun.cxx')
-rw-r--r--buildrun.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/buildrun.cxx b/buildrun.cxx
index a40dab15..6bef4095 100644
--- a/buildrun.cxx
+++ b/buildrun.cxx
@@ -363,10 +363,10 @@ run_pass (systemtap_session& s)
staprun_cmd += "-c " + cmdstr_quoted(s.cmd) + " ";
if (s.target_pid)
- staprun_cmd += "-t " + stringify(s.target_pid) + " ";
+ staprun_cmd += "-t " + lex_cast(s.target_pid) + " ";
if (s.buffer_size)
- staprun_cmd += "-b " + stringify(s.buffer_size) + " ";
+ staprun_cmd += "-b " + lex_cast(s.buffer_size) + " ";
if (s.need_uprobes)
staprun_cmd += "-u ";
@@ -390,7 +390,7 @@ make_tracequery(systemtap_session& s, string& name,
const vector<string>& extra_headers)
{
static unsigned tick = 0;
- string basename("tracequery_kmod_" + lex_cast<string>(++tick));
+ string basename("tracequery_kmod_" + lex_cast(++tick));
// create a subdirectory for the module
string dir(s.tmpdir + "/" + basename);
@@ -461,7 +461,7 @@ static int
make_typequery_kmod(systemtap_session& s, const string& header, string& name)
{
static unsigned tick = 0;
- string basename("typequery_kmod_" + lex_cast<string>(++tick));
+ string basename("typequery_kmod_" + lex_cast(++tick));
// create a subdirectory for the module
string dir(s.tmpdir + "/" + basename);
@@ -519,7 +519,7 @@ make_typequery_umod(systemtap_session& s, const string& header, string& name)
{
static unsigned tick = 0;
- name = s.tmpdir + "/typequery_umod_" + lex_cast<string>(++tick) + ".so";
+ name = s.tmpdir + "/typequery_umod_" + lex_cast(++tick) + ".so";
// make the module
//