From e2d6fc4365ad9a5a7798f305af4a0f6c48a1e73ec51b00c355045a9d195fda3a Mon Sep 17 00:00:00 2001 From: Tony Jones Date: Fri, 1 Mar 2013 16:19:47 +0000 Subject: [PATCH] Accepting request 157012 from home:jones_tony:branches:devel:tools OBS-URL: https://build.opensuse.org/request/show/157012 OBS-URL: https://build.opensuse.org/package/show/devel:tools/systemtap?expand=0&rev=59 --- systemtap-build-source-dir.patch | 88 ++++++++++++++++++++++++++++++++ systemtap.changes | 9 ++++ systemtap.spec | 3 ++ 3 files changed, 100 insertions(+) create mode 100644 systemtap-build-source-dir.patch 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