Closed Bug 1690624 Opened 4 years ago Closed 3 years ago

Registering a rust thread with the profiler should be easy

Categories

(Core :: Gecko Profiler, task, P2)

task

Tracking

()

RESOLVED FIXED
91 Branch
Tracking Status
firefox91 --- fixed

People

(Reporter: florian, Assigned: canova)

References

(Blocks 3 open bugs)

Details

Attachments

(5 files)

Or even better, not registering a rust thread with the profiler should be difficult.

Currently we have code doing things like:
https://searchfox.org/mozilla-central/rev/927e525f481a93a8f63d27a78ae6201e42b1b1fb/gfx/layers/wr/WebRenderBridgeParent.cpp#149-153

void gecko_profiler_register_thread(const char* name) {
  PROFILER_REGISTER_THREAD(name);
}

void gecko_profiler_unregister_thread() { PROFILER_UNREGISTER_THREAD(); }

https://searchfox.org/mozilla-central/rev/927e525f481a93a8f63d27a78ae6201e42b1b1fb/gfx/webrender_bindings/src/bindings.rs#1061

extern "C" {
    fn gecko_profiler_register_thread(name: *const ::std::os::raw::c_char);
    fn gecko_profiler_unregister_thread();
    fn wr_register_thread_local_arena();
}
Severity: -- → N/A
Priority: -- → P2
Assignee: nobody → canaltinova
Attachment #9224529 - Attachment description: WIP: Bug 1690624 - Create an empty rust crate for profiler API → Bug 1690624 - Create an empty rust crate for profiler API r?gerald
Status: NEW → ASSIGNED
Attachment #9224530 - Attachment description: WIP: Bug 1690624 - Create empty ProfilerBindings header and cpp files → Bug 1690624 - Create empty ProfilerBindings header and cpp files r?gerald
Attachment #9224531 - Attachment description: WIP: Bug 1690624 - Add profiler rust API for thread registration/unregistration → Bug 1690624 - Add profiler rust API for thread registration/unregistration r?gerald
Attachment #9224532 - Attachment description: WIP: Bug 1690624 - Replace the old profiler registration FFIs with the new API in webrender → Bug 1690624 - Replace the old profiler thread registration FFIs with the new API in webrender r?jrmuizel
Attachment #9224533 - Attachment description: WIP: Bug 1690624 - Replace the old profiler registration FFIs with the new API in servo → Bug 1690624 - Replace the old profiler thread registration FFIs with the new API in servo r?emilio
Pushed by canaltinova@gmail.com: https://hg.mozilla.org/integration/autoland/rev/102b7e2e1d23 Create an empty rust crate for profiler API r=emilio https://hg.mozilla.org/integration/autoland/rev/17ab690c9058 Create empty ProfilerBindings header and cpp files r=gerald https://hg.mozilla.org/integration/autoland/rev/bf15631f6360 Add profiler rust API for thread registration/unregistration r=gerald,emilio https://hg.mozilla.org/integration/autoland/rev/398fcf75e15b Replace the old profiler thread registration FFIs with the new API in webrender r=jrmuizel https://hg.mozilla.org/integration/autoland/rev/66b6bf9d6c51 Replace the old profiler thread registration FFIs with the new API in servo r=emilio
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: