* [PATCH 0/1] trace-cmd: Add --no-filter recording option
@ 2019-04-17 18:31 Slavomir Kaslev
2019-04-17 18:31 ` [PATCH 1/1] trace-cmd: Add --no-filter option to not filter out recording processes Slavomir Kaslev
0 siblings, 1 reply; 2+ messages in thread
From: Slavomir Kaslev @ 2019-04-17 18:31 UTC (permalink / raw)
To: rostedt; +Cc: linux-trace-devel
Add --no-filter option that disables trace-cmd filtering out its recording
processes from the trace.
Slavomir Kaslev (1):
trace-cmd: Add --no-filter option to not filter out recording
processes
Documentation/trace-cmd-record.1.txt | 5 +++++
tracecmd/trace-record.c | 14 +++++++++++---
tracecmd/trace-usage.c | 1 +
3 files changed, 17 insertions(+), 3 deletions(-)
--
2.19.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH 1/1] trace-cmd: Add --no-filter option to not filter out recording processes
2019-04-17 18:31 [PATCH 0/1] trace-cmd: Add --no-filter recording option Slavomir Kaslev
@ 2019-04-17 18:31 ` Slavomir Kaslev
0 siblings, 0 replies; 2+ messages in thread
From: Slavomir Kaslev @ 2019-04-17 18:31 UTC (permalink / raw)
To: rostedt; +Cc: linux-trace-devel
Add trace-cmd --no-filter option that disables filtering out of trace-cmd
recording processes from the trace.
Suggested-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Slavomir Kaslev <kaslevs@vmware.com>
---
Documentation/trace-cmd-record.1.txt | 5 +++++
tracecmd/trace-record.c | 14 +++++++++++---
tracecmd/trace-usage.c | 1 +
3 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/Documentation/trace-cmd-record.1.txt b/Documentation/trace-cmd-record.1.txt
index 68afa16..26a8299 100644
--- a/Documentation/trace-cmd-record.1.txt
+++ b/Documentation/trace-cmd-record.1.txt
@@ -83,6 +83,11 @@ OPTIONS
The above are usually safe to use to compare fields.
+*--no-filter*::
+ Do not filter out the trace-cmd threads. By default, the threads are
+ filtered out to not be traced by events. This option will have the trace-cmd
+ threads also be traced.
+
*-R* 'trigger'::
Specify a trigger for the previous event. This must come after a *-e*.
This will add a given trigger to the given event. To only enable the trigger
diff --git a/tracecmd/trace-record.c b/tracecmd/trace-record.c
index d5c66ab..4523128 100644
--- a/tracecmd/trace-record.c
+++ b/tracecmd/trace-record.c
@@ -86,6 +86,7 @@ static int do_ptrace;
static int filter_task;
static int filter_pid = -1;
+static bool no_filter = false;
static int local_cpu_count;
@@ -1065,6 +1066,9 @@ static void update_task_filter(void)
struct buffer_instance *instance;
int pid = getpid();
+ if (no_filter)
+ return;
+
if (filter_task)
add_filter_pid(pid, 0);
@@ -4379,9 +4383,9 @@ void update_first_instance(struct buffer_instance *instance, int topt)
}
enum {
-
- OPT_quiet = 246,
- OPT_debug = 247,
+ OPT_quiet = 245,
+ OPT_debug = 246,
+ OPT_no_filter = 247,
OPT_max_graph_depth = 248,
OPT_tsoffset = 249,
OPT_bycomm = 250,
@@ -4605,6 +4609,7 @@ static void parse_record_options(int argc,
{"by-comm", no_argument, NULL, OPT_bycomm},
{"ts-offset", required_argument, NULL, OPT_tsoffset},
{"max-graph-depth", required_argument, NULL, OPT_max_graph_depth},
+ {"no-filter", no_argument, NULL, OPT_no_filter},
{"debug", no_argument, NULL, OPT_debug},
{"quiet", no_argument, NULL, OPT_quiet},
{"help", no_argument, NULL, '?'},
@@ -4879,6 +4884,9 @@ static void parse_record_options(int argc,
if (!ctx->max_graph_depth)
die("Could not allocate option");
break;
+ case OPT_no_filter:
+ no_filter = true;
+ break;
case OPT_debug:
debug = 1;
break;
diff --git a/tracecmd/trace-usage.c b/tracecmd/trace-usage.c
index 9ea1906..d2a1089 100644
--- a/tracecmd/trace-usage.c
+++ b/tracecmd/trace-usage.c
@@ -56,6 +56,7 @@ static struct usage_help usage_help[] = {
" --func-stack perform a stack trace for function tracer\n"
" (use with caution)\n"
" --max-graph-depth limit function_graph depth\n"
+ " --no-filter include trace-cmd threads in the trace\n"
},
{
"start",
--
2.19.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-04-17 18:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-17 18:31 [PATCH 0/1] trace-cmd: Add --no-filter recording option Slavomir Kaslev
2019-04-17 18:31 ` [PATCH 1/1] trace-cmd: Add --no-filter option to not filter out recording processes Slavomir Kaslev
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).