linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Slavomir Kaslev <kaslevs@vmware.com>
Cc: linux-trace-devel@vger.kernel.org, pauld@redhat.com,
	ykaradzhov@vmware.com, jbacik@fb.com, tstoyanov@vmware.com,
	slavomir.kaslev@gmail.com
Subject: Re: [PATCH v3 2/2] trace-cmd: Add --no-filter option to not filter recording processes
Date: Tue, 16 Apr 2019 17:49:39 -0400	[thread overview]
Message-ID: <20190416174939.7622c984@gandalf.local.home> (raw)
In-Reply-To: <20190415230016.13932-3-kaslevs@vmware.com>

On Tue, 16 Apr 2019 02:00:16 +0300
Slavomir Kaslev <kaslevs@vmware.com> wrote:

> Add --no-filter option which doesn't install filters for the trace-cmd recording
> processes pids.
> 
> Signed-off-by: Slavomir Kaslev <kaslevs@vmware.com>
> Suggested-by: Steven Rostedt (VMware) <rostedt@goodmis.org>

I'll apply this, but we should also update the man page.

-- Steve

> ---
>  tracecmd/trace-record.c | 14 +++++++++++---
>  tracecmd/trace-usage.c  |  1 +
>  2 files changed, 12 insertions(+), 3 deletions(-)
> 
> diff --git a/tracecmd/trace-record.c b/tracecmd/trace-record.c
> index dae0396..05a313b 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;
>  
> @@ -1063,6 +1064,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);
>  
> @@ -4377,9 +4381,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,
> @@ -4603,6 +4607,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, '?'},
> @@ -4877,6 +4882,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..29a7081 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 do not set any event filters\n"
>  	},
>  	{
>  		"start",


  reply	other threads:[~2019-04-16 21:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-15 23:00 [PATCH v3 0/2] Optimize pid filters and add --no-filter option Slavomir Kaslev
2019-04-15 23:00 ` [PATCH v3 1/2] trace-cmd: Optimize how pid filters are expressed Slavomir Kaslev
2019-04-16 21:48   ` Steven Rostedt
2019-04-17 13:44     ` Slavomir Kaslev
2019-04-15 23:00 ` [PATCH v3 2/2] trace-cmd: Add --no-filter option to not filter recording processes Slavomir Kaslev
2019-04-16 21:49   ` Steven Rostedt [this message]
2019-04-16 13:22 ` [PATCH v3 0/2] Optimize pid filters and add --no-filter option Phil Auld
2019-04-16 21:39   ` Steven Rostedt
2019-04-17  0:29     ` Phil Auld
2019-04-17 12:49       ` Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190416174939.7622c984@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=jbacik@fb.com \
    --cc=kaslevs@vmware.com \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=pauld@redhat.com \
    --cc=slavomir.kaslev@gmail.com \
    --cc=tstoyanov@vmware.com \
    --cc=ykaradzhov@vmware.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).