stacktraces and profiling

50 views
Skip to first unread message

Brian Craft

unread,
Jan 15, 2020, 5:36:42 PM1/15/20
to emscripten-discuss
When using the chrome profiler, the stack traces for wasm functions are all identical. Like so:

WASM_function#25:module:_baos_push
  js-to-wasm#93:export:js-to-wasm#93
    Module._main

WASM_function#101:module:_hfc_lookup
  js-to-wasm#93:export:js-to-wasm#93
    Module._main

Is this expected? What does it mean? To be clear, I was expecting the stack to show the calls between the different wasm functions, as you would see if profiling on other platforms.

Alon Zakai

unread,
Jan 16, 2020, 10:20:42 AM1/16/20
to emscripte...@googlegroups.com
Those stack traces look like _main() (likely a JS wrapper) calls baos_push() or hfc_lookup(). Are those not correct stack traces? They do look a little odd as I'd expect to see main() (not a JS wrapper, but in wasm) in the middle, at least.

If you were expecting more stack traces to be profiled, perhaps the random sampling didn't happen to pick any up because the sample was too short and those stack traces too rare?

If you have a testcase you can share, I can take a look - I don't think I've seen something like this before, could be a bug. Or a screenshot might help too, maybe the UI is confusing (can try changing between top-down and bottom-up displays in the profiler perhaps, one might be less clear than the other).

--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-disc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/72936834-2682-4ca4-8fa7-5b03fce1a5f5%40googlegroups.com.
Message has been deleted

Brian Craft

unread,
Jan 16, 2020, 6:40:54 PM1/16/20
to emscripten-discuss
Hm, well, I posted some screenshots, but apparently the post was deleted.

The traces do not look correct. All the C functions have the same stack trace, when viewed in the profiler.

Alon Zakai

unread,
Jan 17, 2020, 5:13:49 PM1/17/20
to emscripte...@googlegroups.com
That first screenshot definitely looks wrong, yeah... weird.

I'd try on latest (dev/canary), and if you still see that problem, please file a chromium bug.

On Fri, Jan 17, 2020 at 6:01 AM Brian Craft <craft...@gmail.com> wrote:
_main doesn't call baos_push directly. Also, there isn't an inlining scenario that would explain the stacktraces. Disabling inlining across translation units doesn't affect the stacktraces.

Attaching a couple screenshots. One is a single stacktrace, fully expanded. The other is a bunch of other wasm functions, where you can see they're all the same, and don't show any wasm->wasm calls.




On Thursday, January 16, 2020 at 7:20:42 AM UTC-8, Alon Zakai wrote:

Brian Craft

unread,
Jan 23, 2020, 2:01:57 PM1/23/20
to emscripten-discuss
I just tried again with the llvm backend, and the stack traces look correct. So, I doubt it's a chromium issue. More likely to be an emscripten issue with fastcomp backend.

Alon Zakai

unread,
Jan 23, 2020, 4:09:32 PM1/23/20
to emscripte...@googlegroups.com
Interesting, thanks for the update.

Not sure what could cause that in fastcomp, but as it's deprecated anyhow at this point, probably best to focus on upstream.

--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-disc...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages