linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: "Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com>
Cc: linux-trace-devel@vger.kernel.org
Subject: Re: [PATCH v5 24/25] trace-cmd: Call additional APIs when creating trace file
Date: Wed, 24 Nov 2021 14:51:51 -0500	[thread overview]
Message-ID: <20211124145151.1b5cd041@gandalf.local.home> (raw)
In-Reply-To: <20211111151133.86788-5-tz.stoyanov@gmail.com>

On Thu, 11 Nov 2021 17:11:32 +0200
"Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com> wrote:

> diff --git a/tracecmd/trace-restore.c b/tracecmd/trace-restore.c
> index 8d2fcae8..a903c21a 100644
> --- a/tracecmd/trace-restore.c
> +++ b/tracecmd/trace-restore.c
> @@ -163,6 +163,7 @@ void trace_restore (int argc, char **argv)
>  
>  	if (tracecmd_append_cpu_data(handle, args, &argv[first_arg]) < 0)
>  		die("failed to append data");
> -
> +	if (tracecmd_get_out_file_version(handle) >= FILE_VERSION_SECTIONS)
> +		tracecmd_write_options(handle);

I wonder if we are just missing a tracecmd_output_close() here?

And that will write the options as I mentioned before.

>  	return;
>  }
> diff --git a/tracecmd/trace-split.c b/tracecmd/trace-split.c
> index e4a0c3b3..671d6e9f 100644
> --- a/tracecmd/trace-split.c
> +++ b/tracecmd/trace-split.c
> @@ -391,6 +391,9 @@ static double parse_file(struct tracecmd_input *handle,
>  	if (tracecmd_append_cpu_data(ohandle, cpus, cpu_list) < 0)
>  		die("Failed to append tracing data\n");
>  
> +	if (tracecmd_get_out_file_version(ohandle) >= FILE_VERSION_SECTIONS)
> +		tracecmd_write_options(ohandle);
> +

And no more is written here to ohandle, and the close should fix it as well.

-- Steve

>  	current = end;
>  	for (cpu = 0; cpu < cpus; cpu++) {
>  		/* Set the tracecmd cursor to the next set of records */


  reply	other threads:[~2021-11-24 19:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-11 15:11 [PATCH v5 20/25] trace-cmd library: Initialize CPU data for reading from version 7 trace files Tzvetomir Stoyanov (VMware)
2021-11-11 15:11 ` [PATCH v5 21/25] trace-cmd library: Handle latency trace in version 7 files Tzvetomir Stoyanov (VMware)
2021-11-11 15:11 ` [PATCH v5 22/25] trace-cmd library: Handle buffer trace data init for " Tzvetomir Stoyanov (VMware)
2021-11-11 15:11 ` [PATCH v5 23/25] trace-cmd report: Use the new latency API to read data Tzvetomir Stoyanov (VMware)
2021-11-11 15:11 ` [PATCH v5 24/25] trace-cmd: Call additional APIs when creating trace file Tzvetomir Stoyanov (VMware)
2021-11-24 19:51   ` Steven Rostedt [this message]
2021-11-11 15:11 ` [PATCH v5 25/25] trace-cmd report: Add new parameter for trace file version Tzvetomir Stoyanov (VMware)

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=20211124145151.1b5cd041@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=tz.stoyanov@gmail.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).