From 4763f7139043dccebdc110fe1d8912670c528c70 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 17 Mar 2010 12:28:11 -0700 Subject: 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. --- tapset-perfmon.cxx | 5 +++++ 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); } -- cgit