Closed Bug 1887068 Opened 2 months ago Closed 1 month ago

Add support for perfetto track events

Categories

(Core :: Performance, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
127 Branch
Tracking Status
firefox127 --- fixed

People

(Reporter: denispal, Assigned: denispal)

References

(Depends on 1 open bug)

Details

Attachments

(3 files, 1 obsolete file)

Adding support for track events in perfetto will let us better visualize how work is being scheduled on Android.

Depends on D205663

Attachment #9393193 - Attachment description: WIP: Bug 1887068: WIP: Add --enable-perfetto config option and build with perfetto SDK when enabled. → Bug 1887068: Add --enable-perfetto config option and build with perfetto SDK when enabled. r=glandium!
Attachment #9393194 - Attachment description: WIP: Bug 1887068: WIP Add perfetto event traces for taskcontroller tasks and dom performance measurements by the user → Bug 1887068: Add perfetto event traces for taskcontroller tasks and dom performance measurement markers. r=smaug!
Attachment #9393195 - Attachment description: WIP: Bug 1887068: WIP Add proper task names to JS HelperTasks → Bug 1887068: Add proper task names to JS HelperTasks. r=jonco!
Attachment #9393195 - Attachment is obsolete: true
Depends on: 1888429
Attachment #9393193 - Attachment description: Bug 1887068: Add --enable-perfetto config option and build with perfetto SDK when enabled. r=glandium! → Bug 1887068: Add perfetto SDK and build with it when profiling is enabled on Android. r=glandium!
Attachment #9393193 - Attachment description: Bug 1887068: Add perfetto SDK and build with it when profiling is enabled on Android. r=glandium! → Bug 1887068: Add perfetto SDK and build with it when profiling is enabled on Android. r=glandium!,smaug!,dveditz!
Attachment #9393193 - Attachment description: Bug 1887068: Add perfetto SDK and build with it when profiling is enabled on Android. r=glandium!,smaug!,dveditz! → Bug 1887068: Add perfetto SDK and build with it when gecko profiling is enabled on Android. r=glandium!,smaug!,dveditz!
Pushed by dpalmeiro@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/90a702920d77
Add perfetto SDK and build with it when gecko profiling is enabled on Android. r=glandium,smaug,dveditz
https://hg.mozilla.org/integration/autoland/rev/3a4d2b74219e
Add perfetto event traces for taskcontroller tasks and dom performance measurement markers. r=smaug
https://hg.mozilla.org/integration/autoland/rev/c6863f012b03
Add perfetto to about:license. r=sylvestre

Backed out for causing build bustages

  • Backout link
  • Push with failures
  • Failure Log
  • Failure line: clang++: error: linker command failed with exit code 1 (use -v to see invocation)
    gmake[4]: *** [/builds/worker/checkouts/gecko/config/rules.mk:541: libxul.so] Error 1
    gmake[3]: *** [/builds/worker/checkouts/gecko/config/recurse.mk:72: toolkit/library/build/target] Error 2
Flags: needinfo?(dpalmeiro)

Removed the asan declarations that perfetto has and replaced them with the declarations in mozilla/MemoryChecking.h which fixes the asan build error.

Flags: needinfo?(dpalmeiro)
Pushed by dpalmeiro@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/efbf5c7065e3
Add perfetto SDK and build with it when gecko profiling is enabled on Android. r=glandium,smaug,dveditz
https://hg.mozilla.org/integration/autoland/rev/61a9d3a1e592
Add perfetto event traces for taskcontroller tasks and dom performance measurement markers. r=smaug
https://hg.mozilla.org/integration/autoland/rev/658f4b57b8ec
Add perfetto to about:license. r=sylvestre

This appears to be causing build bustages again. Building locally with this revision breaks mach build and reverting this commit fixes the issue.

Relevant build errors

 6:39.41 In file included from Unified_cpp_dom_performance0.cpp:20:
 6:39.41 In file included from /Users/mozilla/StudioProjects/mozilla-unified/dom/performance/Performance.cpp:36:
 6:39.42 /Users/mozilla/StudioProjects/mozilla-unified/obj-aarch64-unknown-linux-android/dist/include/mozilla/Perfetto.h:11:12: warning: non-portable path to file '"Perfetto.h"'; specified path differs in case from file name on disk [-Wnonportable-include-path]
 6:39.42    11 | #  include "perfetto.h"
 6:39.42       |            ^~~~~~~~~~~~
 6:39.42       |            "Perfetto.h"
 6:39.45 /Users/mozilla/StudioProjects/mozilla-unified/obj-aarch64-unknown-linux-android/dist/include/mozilla/Perfetto.h:90:8: error: explicit specialization of undeclared template struct 'TraceTimestampTraits'
 6:39.45    90 | struct TraceTimestampTraits<mozilla::TimeStamp> {
 6:39.46       |        ^                   ~~~~~~~~~~~~~~~~~~~~
 6:39.48 /Users/mozilla/StudioProjects/mozilla-unified/obj-aarch64-unknown-linux-android/dist/include/mozilla/Perfetto.h:91:17: error: unknown type name 'TraceTimestamp'
 6:39.48    91 |   static inline TraceTimestamp ConvertTimestampToTraceTimeNs(
 6:39.48       |                 ^
 6:39.50 /Users/mozilla/StudioProjects/mozilla-unified/obj-aarch64-unknown-linux-android/dist/include/mozilla/Perfetto.h:93:13: error: use of undeclared identifier 'protos'
 6:39.50    93 |     return {protos::gen::BuiltinClock::BUILTIN_CLOCK_MONOTONIC,
 6:39.51       |             ^
 6:39.54 /Users/mozilla/StudioProjects/mozilla-unified/obj-aarch64-unknown-linux-android/dist/include/mozilla/Perfetto.h:101:1: error: a type specifier is required for all declarations
 6:39.54   101 | PERFETTO_DEFINE_CATEGORIES(perfetto::Category("task"),
 6:39.54       | ^
 6:39.60 /Users/mozilla/StudioProjects/mozilla-unified/obj-aarch64-unknown-linux-android/dist/include/mozilla/Perfetto.h:101:38: error: no member named 'Category' in namespace 'perfetto'
 6:39.60   101 | PERFETTO_DEFINE_CATEGORIES(perfetto::Category("task"),
 6:39.60       |                            ~~~~~~~~~~^
 6:39.60 /Users/mozilla/StudioProjects/mozilla-unified/obj-aarch64-unknown-linux-android/dist/include/mozilla/Perfetto.h:102:38: error: no member named 'Category' in namespace 'perfetto'
 6:39.60   102 |                            perfetto::Category("usertiming"));
 6:39.60       |                            ~~~~~~~~~~^
 6:39.79 dom/quota
 6:39.96 dom/reporting
 6:40.48 In file included from Unified_cpp_dom_performance0.cpp:20:
 6:40.48 /Users/mozilla/StudioProjects/mozilla-unified/dom/performance/Performance.cpp:774:7: error: use of undeclared identifier 'TRACE_EVENT_CATEGORY_ENABLED'
 6:40.48   774 |   if (TRACE_EVENT_CATEGORY_ENABLED("usertiming")) {
 6:40.48       |       ^
 6:40.53 /Users/mozilla/StudioProjects/mozilla-unified/dom/performance/Performance.cpp:776:15: error: no type named 'DynamicCategory' in namespace 'perfetto'
 6:40.53   776 |     perfetto::DynamicCategory category{str.get()};
 6:40.53       |     ~~~~~~~~~~^
 6:40.57 /Users/mozilla/StudioProjects/mozilla-unified/dom/performance/Performance.cpp:781:52: error: no member named 'DynamicString' in namespace 'perfetto'
 6:40.57   781 |     PERFETTO_TRACE_EVENT_BEGIN(category, perfetto::DynamicString{str.get()},
 6:40.58       |                                          ~~~~~~~~~~^
Flags: needinfo?(ctuns)
Status: RESOLVED → REOPENED
Flags: needinfo?(dpalmeiro)
Resolution: FIXED → ---
Target Milestone: 126 Branch → ---

Zac, do you know how I can reproduce this locally? Or which job in CI to trigger to reproduce this? Thanks!

Flags: needinfo?(dpalmeiro) → needinfo?(zmckenney)

Zac mentioned another coworker also experiences this, and they both build obj-aarch64-unknown-linux-android. We have not observed this in CI.

I guess the OS (mac?) just doesn't like that the header filenames are identical with a different case. I think I can just export perfetto.h somewhere else to address it.

I can reproduce this on mac.

Flags: needinfo?(zmckenney)
Pushed by dpalmeiro@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/2ba85887a077
Add perfetto SDK and build with it when gecko profiling is enabled on Android. r=glandium,smaug,dveditz
https://hg.mozilla.org/integration/autoland/rev/52f1b6130a29
Add perfetto event traces for taskcontroller tasks and dom performance measurement markers. r=smaug
https://hg.mozilla.org/integration/autoland/rev/8817b1939109
Add perfetto to about:license. r=sylvestre

Thanks Denis, Sorry I didn't see your comment sooner but sounds like you reproduced then fixed it. Let me know if I can help with anything else.

Status: REOPENED → RESOLVED
Closed: 1 month ago1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 127 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: