On Fri, 19 Jan 2024 18:06:43 +0100 Pierre Gondois <pierre.gondois@xxxxxxx> wrote: > > $ trace-cmd split -B switch_instance -o switch.dat -b -o main.dat -B timer_instance -o timer.dat > > switch.dat: > > - switch_instance as the main instance > > main.dat: > > - main instance as the main instance > > timer.dat: > > - timer_instance as the main instance > > > > [1] > > As the main buffer doesn't have a default name, it might be necessary > > to hardcode the name, as 'main', or as 'main.X' (X being an increasing number) > > if there is already a main instance in the trace > > > It would also mean that: > $ trace-cmd split -B switch_instance -b -o switch.dat -B timer_instance -b -o timer.dat > switch.dat: > - switch_instance as the main instance > - main instance as a side instance, named 'main' > timer.dat: > - timer_instance as the main instance > - main instance as a side instance, named 'main' > > And the usage of the function would be: > $ trace-cmd split [-i file] [options] [[-b -B instance] -o file] [start [end]] > I.e. the options and start/end parameters would be common to all instances/output files. I usually use the term "top" not "main" for the top instance. But I wouldn't want to have a default name anyway. I would just add "--top" instead of '-b' an the main instance. I say "top" as that's the common terminology I have used in man pages. Although, I have used "main" too, I usually append "(top level)" when I do so. We could call it "--main" too, if it sounds better, but should definitely document that it means the "top level instance". Hmm, maybe even '-M' could work. As for naming, if someone wants to make the main instance an instance, then they must also supply a name. $ trace-cmd split -B switch_instance -M --name 'old_main' -o trace-spit.dat And that would switch the main and switch_instance in trace-split.dat. Doesn't mean we can't have both "-M" and "--main" mean the same thing. I want to keep instance single options capitalized. Thanks, -- Steve