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_frequency
  • cpu_idle
  • sched_migrate_task
  • sched_process_exit
  • sched_process_fork
  • sched_switch
  • sched_wakeup
  • sched_wakeup_new
  • sched_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 QApplication class. 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 🫢


πŸ’€ 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 (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