TRACE-CMD-SPLIT(1)

๐Ÿฆ‹ trace-cmd-split โ€” like, the libtracefs manual, but make it make sense ๐Ÿ’…

okay bestie, so this is trace-cmd-split(1) from the libtracefs Manual and honestly? it's kind of a legend. it takes one big trace.dat and chops it into cute little baby files. slay. โœจ


๐ŸŒธ SYNOPSIS ๐ŸŒธ

trace-cmd split [OPTIONS] [start-time [end-time]]

๐Ÿ’– DESCRIPTION ๐Ÿ’–

so trace-cmd(1) split is literally the "break up a trace.dat into small files" girlie. that's her whole thing. ๐ŸŽ€

start-time is where the new file starts โ€” like, where the party begins. pro tip: you can run trace-cmd-report(1), copy the timestamp sitting next to a particular event, and use that as input for either start-time or end-time. iykyk. ๐Ÿซถ

the split stops making files when it hits an event after end-time. and if you only need end-time? just use 0.0 as your start-time. easy.

if start-time is left out, the split starts at the beginning of the file. no notes. if end-time is left out, the split just keeps going until the end of the file โ€” unless it runs into one of the requirements the options set up. ๐Ÿฆ‹


โœจ OPTIONS โœจ

  • -i file โ€” if you don't pass this, the split command goes looking for a file named trace.dat (default behaviour, very main character). this option lets you read a different file instead of trace.dat.
  • -o file โ€” by default the split command uses the input file name as the basis for where to write the split files. the output file is the input file with an attached '.#\' on the end: trace.dat.1, trace.dat.2, etc.

this option changes the name of the base file used.

-o file creates file.1, file.2, etc.

  • -s seconds โ€” how many seconds should be recorded before the new file should stop.
  • -m milliseconds โ€” how many milliseconds should be recorded before the new file should stop.
  • -u microseconds โ€” how many microseconds should be recorded before the new file should stop.
  • -e events โ€” how many events should be recorded before the new file should stop.
  • -p pages โ€” the number of pages that should be recorded before the new file should stop.
โš ๏ธ note: only one of -p, -e, -u, -m, -s may be specified at a time. pick one, bestie, you can't have all five. ๐Ÿ™ˆ
๐Ÿ’ก if -p is specified, then -c is automatically set. it just happens. no cap.
  • -r โ€” this one causes the break up to repeat until end-time is reached (or end of the input, if you didn't give an end-time).
trace-cmd split -r -e 10000

this breaks trace.dat into several smaller files, each with at most 10,000 events in it. obsessed. ๐Ÿ”ฅ

  • -c โ€” this causes the above break up to be per CPU. iconic behaviour tbh.
trace-cmd split -c -p 10

this creates a file that has 10 pages per each CPU from the input.

  • -C cpu โ€” this splits for a single CPU. only the cpu you name gets extracted from the file.
trace-cmd split -C 1

this splits out all the events for cpu 1 in the file. ๐Ÿงš

  • --top โ€” this allows you to keep the top buffer. the top buffer can be renamed using the -b option.
trace-cmd split --top

this keeps only the top buffer.

trace-cmd split --top -b old_top

this keeps only the top buffer and renames it 'old_top'. ๐Ÿ’œ

  • -B buffer โ€” this allows you to keep the selected buffer. a buffer can be promoted to the top buffer using the -t option.
trace-cmd split -B timer -B sched

this keeps the 'timer' and 'sched' buffers.

trace-cmd split -B timer -t -B sched

this keeps the 'timer' and 'sched' buffers, with the events from the 'timer' buffer promoted to the top instance. ๐Ÿ’ซ


๐ŸŒˆ SEE ALSO ๐ŸŒˆ

trace-cmd(1), trace-cmd-record(1), trace-cmd-report(1), trace-cmd-start(1), trace-cmd-stop(1), trace-cmd-extract(1), trace-cmd-reset(1), trace-cmd-list(1), trace-cmd-listen(1)


๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

written by Steven Rostedt, <rostedt@goodmis.org[1]> โ€” yeah, that Steven Rostedt. respect the icon. ๐Ÿซก


โญ RESOURCES โญ

https://git.kernel.org/pub/scm/utils/trace-cmd/trace-cmd.git/ โ€” go look, it's giving open source excellence. ๐Ÿฆ‹


๐Ÿ“ COPYING ๐Ÿ“

Copyright (C) 2010 Red Hat, Inc. free use of this software is granted under the terms of the GNU Public License (GPL). periodt. ๐Ÿ’…


๐Ÿ“ NOTES ๐Ÿ“

  1. rostedt@goodmis.org mailto:rostedt@goodmis.org

and that's the whole page, bestie! it's libtracefs, dated 03/09/2026 โ€” saved you the scroll, you're welcome ๐Ÿ’–โœจ๐ŸŽ€

๐Ÿ“ฆ where this page comes from