TRACESHARK(1)
β¨ TRACESHARK β¨
okay bestie, sit down, hydrate, because i'm about to introduce you to traceshark β a viewer for traces from trace-cmd and perf. yes that's the whole name section, it's giving minimal and iconic π
π¦ SYNOPSIS π¦
traceshark [ OPTION ]... [ filename ]
like. that's it. that's the whole summoning ritual. a bunch of options if you want them, and filename if you're feeling generous π
πΈ DESCRIPTION πΈ
so traceshark is a graphical viewer for the Ftrace and Perf events that the Linux kernel can capture. not a terminal gremlin situation β actual pixels, actual graphs, actual main character energy π
and the events it visualizes? bestie. the list. hold on to something:
cpu_frequencycpu_idlesched_migrate_tasksched_process_exitsched_process_forksched_switchsched_wakeupsched_wakeup_newsched_waking
now about that last one β the sched_waking events are not really visualized, lowkey. but there's a button so you can go find the sched_waking event that has instigated a particular sched_wakeup event. cute little detective work fr fr π
π OPTIONS π
- whatever Qt supports, traceshark supports β that's the vibe. traceshark supports the options that are supported by all Qt applications, so for the details you gotta check the Qt documentation, especially the documentation of the
QApplicationclass. iykyk π
no cap, that's genuinely the entire options section. the Qt girlies ate and left no crumbs.
π EXAMPLES π
here's how you use perf to capture a trace that you can then view with traceshark. watch closely bestie, this one's long but it's iconic:
$ sudo mount -t tmpfs tmpfs /mnt/tmp
$ cd /mnt/tmp
$ sudo perf record -e power:cpu_frequency -e power:cpu_idle -e sched:sched_kthread_stop -e sched:sched_kthread_stop_ret -e sched:sched_migrate_task -e sched:sched_move_numa -e sched:sched_pi_setprio -e sched:sched_process_exec -e sched:sched_process_exit -e sched:sched_process_fork -e sched:sched_process_free -e sched:sched_process_wait -e sched:sched_stick_numa -e sched:sched_swap_numa -e sched:sched_switch -e sched:sched_wait_task -e sched:sched_wake_idle_without_ipi -e sched:sched_wakeup -e sched:sched_wakeup_new -e sched:sched_waking -e cpu-cycles -e cpu-cycles --call-graph=dwarf,20480 -m 512M -r 99 -a
<Control-C>
$ sudo perf script -f > tracefile.asc
$ traceshark tracefile.asc&
see that <Control-C>? yeah you just vibe there and then hit it when you're done π
and it's also possible to use trace-cmd to capture a trace, if that's more your thing:
$ sudo mount -t tmpfs tmpfs /mnt/tmp
$ cd /mnt/tmp
$ sudo trace-cmd record -e cpu_frequency -e cpu_idle -e sched_kthread_stop -e sched_kthread_stop_ret -e sched_migrate_task -e sched_move_numa -e sched_pi_setprio -e sched_process_exec -e sched_process_exit -e sched_process_fork -e sched_process_free -e sched_process_wait -e sched_stick_numa -e sched_swap_numa -e sched_switch -e sched_wait_task -e sched_wake_idle_without_ipi -e sched_wakeup -e sched_wakeup_new -e sched_waking -b 32768 -r 99
<Control-C>
$ trace-cmd report trace.dat > tracefile.asc
$ traceshark tracefile.asc&
both routes, same destination: tracefile.asc and a traceshark window popping up like β¨surpriseβ¨
π«Ά SEE ALSO π«Ά
- more detailed info about how to use traceshark: https://github.com/cunctator/traceshark
- documentation of the
QApplicationclass and the command line options: https://doc.qt.io/qt-5/qapplication.html - sample traces live right here: https://github.com/cunctator/traceshark-resources
π BUGS π
okay so here's the tea, and it's a lil bit of a bummer: traceshark uses the QCustomPlot library to display one graph for each task in the trace. and for this reason the UI might become slow when you're displaying a large trace with many thousands of tasks, because QCustomPLot has not been designed to display such a large number of graphs. π
(yes it's spelled QCustomPLot right there, i'm not touching it, it's canon)
the situation can be improved by compiling traceshark from source code and making sure that you use its own internal QCustomPlot, which contains some hacks to improve the performance with a large number of graphs. so like, if it's laggy, that's your glow-up path π₯
π AUTHOR π
traceshark was created by Viktor Rosendahl <viktor.rosendahl@iki.fi>.
π COPYRIGHT π
Copyright (c) 2020 Viktor Rosendahl
the license of this man page is GPLv2+: http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
and that's the whole page bestie, we ate and left zero crumbs π this was traceshark, version v0.9.9-beta, dated 23 February 2020, straight from the General Commands Manual β periodt π β¨
π¦ where this page comes from
- debian bookworm: traceshark 0.9.14~beta-1 Β· GPL-2.0-or-later OR BSD-2-Clause
- debian trixie: traceshark 0.9.14~beta-1+b1 Β· GPL-2.0-or-later OR BSD-2-Clause
- ubuntu jammy: traceshark 0.9.12~beta-2 Β· GPL-2.0-or-later OR BSD-2-Clause
- ubuntu noble: traceshark 0.9.14~beta-1build2 Β· GPL-2.0-or-later OR BSD-2-Clause
- ubuntu questing: traceshark 0.9.14~beta-1build2
- ubuntu resolute: traceshark 0.9.14~beta-1build3 Β· GPL-2.0-or-later OR BSD-2-Clause
- ubuntu stonking: traceshark 0.9.14~beta-1build3 Β· GPL-2.0-or-later OR BSD-2-Clause
- Copyright (c) 2020, Viktor Rosendahl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms