diff options
author | Josh Stone <jistone@redhat.com> | 2010-03-17 12:28:11 -0700 |
---|---|---|
committer | Josh Stone <jistone@redhat.com> | 2010-03-17 12:28:11 -0700 |
commit | 4763f7139043dccebdc110fe1d8912670c528c70 (patch) | |
tree | 1d8a77a59ce28a760e38a1b9280dd5351424b4ce | |
parent | 83ea76b1c27ffd25dfcec5805f54cc5e29d80bf7 (diff) | |
download | systemtap-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.
-rw-r--r-- | tapset-perfmon.cxx | 5 | ||||
-rw-r--r-- | tapsets.cxx | 4 |
2 files changed, 6 insertions, 3 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(); diff --git a/tapsets.cxx b/tapsets.cxx index a1474617..4b6a3781 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -6724,9 +6724,7 @@ register_standard_tapsets(systemtap_session & s) // length supported with address only, not symbol names //perf event based probe - if (s.kernel_config["CONFIG_PERF_EVENTS"] == string("y") ) { - register_tapset_perf(s); - } + register_tapset_perf(s); } |