Linux-Trace-Devel Archive on lore.kernel.org
 help / color / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Bijan Tabatabai <bijan311@gmail.com>
Cc: linux-trace-devel@vger.kernel.org, Bijan Tabatabai <bijan311@yahoo.com>
Subject: Re: [PATCH v4] trace-cmd: Stop recording when processes traced with -P exit
Date: Thu, 14 May 2020 18:43:48 -0400
Message-ID: <20200514184348.753f3c19@oasis.local.home> (raw)
In-Reply-To: <20200514164244.12858-1-bijan311@gmail.com>

On Thu, 14 May 2020 11:42:44 -0500
Bijan Tabatabai <bijan311@gmail.com> wrote:

> From: Bijan Tabatabai <bijan311@yahoo.com>
> 
> When the -F flag is used in trace-cmd record, trace-cmd stops recording
> when the executable it is tracing terminates.
> This patch makes the -P flag act similarly.
> 
> Signed-off-by: Bijan Tabatabai <bijan311@yahoo.com>
> ---
>  v4 fixes a bug where trace-cmd would stop tracing after the processes in
>  the first instance exited.
> ---
>  

Looks good, but there's one small nit.

> @@ -6361,7 +6441,16 @@ static void record_trace(int argc, char **argv,
>  		}
>  		/* sleep till we are woken with Ctrl^C */
>  		printf("Hit Ctrl^C to stop recording\n");
> -		while (!finished)
> +		for_all_instances(instance) {
> +			/* If an instance is not tracing individual processes
> +			 * or there is an error while waiting for a process to
> +			 * exit, fallback to waiting indefinitely.
> +			 */
> +			if (!instance->nr_process_pids
> +			    || trace_wait_for_processes(instance))

My preference is:

			if (!instance->nr_process_pids ||
			    trace_wait_for_processes(instance))

But I can make this change.

Thanks!

-- Steve

> +				wait_indefinitely = true;
> +		}
> +		while (!finished && wait_indefinitely)
>  			trace_or_sleep(type, pwait);
>  	}
>  


      reply index

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-14 16:42 Bijan Tabatabai
2020-05-14 22:43 ` Steven Rostedt [this message]

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=20200514184348.753f3c19@oasis.local.home \
    --to=rostedt@goodmis.org \
    --cc=bijan311@gmail.com \
    --cc=bijan311@yahoo.com \
    --cc=linux-trace-devel@vger.kernel.org \
    /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

Linux-Trace-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-trace-devel/0 linux-trace-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-trace-devel linux-trace-devel/ https://lore.kernel.org/linux-trace-devel \
		linux-trace-devel@vger.kernel.org
	public-inbox-index linux-trace-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-trace-devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git