TRACE-CMD-SNAPSHOT(1)

๐ŸŒธ NAME ๐ŸŒธ

trace-cmd-snapshot โ€” bestie, this is the libtracefs manual page, and this command is all about taking, resetting, freeing, or showing a Ftrace kernel snapshot. like, the whole snapshot vibe. ๐Ÿ“ธ๐Ÿ’–

๐ŸŽ€ SYNOPSIS ๐ŸŽ€

trace-cmd snapshot [OPTIONS]

๐Ÿ’… DESCRIPTION ๐Ÿ’…

okay so trace-cmd(1) snapshot controls or displays the Ftrace Linux kernel snapshot feature โ€” but only if the kernel supports it, so check that first bestie, no cap.

the whole point is that you can "freeze" an instance of a live trace without stopping the trace. so it's like a freeze-frame, but the trace keeps going. iconic. ๐ŸงŠ

like, here's the exact workflow:

            trace-cmd start -p function
            trace-cmd snapshot -s
            trace-cmd snapshot
           [ dumps the content of buffer at 'trace-cmd snapshot -s' ]
            trace-cmd snapshot -s
            trace-cmd snapshot
           [ dumps the new content of the buffer at the last -s operation ]

so you start the trace, take a snapshot with -s, dump the content, then take another snapshot and dump the new content. literally the whole cycle, and it's iconic. โœจ

โœจ OPTIONS โœจ

  • -s โ€” takes a snapshot of the currently running buffer. like, right now, snap! ๐Ÿ“ธ
  • -r โ€” clears out the buffer. bye bye, data. ๐Ÿงน
  • -f โ€” frees the snapshot buffer. okay this one actually matters, bestie: the buffer takes up memory inside the kernel, and it's best to free it when you're not using it. but don't worry โ€” the first -s operation will allocate it again if it's not already allocated. easy. ๐Ÿ’…
  • -c cpu โ€” operates on a per cpu snapshot. heads up though: this may not be fully supported by all kernels, so if it doesn't work, that's why. ๐Ÿ™ˆ
  • -B buf โ€” if you created a buffer instance, then the -B option will operate on the snapshot within that buffer. so it's like, "use this buffer's snapshot, not the main one." ๐ŸŽ€

๐Ÿฆ‹ SEE ALSO ๐Ÿฆ‹

bestie, you should totally check out these other pages too:

all the trace-cmd content your heart desires. ๐Ÿ’–

๐Ÿ’– AUTHOR ๐Ÿ’–

written by Steven Rostedt, <rostedt@goodmis.org[1]>. king behavior, honestly. ๐Ÿ‘‘

๐ŸŒˆ RESOURCES ๐ŸŒˆ

the repo is right here bestie: https://git.kernel.org/pub/scm/utils/trace-cmd/trace-cmd.git/ โ€” go off. ๐Ÿ’ป

๐Ÿ“ COPYING ๐Ÿ“

Copyright (C) 2010 Red Hat, Inc. Free use of this software is granted under the terms of the GNU Public License (GPL). ๐Ÿ“œ

๐Ÿงš NOTES ๐Ÿงš

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

๐Ÿ’– and that's the teaaaa! this page is from libtracefs, dated 03/09/2026, and it's TRACE-CMD-SNAPSHOT(1). slay, periodt, bye bestie! ๐Ÿ’–

๐Ÿ“ฆ where this page comes from