V3: - Add error handling for strdup() calls. - Fix bug described at [2]: the split command kept generating split files forever when the '-r' option was provided. A new handle was used in each loop, meaning the input file was being parsed again from the beginning. - Remove the 2 first patch accepted in v2. V2: - Add 'trace-cmd split: Enable support for buffer selection' to handle instance selection with the 'trace-cmd' split command. - Rename patches as 'trace-cmd: split' -> 'trace-cmd split'. - Correctly free allocated memory in different lists. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=218357 Splitting trace files having multiple buffer instances discards side-buffers . I.e., only the main buffer is preserved in the resulting split trace files. This patch-set intends to fix this. As a continuation of the bugzilla, support to allow selecting buffer instances is added to the 'trace-cmd split' command [1]. This support implies adding new '-B/--top' parameters. Also: - Fix a side issue preventing to provide start/end timestamps along with a time-window parameters. - Update trace-cmd split usage [1] https://lore.kernel.org/all/20240119122511.440d8f0a@xxxxxxxxxxxxxxxxxx/ [2] https://lore.kernel.org/all/20240122192346.5a9035e2@xxxxxxxxxxxxxxxxxx/ Pierre Gondois (5): trace-cmd split: Store instances in local list trace-cmd split: Add functions to generate temp files trace-cmd split: Handle splitting files with multiple instances trace-cmd split: Enable support for buffer selection trace-cmd split: Update usage tracecmd/trace-split.c | 550 ++++++++++++++++++++++++++++++++++------- tracecmd/trace-usage.c | 9 +- 2 files changed, 468 insertions(+), 91 deletions(-) -- 2.25.1