linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: vincent.donnefort@arm.com
Cc: linux-trace-devel@vger.kernel.org
Subject: Re: [PATCH v2] trace-cmd: Fix "trace-cmd extract" temp files path
Date: Thu, 1 Oct 2020 12:30:27 -0400	[thread overview]
Message-ID: <20201001123027.3903321f@gandalf.local.home> (raw)
In-Reply-To: <1601542769-443324-1-git-send-email-vincent.donnefort@arm.com>

On Thu,  1 Oct 2020 09:59:29 +0100
vincent.donnefort@arm.com wrote:

> From: Vincent Donnefort <vincent.donnefort@arm.com>
> 
> During the introduction of instance's output_file copy:
> 
>   3a206ca ("trace-cmd: Have instances include a copy of its output file")
> 
> The extract path has been omitted, causing the temp files created to be
> written in the same directory using the null "output_file" of the
> instance, to create "(null).cpuX" files. If this is executed in a
> directory that is not writable (like /sys/kernel/tracing) or does not
> have enough space to hold the temp files, then it will fail to write.
> 
> Signed-off-by: Vincent Donnefort <vincent.donnefort@arm.com>
> 
> diff --git a/tracecmd/trace-record.c b/tracecmd/trace-record.c
> index bd00457..72a5c8c 100644
> --- a/tracecmd/trace-record.c
> +++ b/tracecmd/trace-record.c
> @@ -6622,6 +6622,9 @@ void trace_extract(int argc, char **argv)
>  
>  	/* Save the state of tracing_on before starting */
>  	for_all_instances(instance) {
> +		instance->output_file = strdup(ctx.output);
> +		if (!instance->output_file)
> +			die("Failed to allocate output file name for instance");
>  
>  		if (!ctx.manual && instance->flags & BUFFER_FL_PROFILE)
>  			enable_profile(ctx.instance);

Applied. Thanks Vincent!

-- Steve

      reply	other threads:[~2020-10-01 16:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-01  8:59 [PATCH v2] trace-cmd: Fix "trace-cmd extract" temp files path vincent.donnefort
2020-10-01 16:30 ` 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=20201001123027.3903321f@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=vincent.donnefort@arm.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).