davidmarkclements / 0x

🔥 single-command flamegraph profiling 🔥
MIT License
3.21k stars 103 forks source link

fix: add support to inlined functions + sparkplug on v16+ #252

Closed RafaelGSS closed 2 years ago

RafaelGSS commented 2 years ago

I'm still looking if there is something missing because looks like the call stack are not completely correct.

By the way, I'm running this fork: https://github.com/RafaelGSS/slow-rest-api

node ../node-clinic/bin.js flame --on-port='npm run test' -- node index.js

and I'm getting the graph attached

image

Look that payload function is side by side of a/b/c/ function which is its caller

image

Does that is acceptable? @mcollina

204430.clinic-flame.zip

RafaelGSS commented 2 years ago

Well, looks like it still happens even before my fix (which is unrelated to that). So, it's ready to go.

RafaelGSS commented 2 years ago

I did a second deeper look at it and looks good. Unfortunately, inlined functions are usually skipped from call-stack: https://github.com/davidmarkclements/0x/blob/master/lib/ticks-to-tree.js#L118

but this is a different issue, I think that it could land. Would you mind merging?

mcollina commented 2 years ago

should I release or would you like to fix the other problem too?

RafaelGSS commented 2 years ago

I think that you can release it as patch, the another issue would be a big change (not sure yet how to fix it properly)