linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Pierre Gondois <pierre.gondois@arm.com>
Cc: Linux Trace Devel <linux-trace-devel@vger.kernel.org>
Subject: Re: [PATCH v3 4/5] trace-cmd split: Enable support for buffer selection
Date: Sun, 11 Feb 2024 18:35:53 -0500	[thread overview]
Message-ID: <20240211183553.6976670f@rorschach.local.home> (raw)
In-Reply-To: <13355fbc-7592-4a54-8e92-e3d78afa83ae@arm.com>

On Mon, 5 Feb 2024 14:38:38 +0100
Pierre Gondois <pierre.gondois@arm.com> wrote:
 > 
> > So what I'm thinking is that the -B buffers default to the same buffer as
> > the top buffer unless specified differently.
> > 
> > Here's what I think would work. We add four new options.
> > 
> >   --top
> >   -B <instance>
> >   -t
> >   -b
> > 
> > Where --top represents the "top" instance.
> > 
> > -B represents the <instance>
> > 
> > -t can be used after -B to make it a top instance.
> > 
> > -b can be used before any -B to make the top instance into its own instance.  
> 
> This set of parameters sounds good to me.
> 
> > 
> > Rules:
> > 
> >    --top can not come after -B.
> >    -t must come after -B
> >    -b must come before -B  
> 
> IIUC, these rules are described in the syntax below.
> 
> > 
> > There can only be one top instance, and all named instances must be unique.
> > That is, you can't have two instances called "foo".
> > 
> > We have: trace-cmd split <TOP_COMMANDS> <INSTANCE_COMMANDS>
> > 
> >    TOP_COMMANDS :: nil | TOP_PARAMS
> > 
> >    INSTANCE_COMMANDS :: nil | -B name INSTANCE_PARAMS INSTANCE_COMMANDS
> > 
> >    TOP_PARAMS :: nil | TOP_OPTIONS TOP_PARAMS
> > 
> >    TOP_OPTIONS :: --top | -b name | -o file
> > 
> >    INSTANCE_PARAMS :: nil | INSTANCE_OPTIONS INSTANCE_PARAMS
> > 
> >    INSTANCE_OPTIONS :: nil | -t | -o file  
> 
> I think it might also be difficult to place the top instance in multiple output
> files (or the intention was to do it in multiple steps ?). For instance, from a
> trace containing a top instance and foo/bar instances, what would be the command
> to obtain:
> - a foo.dat file containing the top + foo instances
> - a bar.dat file containing the top + bar instances

Does that need to be done in a single command, or two commands?

  trace-cmd split --top -B foo
  trace-cmd split --top -B bar

?

> 
> If this was:
>    trace-cmd split --top -o foo.dat --top -o bar.dat -B foo -o foo.dat -B bar -o bar.dat
> I think it would be clearer to revolve around the output file:
>    trace-cmd split --top -B foo -o foo.dat --top -B bar -o bar.dat
> but this is open to debate.

My concern is that if we want to do that in one command it can cause
the code and parameters to become too complex. But I'm not against the
idea. I personally think that if we allow too much it may become too
confusing.

> 
> ---
> 
> Also, if one wants to place all the instance in one output.dat file, IIUC all the
> instances will have to be nominatively selected right ?
> 
> > 
> > Examples:
> > 
> >   trace-cmd split --top -B foo
> > 
> > Will make a trace.dat.1 that has top and foo in it.
> > 
> >   trace-cmd split --top
> > 
> > Will make a trace.dat.1 that only has the top instance
> > 
> >   trace-cmd split -B foo
> > 
> > Will make a trace.dat.1 that only has foo in it.
> > 
> >   trace-cmd split -B foo -t
> > 
> > Will make a trace.dat.1 that only has foo in it. It will also promote the
> > instance foo to the top instance (it will lose its "foo" name).
> > 
> >   trace-cmd split --top -o buba.dat -B foo
> > 
> > Will create a buba.dat that has both top and foo in it  
> 
>  From the syntax above, I would have thought that this would be parsed as:
> - <TOP_COMMANDS>: '--top -o buba.dat'
> - <INSTANCE_COMMANDS>: '-B foo'
> 
> and so that the 'foo' instance would end up in the default trace.dat.1
> as there is no output file specified.

No, I was saying that -B will default to the top file, not the default
file. If the top file is specified, then the -B will also be in that file.

> 
> > 
> >   trace-cmd split --top -B foo -o buba.dat
> > 
> > Will create a trace-dat.1 with just top in it, and buba.dat with just foo
> > in it.
> > 
> >   trace-cmd split --top -B foo -o buba.dat -t
> > 
> > Will create a trace-dat.1 with just top in it, and buba.dat with just foo
> > in it (promoting foo to top instance)
> > 
> >   trace-cmd split --top -b foo -B foo -t
> > 
> > Will make a trace.dat.1 file where the top instance becomes "foo" and the
> > foo instance becomes the top instance.
> > 
> >    trace-cmd split -o buba.dat -B foo -t  
> 
> I think this would be parsed (cf. the syntax above) as:
> - <TOP_COMMANDS>: '-o buba.dat'
> - <INSTANCE_COMMANDS>: '-B foo -t'
> 
> So there would be
> - a buba.dat file containing all the possible instances and the
>    top instance
> - a default trace.data.1 containing the foo instance as the top instance

Again, -o of the top file becomes the default for all the rest, unless
they specify their own output file.

-- Steve

  reply	other threads:[~2024-02-11 23:36 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-23 13:42 [PATCH v3 0/5] trace-cmd: split: Handle splitting files with multiple instances Pierre Gondois
2024-01-23 13:42 ` [PATCH v3 1/5] trace-cmd split: Store instances in local list Pierre Gondois
2024-01-23 13:42 ` [PATCH v3 2/5] trace-cmd split: Add functions to generate temp files Pierre Gondois
2024-01-23 13:42 ` [PATCH v3 3/5] trace-cmd split: Handle splitting files with multiple instances Pierre Gondois
2024-01-24 22:35   ` Steven Rostedt
2024-01-23 13:42 ` [PATCH v3 4/5] trace-cmd split: Enable support for buffer selection Pierre Gondois
2024-01-24 22:37   ` Steven Rostedt
2024-01-25 15:16     ` Pierre Gondois
2024-01-25 16:28       ` Steven Rostedt
2024-01-25 16:51         ` Steven Rostedt
2024-01-25 17:10           ` Steven Rostedt
2024-01-26  8:54             ` Pierre Gondois
2024-02-02  2:17               ` Steven Rostedt
2024-02-05 13:38                 ` Pierre Gondois
2024-02-11 23:35                   ` Steven Rostedt [this message]
2024-02-12  9:11                     ` Pierre Gondois
2024-02-12 21:28                       ` Steven Rostedt
2024-01-23 13:42 ` [PATCH v3 5/5] trace-cmd split: Update usage Pierre Gondois

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=20240211183553.6976670f@rorschach.local.home \
    --to=rostedt@goodmis.org \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=pierre.gondois@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).