diff options
author | Rajan Arora <rarora@redhat.com> | 2008-12-01 02:06:51 -0500 |
---|---|---|
committer | Rajan Arora <rarora@redhat.com> | 2008-12-01 02:10:48 -0500 |
commit | 7471ea1f77971b814bc366a3e09d99aaddcfb0f7 (patch) | |
tree | c155f76087281c1f5603f40c0a44a4c3911e1c87 /tapsets.cxx | |
parent | 4ea5a9d947ac41fc9da143ce501642673d27c7bf (diff) | |
download | systemtap-steved-7471ea1f77971b814bc366a3e09d99aaddcfb0f7.tar.gz systemtap-steved-7471ea1f77971b814bc366a3e09d99aaddcfb0f7.tar.xz systemtap-steved-7471ea1f77971b814bc366a3e09d99aaddcfb0f7.zip |
BZ 5892: Add stap -B to sic systemtap at an alternate kernel build tree
Diffstat (limited to 'tapsets.cxx')
-rw-r--r-- | tapsets.cxx | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/tapsets.cxx b/tapsets.cxx index 4e4d471d..88c6ea41 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -898,9 +898,11 @@ struct dwflpp static char *debuginfo_env_arr = getenv("SYSTEMTAP_DEBUGINFO_PATH"); static char *debuginfo_path = (debuginfo_env_arr ? - debuginfo_env_arr : debuginfo_path_arr); + debuginfo_env_arr : sess.kernel_build_tree.size () ? + (char *) sess.kernel_build_tree.c_str() : debuginfo_path_arr); static const char *debug_path = (debuginfo_env_arr ? - debuginfo_env_arr : sess.kernel_release.c_str()); + debuginfo_env_arr : sess.kernel_build_tree.size () ? + sess.kernel_build_tree.c_str() : sess.kernel_release.c_str()); static const Dwfl_Callbacks kernel_callbacks = { @@ -951,7 +953,8 @@ struct dwflpp // XXX: this is where the session -R parameter could come in static char debuginfo_path_arr[] = "-:.debug:/usr/lib/debug:build"; static char *debuginfo_env_arr = getenv("SYSTEMTAP_DEBUGINFO_PATH"); - static char *debuginfo_path = (debuginfo_env_arr ?: debuginfo_path_arr); + static char *debuginfo_path = (debuginfo_env_arr ?: sess.kernel_build_tree.size () ? + (char *) sess.kernel_build_tree.c_str() : debuginfo_path_arr); static const Dwfl_Callbacks user_callbacks = { @@ -8712,8 +8715,13 @@ mark_builder::build(systemtap_session & sess, if (! cache_initialized) { cache_initialized = true; - string module_markers_path = "/lib/modules/" + sess.kernel_release + string module_markers_path; + if (! sess.kernel_build_tree.size ()) + module_markers_path = "/lib/modules/" + sess.kernel_release + "/build/Module.markers"; + else + module_markers_path = sess.kernel_build_tree + "/Module.markers"; + ifstream module_markers; module_markers.open(module_markers_path.c_str(), ifstream::in); |