<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">I’ve used ghc-prof-flamegraph <a href="https://hackage.haskell.org/package/ghc-prof-flamegraph" class="">https://hackage.haskell.org/package/ghc-prof-flamegraph</a> for timing information.<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Nov 25, 2021, at 4:28 PM, Johannes Waldmann <<a href="mailto:johannes.waldmann@htwk-leipzig.de" class="">johannes.waldmann@htwk-leipzig.de</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Dear Cafe,<br class=""><br class="">with +RTS -p -RTS, the resulting .prof file<br class="">shows (in the second part) what the expensive functions are.<br class="">(counting sections as GHC docs do -<br class="">first part gives program name and options)<br class=""><br class="">Often, that's useful, but sometimes, this info does not surprise me -<br class="">some things just don't have an easy implementation.<br class="">For those, I want to find out who calls them -<br class="">to possibly replace some of these calls<br class="">with a cheaper implementation (that is only valid<br class="">because the caller knows something that the callee does not)<br class=""><br class="">Is there some automation for getting this information?<br class="">I am not even sure how to formalize what I want.<br class="">Perhaps, for the first N heavy cost centers (SCCs),<br class="">a suitably ordered list of their callers (that inherit the cost)?<br class=""><br class="">The data is in the third (long, detailed) part of the .prof file<br class="">but I find it hard to process (in that form). It represents<br class="">the call hiearchy by indentation (first column) and adjacency (of rows)<br class="">but this goes out the window as soon as I grep or sort the rows.<br class=""><br class="">The JSON output format seems the way to go<br class=""><a href="https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/profiling.html#json-profile-format" class="">https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/profiling.html#json-profile-format</a><br class="">.<br class="">Yeah, I should probably just aeson it and then walk the tree.<br class="">I still wanted to ask for advice first, or references<br class="">to existing work. Any pointers appreciated.<br class=""><br class="">- J.<br class="">_______________________________________________<br class="">Haskell-Cafe mailing list<br class="">To (un)subscribe, modify options or view archives go to:<br class="">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe<br class="">Only members subscribed via the mailman list are allowed to post.</div></div></blockquote></div><br class=""></body></html>