From 8575ab72e5dc1825da811ac83f529f9bd82d74ec8a2b9b864071da9d834407ff Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Thu, 29 Jan 2009 22:53:16 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemtap?expand=0&rev=36 --- stap-fix-procfs-dir_entry-count.diff | 26 +++++++++++ stap-pr6905-weaken-lineno-checks.diff | 62 +++++++++++++++++++++++++++ systemtap.changes | 6 +++ systemtap.spec | 9 +++- 4 files changed, 102 insertions(+), 1 deletion(-) create mode 100644 stap-fix-procfs-dir_entry-count.diff create mode 100644 stap-pr6905-weaken-lineno-checks.diff diff --git a/stap-fix-procfs-dir_entry-count.diff b/stap-fix-procfs-dir_entry-count.diff new file mode 100644 index 0000000..dc7cb42 --- /dev/null +++ b/stap-fix-procfs-dir_entry-count.diff @@ -0,0 +1,26 @@ +Index: src/runtime/procfs.c +=================================================================== +--- src.orig/runtime/procfs.c ++++ src/runtime/procfs.c +@@ -24,13 +24,20 @@ static struct proc_dir_entry *_stp_proc_ + + void _stp_close_procfs(void); + ++// 2.6.24 fixed proc_dir_entry refcounting. ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24) ++#define LAST_ENTRY_COUNT 0 ++#else ++#define LAST_ENTRY_COUNT 1 ++#endif ++ + /* + * Removes /proc/systemtap/{module_name} and /proc/systemtap (if empty) + */ + void _stp_rmdir_proc_module(void) + { + if (_stp_proc_root && _stp_proc_root->subdir == NULL) { +- if (atomic_read(&_stp_proc_root->count)) ++ if (atomic_read(&_stp_proc_root->count) != LAST_ENTRY_COUNT) + _stp_warn("Removal of /proc/systemtap/%s\nis deferred until it is no longer in use.\n" + "Systemtap module removal will block.\n", THIS_MODULE->name); + remove_proc_entry(THIS_MODULE->name, _stp_proc_stap); diff --git a/stap-pr6905-weaken-lineno-checks.diff b/stap-pr6905-weaken-lineno-checks.diff new file mode 100644 index 0000000..e2ebf04 --- /dev/null +++ b/stap-pr6905-weaken-lineno-checks.diff @@ -0,0 +1,62 @@ +From 2d4a8f7a704619f1df32a24cfb284cf0fe936e5d Mon Sep 17 00:00:00 2001 +From: wenji huang +Date: Sun, 14 Dec 2008 23:54:05 -0500 +Subject: [PATCH 1/1] PR6905: Weaken the checking of line number for WILDCARD and make RANGE smart. + +--- + tapsets.cxx | 24 ++++++++++++++++++++---- + 1 files changed, 20 insertions(+), 4 deletions(-) + +diff --git a/tapsets.cxx b/tapsets.cxx +index 4d9a021..391e54e 100644 +--- a/tapsets.cxx ++++ b/tapsets.cxx +@@ -1242,18 +1242,33 @@ struct dwflpp + } + else if (line_type == WILDCARD) + function_line (&lineno); ++ else if (line_type == RANGE) { ++ int start_lineno; ++ function_line (&start_lineno); ++ lineno = start_lineno > lineno ? start_lineno : lineno; ++ if (lineno > lines[1]) { /* invalid line range */ ++ stringstream advice; ++ advice << "Starting line number for " << srcfile << " : " << lineno; ++ throw semantic_error (advice.str()); ++ } ++ } ++ + + for (int l = lineno; ; l = l + 1) + { + set lines_probed; + pair::iterator,bool> line_probed; +- dwarf_assert ("dwarf_getsrc_file", +- dwarf_getsrc_file (module_dwarf, +- srcfile, l, 0, +- &srcsp, &nsrcs)); ++ int ret = 0; ++ ++ ret = dwarf_getsrc_file (module_dwarf, srcfile, l, 0, ++ &srcsp, &nsrcs); + if (line_type == WILDCARD || line_type == RANGE) + { + Dwarf_Addr line_addr; ++ ++ if (ret != 0) /* tolerate invalid line number out of assert */ ++ break; ++ + dwarf_lineno (srcsp [0], &lineno); + line_probed = lines_probed.insert(lineno); + if (lineno != l || line_probed.second == false || nsrcs > 1) +@@ -1263,6 +1278,7 @@ struct dwflpp + break; + } + ++ dwarf_assert ("dwarf_getsrc_file", ret); + // NB: Formerly, we used to filter, because: + + // dwarf_getsrc_file gets one *near hits* for line numbers, not +-- +1.5.6 + diff --git a/systemtap.changes b/systemtap.changes index 556e6f5..9c78b71 100644 --- a/systemtap.changes +++ b/systemtap.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Jan 29 12:58:42 CET 2009 - tiwai@suse.de + +- Fix procfs dir_entry count warning (bnc#470526) +- Improve the parsing of lineno checks (bnc#468247) + ------------------------------------------------------------------- Thu Jan 15 08:22:24 CET 2009 - tiwai@suse.de diff --git a/systemtap.spec b/systemtap.spec index 5189303..d54896b 100644 --- a/systemtap.spec +++ b/systemtap.spec @@ -25,7 +25,7 @@ BuildRequires: latex2html %define package_version 20080906 License: GPL v2 or later Version: 0.7.1 -Release: 32 +Release: 34 Summary: Instrumentation System Group: Development/Tools/Debuggers Url: http://sourceware.org/systemtap/ @@ -43,6 +43,8 @@ Patch8: systemtap-2.6.28-fixes.diff Patch9: systemtap-use-send_signal.diff Patch10: systemtap-tcl-send_log-syntax-fix.diff Patch11: systemtap-tcl-quote-fix.diff +Patch12: stap-fix-procfs-dir_entry-count.diff +Patch13: stap-pr6905-weaken-lineno-checks.diff Requires: libebl1 BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -74,6 +76,8 @@ Authors: %patch9 -p1 %patch10 %patch11 -p1 +%patch12 -p1 +%patch13 -p1 %build autoreconf -fi @@ -102,6 +106,9 @@ rm -rf ${RPM_BUILD_ROOT} %dir %attr(0755,root,root) /var/cache/systemtap %changelog +* Thu Jan 29 2009 tiwai@suse.de +- Fix procfs dir_entry count warning (bnc#470526) +- Improve the parsing of lineno checks (bnc#468247) * Thu Jan 15 2009 tiwai@suse.de - Fix quoting in Tcl scripts (bnc#461588) * Mon Jan 12 2009 tiwai@suse.de