Ancestors

Toot

Written by Tobin Baker on 2024-08-24 at 01:55

only now appreciating this wisdom

https://www.yosefk.com/blog/profiling-with-ctrl-c.html

=> View attached media

=> More informations about this toot | More toots from tobinbaker@discuss.systems

Descendants

Written by andreaskem on 2024-08-24 at 07:51

@tobinbaker I just use a tool like eu-stack to dump the call stack of a process I am interested in. I just call it ten times in a row and if a function shows up multiple times, I take a look. That does not even take a minute. I do not even bother with a debugger.

=> More informations about this toot | More toots from andreaskem@hachyderm.io

Written by Tobin Baker on 2024-08-24 at 15:42

@andreaskem this little tool automates that for you nicely: https://github.com/jasonrohrer/wallClockProfiler

=> More informations about this toot | More toots from tobinbaker@discuss.systems

Written by andreaskem on 2024-08-24 at 15:53

@tobinbaker That is kind of cool but that almost looks like a proper profiler ;) I like the personal touch of doing "UpArrow", "Enter" a few times and then eyeballing the result. For something that requires a softer touch, there's still perf, at least on Linux.

=> More informations about this toot | More toots from andreaskem@hachyderm.io

Written by Tobin Baker on 2024-08-24 at 16:10

@andreaskem Except that I still haven't found a way to tell perf to just sample all stacks whether on- or off-CPU. You can of course tell it to record scheduler events but that doesn't directly tell you how long an off-CPU stack was blocking.

=> More informations about this toot | More toots from tobinbaker@discuss.systems

Written by andreaskem on 2024-08-24 at 16:30

@tobinbaker Yeah, I mostly need to figure out where CPU time is spent. You are probably aware of Brendan Gregg? If not, he writes about profiling on Linux. On his site, there is a perf example for off-CPU tracing but it is quite complicated. Nowadays, eBPF seems to be preferred for stuff like that:

https://www.brendangregg.com/blog/2015-02-26/linux-perf-off-cpu-flame-graph.html

https://www.brendangregg.com/offcpuanalysis.html

=> More informations about this toot | More toots from andreaskem@hachyderm.io

Written by Julien W. on 2024-08-24 at 10:04

@tobinbaker ahah yes, statistically this works 😁 hopefully in a world with samply, it will be faster to use samply rather than gdb+ctrl c

=> More informations about this toot | More toots from julienw@pouet.chapril.org

Written by Julien W. on 2024-08-24 at 10:18

@tobinbaker

More about samply: https://github.com/mstange/samply

=> More informations about this toot | More toots from julienw@pouet.chapril.org

Written by Tobin Baker on 2024-08-24 at 15:41

@julienw the UI looks nice but it says on Linux it only collects on-CPU traces :(

=> More informations about this toot | More toots from tobinbaker@discuss.systems

Written by Billy O'Neal on 2024-08-24 at 12:50

@tobinbaker @whitequark I guess I’m in the fat part of the bell curve. Control C in the debugger only helps when there’s a hang or some other serious problem, while a good profiler is going to do a lot better. And sometimes things worth profiling happen in less time than a control C will work out.

=> More informations about this toot | More toots from malwareminigun@infosec.exchange

Proxy Information
Original URL
gemini://mastogem.picasoft.net/thread/113014505969624612
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
299.220885 milliseconds
Gemini-to-HTML Time
1.444017 milliseconds

This content has been proxied by September (ba2dc).