diff --git a/systemtap-build-source-dir.patch b/systemtap-build-source-dir.patch new file mode 100644 index 0000000..9937b66 --- /dev/null +++ b/systemtap-build-source-dir.patch @@ -0,0 +1,88 @@ +From: Tony Jones +Subject: adjust build source dir for SuSE packaging +References: bnc#796574 + +kernel-$flavor: + /lib/modules/$version-$flavor + +kernel-$flavor-devel: requires kernel-source + /usr/src/linux-$version-obj/$arch/$flavor + /lib/modules/$version-$flavor/build -> /usr/src/linux-$version-obj/$arch/$flavor + /lib/modules/$version-$flavor/source -> /usr/src/linux-$version [kernel-source] + +kernel-flavor-debugsource: + /usr/src/debug/kernel-$flavor/ + linux-obj/ {corresponds to /lib/modules/$version-$flavor/build} + linux-3.0/ {mirrors kernel-source} + +DW_AT_comp_dir points to debugsource/linux-obj directory but internal trace +headers are only found in linux-3.0. Regardless, we don't want to require +debugsource as devel already requires kernel-source which provides the +necessary headers. + +--- + session.cxx | 28 ++++++++++++++++++++++++---- + 1 file changed, 24 insertions(+), 4 deletions(-) + +--- a/session.cxx ++++ b/session.cxx +@@ -90,6 +90,7 @@ systemtap_session::systemtap_session (): + kernel_release = string (buf.release); + release = kernel_release; + kernel_build_tree = "/lib/modules/" + kernel_release + "/build"; ++ kernel_source_tree = "/lib/modules/" + kernel_release + "/source"; + architecture = machine = normalize_machine(buf.machine); + + for (unsigned i=0; i<5; i++) perpass_verbose[i]=0; +@@ -258,6 +259,7 @@ systemtap_session::systemtap_session (co + { + release = kernel_release = kern; + kernel_build_tree = "/lib/modules/" + kernel_release + "/build"; ++ kernel_source_tree = "/lib/modules/" + kernel_release + "/source"; + architecture = machine = normalize_machine(arch); + setup_kernel_release(kern.c_str()); + native_build = false; // assumed; XXX: could be computed as in check_options() +@@ -1540,21 +1542,39 @@ systemtap_session::setup_kernel_release + // normal search in tapsets.cxx. Without CONFIG_DEBUG_INFO, we'd + // need heuristics such as this one: + +- string some_random_source_only_file = kernel_build_tree + "/COPYING"; ++ // SUSE: if "build" link specified, attempt to determine "source" link ++ // N.B we won't match using above tapsets.cxx check ++ struct stat buf; ++ string source_tree = kernel_build_tree; ++ ++ if (lstat(kernel_build_tree.c_str(), &buf) != -1 && S_ISLNK(buf.st_mode)) { ++ size_t pos = source_tree.find_last_of('/'); ++ if (pos < source_tree.length() && source_tree.substr(pos+1, string::npos) == "build") ++ source_tree.replace(pos+1, string::npos, "source"); ++ } ++ ++retry: ++ string some_random_source_only_file = source_tree + "/COPYING"; + ifstream epic (some_random_source_only_file.c_str()); + if (! epic.fail()) + { +- kernel_source_tree = kernel_build_tree; ++ kernel_source_tree = source_tree; + if (verbose > 2) + clog << _F("Located kernel source tree (COPYING) at '%s'", kernel_source_tree.c_str()) << endl; +- } ++ } else if (source_tree != kernel_build_tree) { ++ // one last try using kernel_build_tree (local fs build) ++ source_tree = kernel_build_tree; ++ goto retry; ++ } + } + else + { + update_release_sysroot = true; + kernel_release = string (kstr); +- if (!kernel_release.empty()) ++ if (!kernel_release.empty()) { + kernel_build_tree = "/lib/modules/" + kernel_release + "/build"; ++ kernel_source_tree = "/lib/modules/" + kernel_release + "/source"; ++ } + + // PR10745 + // Let's not look for the kernel_source_tree; it's definitely diff --git a/systemtap.changes b/systemtap.changes index d9d1cf1..6c0b924 100644 --- a/systemtap.changes +++ b/systemtap.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Fri Feb 22 06:30:58 UTC 2013 - tonyj@suse.com + +- Change how systemtap looks for tracepoint header files + (bnc#796574, new patch: systemtap-build-source-dir.patch) +- Add libebl1 dependancy. Systemtap manually loads libebl backends and + the manual Requires: was incorrectly removed in a previous revision + (bnc#800335) + ------------------------------------------------------------------- Fri Dec 14 23:42:06 UTC 2012 - tonyj@suse.com diff --git a/systemtap.spec b/systemtap.spec index a41ea72..3f1660c 100644 --- a/systemtap.spec +++ b/systemtap.spec @@ -37,8 +37,10 @@ Source: http://sourceware.org/systemtap/ftp/releases/systemtap-%{version Source2: README-BEFORE-ADDING-PATCHES Source3: stap-server.conf Patch1: systemtap-fix-for-kernels-without-vm_executable.patch +Patch2: systemtap-build-source-dir.patch Obsoletes: systemtap-client < 1.5 Requires: %{name}-runtime = %{version}-%{release} +Requires: libebl1 BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -85,6 +87,7 @@ This package contains the support tools for static probes. %prep %setup -q %patch1 -p1 +%patch2 -p1 %build %configure --disable-docs --docdir=%{_docdir}/systemtap