summaryrefslogtreecommitdiffstats
path: root/tapsets.cxx
diff options
context:
space:
mode:
authorDavid Smith <dsmith@redhat.com>2008-08-12 10:18:56 -0500
committerDavid Smith <dsmith@redhat.com>2008-08-12 10:18:56 -0500
commit6cdf2889024b6538665a00f2ecd7321626624bb8 (patch)
tree8f0286936a35e021c532336e4a672323b8db4bea /tapsets.cxx
parent6503a1cce1cb2a2b88819b414650bd85340a4381 (diff)
downloadsystemtap-steved-6cdf2889024b6538665a00f2ecd7321626624bb8.tar.gz
systemtap-steved-6cdf2889024b6538665a00f2ecd7321626624bb8.tar.xz
systemtap-steved-6cdf2889024b6538665a00f2ecd7321626624bb8.zip
PR 6445 (partial). Implemented system-wide utrace probes.
2008-08-12 David Smith <dsmith@redhat.com> PR 6445 (partial) * tapsets.cxx (utrace_builder::build): Validates pid and allows probing of "*" to mean all threads. * stapprobes.5.in: Added note about a process path of "*" means to probe all threads. 2008-08-12 David Smith <dsmith@redhat.com> PR 6445 (partial) * task_finder.c (stap_register_task_finder_target): Handles probing all threads. (__stp_utrace_attach_match_filename): Ditto. (stap_start_task_finder): Ditto. 2008-08-12 David Smith <dsmith@redhat.com> PR 6445 (partial) * systemtap.base/utrace_p4.exp: Added test that probes all threads. * semko/utrace14.stp: New test.
Diffstat (limited to 'tapsets.cxx')
-rw-r--r--tapsets.cxx21
1 files changed, 19 insertions, 2 deletions
diff --git a/tapsets.cxx b/tapsets.cxx
index 6dcd2c00..664dfb1f 100644
--- a/tapsets.cxx
+++ b/tapsets.cxx
@@ -5931,8 +5931,25 @@ struct utrace_builder: public derived_probe_builder
else if (has_null_param (parameters, TOK_END))
flags = UDPF_END;
- // If we have a path, we need to validate it.
- if (has_path)
+ // Validate pid.
+ 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)
{
string::size_type start_pos, end_pos;
string component;