diff options
Diffstat (limited to 'tapsets.cxx')
-rw-r--r-- | tapsets.cxx | 29 |
1 files changed, 18 insertions, 11 deletions
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") |