summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Smith <dsmith@redhat.com>2008-08-15 14:02:31 -0500
committerDavid Smith <dsmith@redhat.com>2008-08-15 14:02:31 -0500
commit986e98de88e5a55451aaf24a6ead7f44725124c1 (patch)
tree0b17238485833b8cb0ae0f4556c29065259f54eb
parenta43ba4339f5b291d139e0be59bba4bc46c55ea25 (diff)
downloadsystemtap-steved-986e98de88e5a55451aaf24a6ead7f44725124c1.tar.gz
systemtap-steved-986e98de88e5a55451aaf24a6ead7f44725124c1.tar.xz
systemtap-steved-986e98de88e5a55451aaf24a6ead7f44725124c1.zip
Change system-wide probes from 'process("*").begin' to 'process.begin'.
2008-08-15 David Smith <dsmith@redhat.com> * tapsets.cxx (utrace_builder::build): Change system-wide probes from 'process("*").begin' to 'process.begin'. (register_standard_tapsets): Add new 'process' binding. * stapprobes.5.in: Change system-wide probes from 'process("*").begin' to 'process.begin'. 2008-08-15 David Smith <dsmith@redhat.com> * systemtap.base/utrace_p4.exp: Change system-wide probes from 'process("*").begin' to 'process.begin'.
-rw-r--r--ChangeLog8
-rw-r--r--stapprobes.5.in11
-rw-r--r--tapsets.cxx29
-rw-r--r--testsuite/ChangeLog5
-rw-r--r--testsuite/systemtap.base/utrace_p4.exp4
5 files changed, 41 insertions, 16 deletions
diff --git a/ChangeLog b/ChangeLog
index ac800e8c..c9156691 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-08-15 David Smith <dsmith@redhat.com>
+
+ * tapsets.cxx (utrace_builder::build): Change system-wide probes
+ from 'process("*").begin' to 'process.begin'.
+ (register_standard_tapsets): Add new 'process' binding.
+ * stapprobes.5.in: Change system-wide probes
+ from 'process("*").begin' to 'process.begin'.
+
2008-08-15 Frank Ch. Eigler <fche@elastic.org>
PR 6836.
diff --git a/stapprobes.5.in b/stapprobes.5.in
index f1626166..4b2b4e2b 100644
--- a/stapprobes.5.in
+++ b/stapprobes.5.in
@@ -386,16 +386,22 @@ Additional user-space probing is available in the following forms:
.SAMPLE
process(PID).begin
process("PATH").begin
+process.begin
process(PID).thread.begin
process("PATH").thread.begin
+process.thread.begin
process(PID).end
process("PATH").end
+process.end
process(PID).thread.end
process("PATH").thread.end
+process.thread.end
process(PID).syscall
process("PATH").syscall
+process.syscall
process(PID).syscall.return
process("PATH").syscall.return
+process.syscall.return
process(PID).itrace
process("PATH").itrace
.ESAMPLE
@@ -431,9 +437,8 @@ Note that
names refer to executables that are searched the same way shells do: relative
to the working directory if they contain a "/" character, otherwise in
.BR $PATH .
-A
-.I PATH
-of "*" means to probe all threads.
+If a process probe is specified without a PID or PATH, all user
+threads are probed.
.SS PROCFS
diff --git a/tapsets.cxx b/tapsets.cxx
index 1f7d2555..60d9a377 100644
--- a/tapsets.cxx
+++ b/tapsets.cxx
@@ -5945,7 +5945,6 @@ struct utrace_builder: public derived_probe_builder
bool has_path = get_param (parameters, TOK_PROCESS, path);
bool has_pid = get_param (parameters, TOK_PROCESS, pid);
enum utrace_derived_probe_flags flags = UDPF_NONE;
- assert (has_path || has_pid);
if (has_null_param (parameters, TOK_THREAD))
{
@@ -5966,23 +5965,23 @@ struct utrace_builder: public derived_probe_builder
else if (has_null_param (parameters, TOK_END))
flags = UDPF_END;
+ // If we didn't get a path or pid, this means to probe everything.
+ // Convert this to a pid-based probe.
+ if (! has_path && ! has_pid)
+ {
+ has_path = false;
+ path.clear();
+ has_pid = true;
+ pid = 0;
+ }
// Validate pid.
- if (has_pid)
+ else if (has_pid)
{
// We can't probe 'init' (pid 1).
if (pid < 2)
throw semantic_error ("process pid must be greater than 1",
location->tok);
}
- // If we have a path whose value is "*", this means to probe
- // everything. Convert this to a pid-based probe.
- else if (has_path && path == "*")
- {
- has_path = false;
- path.clear();
- has_pid = true;
- pid = 0;
- }
// If we have a regular path, we need to validate it.
else if (has_path)
{
@@ -8897,18 +8896,26 @@ register_standard_tapsets(systemtap_session & s)
->bind(new utrace_builder ());
s.pattern_root->bind_num(TOK_PROCESS)->bind(TOK_BEGIN)
->bind(new utrace_builder ());
+ s.pattern_root->bind(TOK_PROCESS)->bind(TOK_BEGIN)
+ ->bind(new utrace_builder ());
s.pattern_root->bind_str(TOK_PROCESS)->bind(TOK_END)
->bind(new utrace_builder ());
s.pattern_root->bind_num(TOK_PROCESS)->bind(TOK_END)
->bind(new utrace_builder ());
+ s.pattern_root->bind(TOK_PROCESS)->bind(TOK_END)
+ ->bind(new utrace_builder ());
s.pattern_root->bind_str(TOK_PROCESS)->bind(TOK_THREAD)->bind(TOK_BEGIN)
->bind(new utrace_builder ());
s.pattern_root->bind_num(TOK_PROCESS)->bind(TOK_THREAD)->bind(TOK_BEGIN)
->bind(new utrace_builder ());
+ s.pattern_root->bind(TOK_PROCESS)->bind(TOK_THREAD)->bind(TOK_BEGIN)
+ ->bind(new utrace_builder ());
s.pattern_root->bind_str(TOK_PROCESS)->bind(TOK_THREAD)->bind(TOK_END)
->bind(new utrace_builder ());
s.pattern_root->bind_num(TOK_PROCESS)->bind(TOK_THREAD)->bind(TOK_END)
->bind(new utrace_builder ());
+ s.pattern_root->bind(TOK_PROCESS)->bind(TOK_THREAD)->bind(TOK_END)
+ ->bind(new utrace_builder ());
// itrace user-space probes
s.pattern_root->bind_str(TOK_PROCESS)->bind("itrace")
diff --git a/testsuite/ChangeLog b/testsuite/ChangeLog
index c6d86142..9c7f8fec 100644
--- a/testsuite/ChangeLog
+++ b/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2008-08-15 David Smith <dsmith@redhat.com>
+
+ * systemtap.base/utrace_p4.exp: Change system-wide probes from
+ 'process("*").begin' to 'process.begin'.
+
2008-08-13 Dave Brolley <brolley@redhat.com>
* lib/systemtap.exp (setup_systemtap_environment): client_path is now
diff --git a/testsuite/systemtap.base/utrace_p4.exp b/testsuite/systemtap.base/utrace_p4.exp
index 081fee95..1467d9c8 100644
--- a/testsuite/systemtap.base/utrace_p4.exp
+++ b/testsuite/systemtap.base/utrace_p4.exp
@@ -15,7 +15,7 @@ set syscall_script {"probe process(\"/bin/ls\").syscall { printf(\"|%d\", \$sysc
set syscall_return_script {"probe process(\"/bin/ls\").syscall.return { printf(\"|%d\", \$syscall) }"}
set thread_begin_script {"probe process(\"/bin/ls\").thread.begin { print(\"ls thread.begin\") }"}
set thread_end_script {"probe process(\"/bin/ls\").thread.end { print(\"ls thread.end\") }"}
-set all_begin_script {"probe process(\"*\").begin { print(\"begin\") }"}
+set all_begin_script {"probe process.begin { print(\"begin\") }"}
set pid_begin_script {"probe process(123).begin { print(\"123 begin\") }"}
set pid_end_script {"probe process(123).end { print(\"123 end\") }"}
@@ -134,6 +134,6 @@ set TEST_NAME "UTRACE_P4_07"
if {$utrace_support_found == 0} {
untested "$TEST_NAME : no kernel utrace support found"
} else {
- # Try compiling an begin script using a path of "*"
+ # Try compiling an system-wide begin script
stap_compile $TEST_NAME 1 $all_begin_script
}