summaryrefslogtreecommitdiffstats
path: root/tapset-perfmon.cxx
diff options
context:
space:
mode:
authorJosh Stone <jistone@redhat.com>2010-03-17 12:28:11 -0700
committerJosh Stone <jistone@redhat.com>2010-03-17 12:28:11 -0700
commit4763f7139043dccebdc110fe1d8912670c528c70 (patch)
tree1d8a77a59ce28a760e38a1b9280dd5351424b4ce /tapset-perfmon.cxx
parent83ea76b1c27ffd25dfcec5805f54cc5e29d80bf7 (diff)
downloadsystemtap-steved-4763f7139043dccebdc110fe1d8912670c528c70.tar.gz
systemtap-steved-4763f7139043dccebdc110fe1d8912670c528c70.tar.xz
systemtap-steved-4763f7139043dccebdc110fe1d8912670c528c70.zip
Move the perf CONFIG check
IMO, it's better to contain the CONFIG check inside the perf code. * tapsets.cxx (register_standard_tapsets): Always call perf register. * tapset-perfmon.cxx (register_tapset_perf): Do the CONFIG check here.
Diffstat (limited to 'tapset-perfmon.cxx')
-rw-r--r--tapset-perfmon.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/tapset-perfmon.cxx b/tapset-perfmon.cxx
index 0188439c..b920b51d 100644
--- a/tapset-perfmon.cxx
+++ b/tapset-perfmon.cxx
@@ -164,6 +164,11 @@ perf_builder::build(systemtap_session & sess,
void
register_tapset_perf(systemtap_session& s)
{
+ // make sure we have support before registering anything
+ // XXX need additional version checks too?
+ if (s.kernel_config["CONFIG_PERF_EVENTS"] != "y")
+ return;
+
match_node* root = s.pattern_root;
derived_probe_builder *builder = new perf_builder();