https://kotlinlang.org logo
m

martmists

10/11/2021, 12:12 PM
strangely enough it crashes either in my function or before it depending on what functions I have defined somehow?
g

Gavin Ray

10/11/2021, 3:50 PM
You might try profiling it with something like Tracy, which should make the callstack + exception-throwing call easier to digest: https://github.com/wolfpld/tracy
This requires a bit of setup in the code itself though If you want to avoid that, then you might try
valgrind
running in
callgrind
mode Can visualize output with
kcachegrind
https://apps.kde.org/kcachegrind/
m

martmists

10/11/2021, 5:49 PM
seemed like an issue with staticCFunction somehow not making my functions static, all good now 👍
🙌 1
If you want to avoid that, then you might try 
valgrind
 running in 
callgrind
 mode
How do I tell python to do this?
g

Gavin Ray

10/12/2021, 2:51 PM
Like this:
Copy code
valgrind --tool=callgrind python thing.py
You can add other flags like
--branch-sim=yes
or
--cache-sim=yes
and whatnot but for a base invocation that should spit out the
callgrind
log, that you can then view using tools like KCachegrind