summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog9
-rw-r--r--main.cxx9
-rw-r--r--parse.cxx3
-rwxr-xr-xsafety/safety.py10
-rw-r--r--tapsets.cxx8
5 files changed, 29 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index 27bccb2c..bff437d4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2006-03-03 Josh Stone <joshua.i.stone@intel.com>
+
+ * main.cxx (main): search forward for dashes in the kernel release,
+ to work properly with release names with more than one dash.
+ * parse.cxx (eval_pp_conditional): ditto
+ * tapsets.cxx (profile_derived_probe::profile_derived_probe): ditto
+ * safety/safety.py (StaticSafety::__build_search_suffixes): ditto,
+ and add copyright & GPL tag
+
2006-03-03 Frank Ch. Eigler <fche@elastic.org>
* tapset/indent.stp, indent-default.stp: New little tapset.
diff --git a/main.cxx b/main.cxx
index 27e0cdd4..8088c65b 100644
--- a/main.cxx
+++ b/main.cxx
@@ -1,6 +1,7 @@
// systemtap translator/driver
// Copyright (C) 2005-2006 Red Hat Inc.
// Copyright (C) 2005 IBM Corp.
+// Copyright (C) 2006 Intel Corporation.
//
// This file is part of systemtap, and is free software. You can
// redistribute it and/or modify it under the terms of the GNU General
@@ -318,10 +319,10 @@ main (int argc, char * const argv [])
version_suffixes.push_back ("/" + kvr + "/" + arch);
version_suffixes.push_back ("/" + kvr);
// add kernel version (2.6.NN) + arch
- string::size_type dash_rindex = kvr.rfind ('-');
- if (dash_rindex > 0 && dash_rindex != string::npos) {
- version_suffixes.push_back ("/" + kvr.substr (0, dash_rindex) + "/" + arch);
- version_suffixes.push_back ("/" + kvr.substr (0, dash_rindex));
+ string::size_type dash_index = kvr.find ('-');
+ if (dash_index > 0 && dash_index != string::npos) {
+ version_suffixes.push_back ("/" + kvr.substr (0, dash_index) + "/" + arch);
+ version_suffixes.push_back ("/" + kvr.substr (0, dash_index));
}
// add kernel family (2.6) + arch
string::size_type dot_index = kvr.find ('.');
diff --git a/parse.cxx b/parse.cxx
index 04e01ebc..f7ea157b 100644
--- a/parse.cxx
+++ b/parse.cxx
@@ -1,5 +1,6 @@
// recursive descent parser for systemtap scripts
// Copyright (C) 2005-2006 Red Hat Inc.
+// Copyright (C) 2006 Intel Corporation.
//
// This file is part of systemtap, and is free software. You can
// redistribute it and/or modify it under the terms of the GNU General
@@ -154,7 +155,7 @@ bool eval_pp_conditional (systemtap_session& s,
string target_kernel_vr = s.kernel_release;
string target_kernel_v = target_kernel_vr;
// cut off any release code suffix
- string::size_type dr = target_kernel_vr.rfind ('-');
+ string::size_type dr = target_kernel_vr.find ('-');
if (dr > 0 && dr != string::npos)
target_kernel_v = target_kernel_vr.substr (0, dr);
diff --git a/safety/safety.py b/safety/safety.py
index 4a2094f9..f02c30b3 100755
--- a/safety/safety.py
+++ b/safety/safety.py
@@ -3,6 +3,14 @@
# vim: noet sw=4 ts=4 enc=utf-8
"A static safety-checker for SystemTap modules."
+# Copyright (C) 2006 Intel Corporation.
+#
+# This file is part of systemtap, and is free software. You can
+# redistribute it and/or modify it under the terms of the GNU General
+# Public License (GPL); either version 2, or (at your option) any
+# later version.
+
+
# in python 2.4, set & frozenset are builtins
# in python 2.3, the equivalents live in the 'sets' module
from sys import hexversion as __hexversion
@@ -86,7 +94,7 @@ class StaticSafety:
ss.add(relsfx + archsfx)
# add kernel version (2.6.NN) + arch
- dash_i = relsfx.rfind('-')
+ dash_i = relsfx.find('-')
if dash_i > 0:
ss.add(relsfx[:dash_i])
ss.add(relsfx[:dash_i] + archsfx)
diff --git a/tapsets.cxx b/tapsets.cxx
index 2e2c933e..8337eff7 100644
--- a/tapsets.cxx
+++ b/tapsets.cxx
@@ -1,6 +1,6 @@
// tapset resolution
// Copyright (C) 2005, 2006 Red Hat Inc.
-// Copyright (C) 2005 Intel Corporation.
+// Copyright (C) 2005, 2006 Intel Corporation.
//
// This file is part of systemtap, and is free software. You can
// redistribute it and/or modify it under the terms of the GNU General
@@ -3355,9 +3355,9 @@ profile_derived_probe::profile_derived_probe (systemtap_session &s, probe* p, pr
string target_kernel_v;
// cut off any release code suffix
- string::size_type dash_rindex = s.kernel_release.rfind ('-');
- if (dash_rindex > 0 && dash_rindex != string::npos)
- target_kernel_v = s.kernel_release.substr (0, dash_rindex);
+ string::size_type dash_index = s.kernel_release.find ('-');
+ if (dash_index > 0 && dash_index != string::npos)
+ target_kernel_v = s.kernel_release.substr (0, dash_index);
else
target_kernel_v = s.kernel_release;