summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@elastic.org>2008-08-11 13:18:12 -0400
committerFrank Ch. Eigler <fche@elastic.org>2008-08-11 13:18:12 -0400
commit2ed8949fe42a23489b130716aea9fe8ce1e94b78 (patch)
tree8a1fc4df2fe77730048f87341df245de42180412
parent32dad3b4df2a4b82898443cf45e5e894350308e2 (diff)
downloadsystemtap-steved-2ed8949fe42a23489b130716aea9fe8ce1e94b78.tar.gz
systemtap-steved-2ed8949fe42a23489b130716aea9fe8ce1e94b78.tar.xz
systemtap-steved-2ed8949fe42a23489b130716aea9fe8ce1e94b78.zip
PR5049: prefix with "*" any filenames given in "fn@filename:line" probes
-rw-r--r--ChangeLog6
-rw-r--r--tapsets.cxx15
-rw-r--r--testsuite/ChangeLog5
-rwxr-xr-xtestsuite/semok/thirtyone.stp5
4 files changed, 28 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 9b1ede20..56bc9990 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-08-11 Frank Ch. Eigler <fche@elastic.org>
+
+ PR5049
+ * tapsets.cxx (cu_name_matches, collect_srcfiles_matching):
+ Implicitly prefix probe source filenames with "*".
+
2008-08-11 David Smith <dsmith@redhat.com>
* tapsets.cxx (utrace_builder::build): Fixed indentation.
diff --git a/tapsets.cxx b/tapsets.cxx
index 639af099..d4745b9f 100644
--- a/tapsets.cxx
+++ b/tapsets.cxx
@@ -855,9 +855,14 @@ struct dwflpp
bool cu_name_matches(string pattern)
{
assert(cu);
- bool t = (fnmatch(pattern.c_str(), cu_name.c_str(), 0) == 0);
+
+ // PR 5049: implicit * in front of given path pattern.
+ // NB: fnmatch() is used without FNM_PATHNAME.
+ string prefixed_pattern = string("*") + pattern;
+
+ bool t = (fnmatch(prefixed_pattern.c_str(), cu_name.c_str(), 0) == 0);
if (t && sess.verbose>3)
- clog << "pattern '" << pattern << "' "
+ clog << "pattern '" << prefixed_pattern << "' "
<< "matches "
<< "CU '" << cu_name << "'" << "\n";
return t;
@@ -1365,13 +1370,17 @@ struct dwflpp
size_t nfiles;
Dwarf_Files *srcfiles;
+ // PR 5049: implicit * in front of given path pattern.
+ // NB: fnmatch() is used without FNM_PATHNAME.
+ string prefixed_pattern = string("*") + pattern;
+
dwarf_assert ("dwarf_getsrcfiles",
dwarf_getsrcfiles (cu, &srcfiles, &nfiles));
{
for (size_t i = 0; i < nfiles; ++i)
{
char const * fname = dwarf_filesrc (srcfiles, i, NULL, NULL);
- if (fnmatch (pattern.c_str(), fname, 0) == 0)
+ if (fnmatch (prefixed_pattern.c_str(), fname, 0) == 0)
{
filtered_srcfiles.insert (fname);
if (sess.verbose>2)
diff --git a/testsuite/ChangeLog b/testsuite/ChangeLog
index d74b4c73..83bc8b1d 100644
--- a/testsuite/ChangeLog
+++ b/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2008-08-11 Frank Ch. Eigler <fche@elastic.org>
+
+ PR5049
+ * semok/thirtyone.stp: New test.
+
2008-08-08 Dave Brolley <brolley@redhat.com>
* lib/systemtap.exp (setup_systemtap_environment): If use_server_p,
diff --git a/testsuite/semok/thirtyone.stp b/testsuite/semok/thirtyone.stp
new file mode 100755
index 00000000..5036e45c
--- /dev/null
+++ b/testsuite/semok/thirtyone.stp
@@ -0,0 +1,5 @@
+#! stap -p2
+
+# PR5049
+
+probe kernel.function("*@module.c") {}