summaryrefslogtreecommitdiffstats
path: root/dwflpp.cxx
diff options
context:
space:
mode:
authorMark Wielaard <mjw@redhat.com>2009-09-28 17:12:04 +0200
committerMark Wielaard <mjw@redhat.com>2009-09-28 17:12:04 +0200
commit59c11f912be76f0a8e37541d9b25e621daff61ca (patch)
tree69dd49712a1b1b40ceea161c0317178a51480871 /dwflpp.cxx
parent3db9c8433e58812c9ce47df384e23841aca27894 (diff)
downloadsystemtap-steved-59c11f912be76f0a8e37541d9b25e621daff61ca.tar.gz
systemtap-steved-59c11f912be76f0a8e37541d9b25e621daff61ca.tar.xz
systemtap-steved-59c11f912be76f0a8e37541d9b25e621daff61ca.zip
Use dwlpp::setup_kernel for tracepoint modules.
Tracepoint modules ended up going through dwflpp::setup_user() because there was no setup_kernel that takes a list of module names. * dwflpp.h: Add kernel_p bool to constructor that takes a module list. Add setup_kernel() variant that takes a module list. * dwflpp.cxx: Likewise. * tapsets.cxx (tracepoint_builder::init_dw): Call dwflpp constructor indicating we expect kernel modules.
Diffstat (limited to 'dwflpp.cxx')
-rw-r--r--dwflpp.cxx37
1 files changed, 33 insertions, 4 deletions
diff --git a/dwflpp.cxx b/dwflpp.cxx
index 4ef9f76b..cc882e5d 100644
--- a/dwflpp.cxx
+++ b/dwflpp.cxx
@@ -83,16 +83,18 @@ dwflpp::dwflpp(systemtap_session & session, const string& name, bool kernel_p):
}
}
-
-dwflpp::dwflpp(systemtap_session & session, const vector<string>& names):
+dwflpp::dwflpp(systemtap_session & session, const vector<string>& names,
+ bool kernel_p):
sess(session), module(NULL), module_bias(0), mod_info(NULL),
module_start(0), module_end(0), cu(NULL), dwfl(NULL),
module_dwarf(NULL), function(NULL), blacklist_enabled(false)
{
- setup_user(names);
+ if (kernel_p)
+ setup_kernel(names);
+ else
+ setup_user(names);
}
-
dwflpp::~dwflpp()
{
delete_map(module_cu_cache);
@@ -318,6 +320,33 @@ dwflpp::setup_kernel(const string& name, bool debuginfo_needed)
build_blacklist();
}
+void
+dwflpp::setup_kernel(const vector<string> &names, bool debuginfo_needed)
+{
+ if (! sess.module_cache)
+ sess.module_cache = new module_cache ();
+
+ unsigned offline_search_matches = 0;
+ set<string> offline_search_names(names.begin(), names.end());
+ dwfl = setup_dwfl_kernel(offline_search_names,
+ &offline_search_matches,
+ sess);
+
+ if (offline_search_matches < offline_search_names.size())
+ {
+ if (debuginfo_needed) {
+ // Suggest a likely kernel dir to find debuginfo rpm for
+ string dir = string("/lib/modules/" + sess.kernel_release );
+ find_debug_rpms(sess, dir.c_str());
+ }
+ throw semantic_error (string("missing ") + sess.architecture +
+ string(" kernel/module debuginfo under '") +
+ sess.kernel_build_tree + string("'"));
+ }
+
+ build_blacklist();
+}
+
void
dwflpp::setup_user(const vector<string>& modules, bool debuginfo_needed)