summaryrefslogtreecommitdiffstats
path: root/tapset-perfmon.cxx
diff options
context:
space:
mode:
authorJosh Stone <jistone@redhat.com>2009-08-26 17:35:54 -0700
committerJosh Stone <jistone@redhat.com>2009-08-26 17:41:34 -0700
commit546499713651809f026e118f81b9c52f01c895f6 (patch)
tree6ab0d7f6c03f69e5aac93be21ad7e9050412f0fa /tapset-perfmon.cxx
parent8a9a609f15c3088bcaaf9728393662372f91ab62 (diff)
downloadsystemtap-steved-546499713651809f026e118f81b9c52f01c895f6.tar.gz
systemtap-steved-546499713651809f026e118f81b9c52f01c895f6.tar.xz
systemtap-steved-546499713651809f026e118f81b9c52f01c895f6.zip
Remove unnecessary static members
When a static class member is only used by a single method, it's more concise to use a static local variable instead. * staptree.cxx (probe::probe): Make last_probeidx a static local. * tapset-perfmon.cxx (perfmon_derived_probe::perfmon_derived_probe): Make probes_allocated a static local.
Diffstat (limited to 'tapset-perfmon.cxx')
-rw-r--r--tapset-perfmon.cxx10
1 files changed, 2 insertions, 8 deletions
diff --git a/tapset-perfmon.cxx b/tapset-perfmon.cxx
index 86806d61..827e88ca 100644
--- a/tapset-perfmon.cxx
+++ b/tapset-perfmon.cxx
@@ -96,10 +96,6 @@ enum perfmon_mode
struct perfmon_derived_probe: public derived_probe
{
-protected:
- static unsigned probes_allocated;
-
-public:
systemtap_session & sess;
string event;
perfmon_mode mode;
@@ -142,17 +138,15 @@ struct perfmon_builder: public derived_probe_builder
};
-unsigned perfmon_derived_probe::probes_allocated;
-
perfmon_derived_probe::perfmon_derived_probe (probe* p, probe_point* l,
systemtap_session &s,
string e, perfmon_mode m)
: derived_probe (p, l), sess(s), event(e), mode(m)
{
- ++probes_allocated;
+ static unsigned probes_allocated = 0;
// Now expand the local variables in the probe body
- perfmon_var_expanding_visitor v (sess, probes_allocated-1);
+ perfmon_var_expanding_visitor v (sess, probes_allocated++);
v.replace (this->body);
if (sess.verbose > 1)