Commit Graph

749 Commits

Author SHA1 Message Date
Gerald Squelart
2ce555aca7 Bug 1465924 - Add profile.threads[i].processName which contains "Main Process", or the content process's name like "WebExtensions" - r=gregtatum
This field is in addition to the existing process type fields we already have:
- profile.threads[i].processType contains the string for the GeckoProcessType.
- profile.threads[i].name contains the ThreadInfo name.

Differential Revision: https://phabricator.services.mozilla.com/D10549

--HG--
extra : moz-landing-system : lando
2018-11-02 21:52:32 +00:00
Nazım Can Altınova
251628f687 Bug 1417976 - Part 3: Stream the DocShell list and DocShellId marker data to profile data r=mstange
MozReview-Commit-ID: G2s5H8i4p6E

Depends on D4915

Differential Revision: https://phabricator.services.mozilla.com/D4916

--HG--
extra : moz-landing-system : lando
2018-11-06 21:46:46 +00:00
Nazım Can Altınova
f967885c60 Bug 1417976 - Part 2: Include DocShell IDs to marker payloads r=mstange
MozReview-Commit-ID: AML1ESUnFlu

Depends on D4914

Differential Revision: https://phabricator.services.mozilla.com/D4915

--HG--
extra : moz-landing-system : lando
2018-11-06 21:45:50 +00:00
Nazım Can Altınova
aaba02d9ee Bug 1417976 - Part 1: Store the information of DocShells in CorePS r=mstange,bzbarsky
Added a mechanism to register and unregister the DocShells from the CorePS depending
on the state of the profiler. Registering mechanism is straightforward. During
unregistration, if profiler is not active, we remove the DocShell information
immediately. If profiler is active, we don't remove and we keep the profiler buffer
position at that moment. During another DocShell registration we Discard the
unregistered DocShells. If the profiler buffer position is greater than the position
when we captured during unregistration, we delete the DocShell since that means there
can't be any markers associated to this DocShell anymore.

MozReview-Commit-ID: IVuKQ6drvkR

Differential Revision: https://phabricator.services.mozilla.com/D4914

--HG--
extra : moz-landing-system : lando
2018-11-06 21:45:07 +00:00
Markus Stange
75c251de85 Bug 1499507 - Add ProfilingStackFrame flags for to choose the string template that is used to combine the label with the dynamic string. r=njn
These flags will be used by WebIDL APIs in an upcoming patch.

Depends on D9199

Differential Revision: https://phabricator.services.mozilla.com/D9203

--HG--
extra : moz-landing-system : lando
2018-11-06 04:33:07 +00:00
Markus Stange
e6c22c99ad Bug 1499507 - Convert the ProfilingStackFrame kind into a set of flags. r=njn
This makes it easier to add more flags.

Depends on D9197

Differential Revision: https://phabricator.services.mozilla.com/D9199

--HG--
extra : moz-landing-system : lando
2018-11-06 04:32:29 +00:00
Markus Stange
974ec0a838 Bug 1499507 - Use AppendPrintf to concatenate the label with the dynamic string. r=njn
This code is run during JSON serialization so performance is not a big concern.

Depends on D9195

Differential Revision: https://phabricator.services.mozilla.com/D9197

--HG--
extra : moz-landing-system : lando
2018-11-06 04:31:45 +00:00
Markus Stange
ab700f9fc0 Bug 1499507 - Don't collect line numbers for profiling stack frames. r=njn
They were not displayed in the UI, and the instructions to initialize the line
field of a stack frame increased code size unnecessarily.

This change reduces the binary size on Linux x64 by around 100KB.

Here's a diff of the impact on the code generated for Attr_Binding::get_specified
in the Mac build:

@@ -20,17 +20,16 @@
    movq       0x8(%rbx), %rax
    movq       %r12, %rcx
    shlq       $0x5, %rcx
    leaq       aGetAttrspecifi, %rdx                       ; "get Attr.specified"
    movq       %rdx, (%rax,%rcx)
    movq       $0x0, 0x8(%rax,%rcx)
    leaq       -40(%rbp), %rdx
    movq       %rdx, 0x10(%rax,%rcx)
-   movl       $0x106, 0x18(%rax,%rcx)
    movl       $0x1c, 0x1c(%rax,%rcx)
    leal       0x1(%r12), %eax
    movl       %eax, 0x10(%rbx)

    movq       %r15, %rdi
    call       __ZNK7mozilla3dom4Attr9SpecifiedEv          ; mozilla::dom::Attr::Specified() const
    movzxl     %al, %eax
    movabsq    $0xfff9000000000000, %rcx

Depends on D9193

Differential Revision: https://phabricator.services.mozilla.com/D9195

--HG--
extra : moz-landing-system : lando
2018-11-06 04:31:02 +00:00
Brindusan Cristian
ab89743379 Backed out 9 changesets (bug 1499507) for build bustages on /profiler/core/platform.cpp. CLOSED TREE
Backed out changeset 4c79a5557d7b (bug 1499507)
Backed out changeset 35d05a53e0a9 (bug 1499507)
Backed out changeset 9254e6c721b3 (bug 1499507)
Backed out changeset cf40b044af3f (bug 1499507)
Backed out changeset 76dd85b9aaf7 (bug 1499507)
Backed out changeset 6256446f16c4 (bug 1499507)
Backed out changeset 41cede6bc7d2 (bug 1499507)
Backed out changeset 30476b824eb4 (bug 1499507)
Backed out changeset 24a9494155fe (bug 1499507)
2018-11-05 23:24:49 +02:00
Markus Stange
30477de777 Bug 1499507 - Add ProfilingStackFrame flags for to choose the string template that is used to combine the label with the dynamic string. r=njn
These flags will be used by WebIDL APIs in an upcoming patch.

Depends on D9199

Differential Revision: https://phabricator.services.mozilla.com/D9203

--HG--
extra : moz-landing-system : lando
2018-11-05 20:56:50 +00:00
Markus Stange
9bed7de565 Bug 1499507 - Convert the ProfilingStackFrame kind into a set of flags. r=njn
This makes it easier to add more flags.

Depends on D9197

Differential Revision: https://phabricator.services.mozilla.com/D9199

--HG--
extra : moz-landing-system : lando
2018-11-05 20:56:17 +00:00
Markus Stange
e8536c78ec Bug 1499507 - Use AppendPrintf to concatenate the label with the dynamic string. r=njn
This code is run during JSON serialization so performance is not a big concern.

Depends on D9195

Differential Revision: https://phabricator.services.mozilla.com/D9197

--HG--
extra : moz-landing-system : lando
2018-11-05 20:55:38 +00:00
Markus Stange
4c59aa793c Bug 1499507 - Don't collect line numbers for profiling stack frames. r=njn
They were not displayed in the UI, and the instructions to initialize the line
field of a stack frame increased code size unnecessarily.

This change reduces the binary size on Linux x64 by around 100KB.

Here's a diff of the impact on the code generated for Attr_Binding::get_specified
in the Mac build:

@@ -20,17 +20,16 @@
    movq       0x8(%rbx), %rax
    movq       %r12, %rcx
    shlq       $0x5, %rcx
    leaq       aGetAttrspecifi, %rdx                       ; "get Attr.specified"
    movq       %rdx, (%rax,%rcx)
    movq       $0x0, 0x8(%rax,%rcx)
    leaq       -40(%rbp), %rdx
    movq       %rdx, 0x10(%rax,%rcx)
-   movl       $0x106, 0x18(%rax,%rcx)
    movl       $0x1c, 0x1c(%rax,%rcx)
    leal       0x1(%r12), %eax
    movl       %eax, 0x10(%rbx)

    movq       %r15, %rdi
    call       __ZNK7mozilla3dom4Attr9SpecifiedEv          ; mozilla::dom::Attr::Specified() const
    movzxl     %al, %eax
    movabsq    $0xfff9000000000000, %rcx

Depends on D9193

Differential Revision: https://phabricator.services.mozilla.com/D9195

--HG--
extra : moz-landing-system : lando
2018-11-05 20:55:10 +00:00
Narcis Beleuzu
2c6edfdde8 Backed out 9 changesets (bug 1499507) for bustages on ProfileBuffer.cpp . CLOSED TREE
Backed out changeset 541186291b88 (bug 1499507)
Backed out changeset 8a3f4acbad3b (bug 1499507)
Backed out changeset f427afc392b0 (bug 1499507)
Backed out changeset 58dc19fb2b76 (bug 1499507)
Backed out changeset 9225e9aea377 (bug 1499507)
Backed out changeset ca23a517da63 (bug 1499507)
Backed out changeset 16d6c90333de (bug 1499507)
Backed out changeset bc134fe1722a (bug 1499507)
Backed out changeset 4a9c9a91182c (bug 1499507)
2018-11-05 21:48:11 +02:00
Markus Stange
eeb95b0846 Bug 1499507 - Add ProfilingStackFrame flags for to choose the string template that is used to combine the label with the dynamic string. r=njn
These flags will be used by WebIDL APIs in an upcoming patch.

Depends on D9199

Differential Revision: https://phabricator.services.mozilla.com/D9203

--HG--
extra : moz-landing-system : lando
2018-11-05 19:10:12 +00:00
Markus Stange
d026ceb9e3 Bug 1499507 - Convert the ProfilingStackFrame kind into a set of flags. r=njn
This makes it easier to add more flags.

Depends on D9197

Differential Revision: https://phabricator.services.mozilla.com/D9199

--HG--
extra : moz-landing-system : lando
2018-11-05 19:09:21 +00:00
Markus Stange
d905cc3e62 Bug 1499507 - Use AppendPrintf to concatenate the label with the dynamic string. r=njn
This code is run during JSON serialization so performance is not a big concern.

Depends on D9195

Differential Revision: https://phabricator.services.mozilla.com/D9197

--HG--
extra : moz-landing-system : lando
2018-11-05 19:08:49 +00:00
Markus Stange
000dc83f31 Bug 1499507 - Don't collect line numbers for profiling stack frames. r=njn
They were not displayed in the UI, and the instructions to initialize the line
field of a stack frame increased code size unnecessarily.

This change reduces the binary size on Linux x64 by around 100KB.

Here's a diff of the impact on the code generated for Attr_Binding::get_specified
in the Mac build:

@@ -20,17 +20,16 @@
    movq       0x8(%rbx), %rax
    movq       %r12, %rcx
    shlq       $0x5, %rcx
    leaq       aGetAttrspecifi, %rdx                       ; "get Attr.specified"
    movq       %rdx, (%rax,%rcx)
    movq       $0x0, 0x8(%rax,%rcx)
    leaq       -40(%rbp), %rdx
    movq       %rdx, 0x10(%rax,%rcx)
-   movl       $0x106, 0x18(%rax,%rcx)
    movl       $0x1c, 0x1c(%rax,%rcx)
    leal       0x1(%r12), %eax
    movl       %eax, 0x10(%rbx)

    movq       %r15, %rdi
    call       __ZNK7mozilla3dom4Attr9SpecifiedEv          ; mozilla::dom::Attr::Specified() const
    movzxl     %al, %eax
    movabsq    $0xfff9000000000000, %rcx

Depends on D9193

Differential Revision: https://phabricator.services.mozilla.com/D9195

--HG--
extra : moz-landing-system : lando
2018-11-05 19:07:45 +00:00
Tom Ritter
055159557a Bug 1502686 - When fuzzyfox is enabled, first put it into an initializing state before telling TimeStamp is it enabled r=baku
This prevents a race condition where the JS Engine would get the Fuzzed Time
before the dispatched job was run, and the time was zero and triggered an assertion.

This patch also includes more verbose logging for additional debugging.
2018-11-02 11:44:14 -05:00
arthur.iakab
f4c1145722 Backed out changeset 582dbb4c3bf5 (bug 1502686)for failing gtests on Contents/Resources/gmp-clearkey "CLOSED TREE" 2018-11-02 22:18:38 +02:00
Tom Ritter
fff8b7bb29 Bug 1502686 - When fuzzyfox is enabled, first put it into an initializing state before telling TimeStamp is it enabled r=baku
This prevents a race condition where the JS Engine would get the Fuzzed Time
before the dispatched job was run, and the time was zero and triggered an assertion.

This patch also includes more verbose logging for additional debugging.
2018-11-02 11:44:14 -05:00
Nazım Can Altınova
b307cbb99b Bug 1349607 - Remove mVsyncTimestamp from the VsyncMarkerPayload r=mstange
Removing this field since we already have start/end time for each marker payloads.
Also we are assigning the same timestamp to them. We don't need to unnecessarily
duplicate the information here.

Differential Revision: https://phabricator.services.mozilla.com/D8551

--HG--
extra : moz-landing-system : lando
2018-11-01 13:56:18 +00:00
Nazım Can Altınova
9bf5cb96b8 Backed out changeset ef82ba4b7f22 (Bug 1476757) r=mstange 2018-10-30 15:14:02 +01:00
Nazım Can Altınova
9832e96686 Backed out changeset 3428510869a9 (Bug 1476757) r=mstange 2018-10-30 15:12:30 +01:00
Noemi Erli
06a8cd8e3c Backed out changeset bee1c344cb47 (bug 1491909) for failures in browser/components/extensions/test/xpcshell/test_ext_geckoProfiler_control.js 2018-10-24 04:23:13 +03:00
Denis Palmeiro
fc930ad16f Bug 1491909 - Add an AllocPolicy to mozilla::JSONWriter r=jwalden,mstange
JSONWriter currently calls new and delete indirectly through mozilla::MakeUnique to allocate a buffer.  Becuase of this, the methods of this class cannot be invoked within Spidermonkey due to https://searchfox.org/mozilla-central/source/config/check_vanilla_allocations.py#6-14.  Therefore, JSONWriter needs an AllocPolicy template parameter so that the allocation and deallocation routines can be changed to match the JS AllocPolicy when invoked within SpiderMonkey.

Differential Revision: https://phabricator.services.mozilla.com/D7279

--HG--
extra : moz-landing-system : lando
2018-10-23 20:46:31 +00:00
Jeff Muizelaar
5d4b15e6ee Bug 1500635. Expose ProfileJSONWriter. r=mstange
This lets ProfilerMarkerPayload implementations live outside of the profiler.

Differential Revision: https://phabricator.services.mozilla.com/D9325

--HG--
rename : tools/profiler/core/ProfileJSONWriter.h => tools/profiler/public/ProfileJSONWriter.h
extra : moz-landing-system : lando
2018-10-23 12:42:32 +00:00
Markus Stange
e112064aa7 Bug 1476757 - Grow and shrink the profiler buffer dynamically so as to not waste memory when a large buffer size limit is picked. r=njn
Depends on D6264

Differential Revision: https://phabricator.services.mozilla.com/D6265

--HG--
extra : moz-landing-system : lando
2018-10-22 15:52:17 +00:00
Markus Stange
b177228e70 Bug 1476757 - Add methods to change the capacity of the ProfileBuffer. r=njn
Depends on D8218

Differential Revision: https://phabricator.services.mozilla.com/D6264

--HG--
extra : moz-landing-system : lando
2018-10-12 13:39:47 +00:00
Nazım Can Altınova
6a39163ecd Bug 1476757 - Change {a,m}EntrySize to {a,m}Capacity in ProfileBuffer r=njn
Differential Revision: https://phabricator.services.mozilla.com/D8218

--HG--
extra : moz-landing-system : lando
2018-10-12 13:39:45 +00:00
Randell Jesup
32c5b96373 Bug 1497985: Allow for MergeStacks() not writing any stacks within a sample r=mstange 2018-10-15 23:16:05 -04:00
Randell Jesup
12d6bb7b1c Bug 1299118: Implement Long Tasks API internals (not DOM access to it) r=froyd,mstange 2018-10-11 13:22:55 -04:00
shindli
0f211616dc Backed out 3 changesets (bug 1299118) for ES lint failures
Backed out changeset 14451eb9a2b8 (bug 1299118)
Backed out changeset e5adc30bdf7f (bug 1299118)
Backed out changeset 8f7bb583fbb5 (bug 1299118)
2018-10-11 20:47:58 +03:00
Randell Jesup
65111c20e6 Bug 1299118: Implement Long Tasks API internals (not DOM access to it) r=froyd,mstange 2018-10-11 13:22:55 -04:00
Randell Jesup
57d12218e3 Bug 1464509: Install/remove memory replacement with counter on profiler start/stop r=mstange 2018-10-09 22:29:21 -04:00
Randell Jesup
2fca240bb3 Bug 1464509: Add memory replacer with counters to the Gecko profiler r=glandium 2018-10-09 22:28:56 -04:00
Randell Jesup
e808977f33 Bug 1464509: Dump profiler counters to the ProfileBuffer and JSON r=mstange
Don't allow DuplicateLastSample to duplicate counters or memory use values
2018-10-09 22:28:26 -04:00
Randell Jesup
708b2160bb Bug 1464509: Add per-process profiler counters r=mstange 2018-10-09 22:28:21 -04:00
Markus Stange
caa66cb247 Bug 1484828 - Don't skip libraries with non-zero offsets. r=jld
I don't understand what's happening in this code and would appreciate some
guidance.  It's possible that there are two different meanings of the word
"offset" that are clashing here.
SharedLibrary::GetOffset() means firstMappingStart - baseAddress.
I get a feeling that the "zero offset" check here cares more about the mapping
offset phdr.p_offset, but I'm not sure.

Anyway, the purpose of this patch is the following:
Now that the previous patch sets SharedLibrary::mOffset to something non-zero,
this check breaks unwinding for the affected libraries. With the check removed,
unwinding seems to work mostly fine, as evidenced by this profile:
https://perfht.ml/2MBKzON

But removing the check might break something else that I'm not seeing.

Depends on D3835

Differential Revision: https://phabricator.services.mozilla.com/D3836

--HG--
extra : moz-landing-system : lando
2018-10-02 23:20:02 +00:00
Markus Stange
bf842f3db8 Bug 1484828 - Rename some fields in EHABIStackWalk.cpp. r=jld
Depends on D3834

Differential Revision: https://phabricator.services.mozilla.com/D3835

--HG--
extra : moz-landing-system : lando
2018-10-03 02:23:09 +00:00
Markus Stange
9dd717b2b6 Bug 1484828 - Set SharedLibrary::mOffset to firstMappingStart - baseAddress. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D3834

--HG--
extra : moz-landing-system : lando
2018-09-21 02:37:37 +00:00
Nathan Froyd
c104528264 Bug 1493282 - improve hashtable usage in profiler buffer entries; r=mstange
We have several APIs that enable us to avoid redundant hash table
lookups; we should be using them here.
2018-09-24 14:41:06 -04:00
Olli Pettay
b05284f24f Bug 1492395 - Make event markers in profiler timeline per event, not per event listener, r=mstange
--HG--
extra : rebase_source : 53b205eabc2f318cdaa91e91bd1bad0c27d8a5dd
2018-09-21 02:03:04 +03:00
Nazım Can Altınova
98bd5a2953 Bug 1475553 - Add type field to all markers that doesn't have before r=gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D5138

--HG--
extra : moz-landing-system : lando
2018-09-17 19:01:03 +00:00
Gerald Squelart
b51e0fd0cc Bug 1489944 - Fixed some std::move warnings - r=froydnj
> dom/media/gmp/CDMStorageIdProvider.cpp(63,10):  warning:
> local variable 'storageId' will be copied despite being returned by name [-Wreturn-std-move]
nsAutoCString -> nsCString, will add std::move().

> layout/painting/DisplayItemClip.cpp(581,10):  warning:
> local variable 'str' will be copied despite being returned by name [-Wreturn-std-move]
nsAutoCString -> nsCString, will add std::move().

> layout/painting/DisplayItemClipChain.cpp(88,10):  warning:
> local variable 'str' will be copied despite being returned by name [-Wreturn-std-move]
nsAutoCString -> nsCString, will add std::move().

> layout/painting/nsDisplayList.cpp(179,10):  warning:
> local variable 'str' will be copied despite being returned by name [-Wreturn-std-move]
nsAutoCString -> nsCString, will add std::move().

> gfx/thebes/gfxWindowsPlatform.cpp(454,10):  warning:
> moving a local object in a return statement prevents copy elision [-Wpessimizing-move]
Will remove std::move().

> gfx/thebes/gfxFontEntry.cpp(245,20):  warning:
> local variable 'name' will be copied despite being returned by name [-Wreturn-std-move]
nsAutoCString -> nsCString, will add std::move().

> netwerk/cookie/nsCookieService.cpp(4460,10):  warning:
> local variable 'path' will be copied despite being returned by name [-Wreturn-std-move]
GetPathFromURI() result is stored in an nsAutoCString, so it might as well return that type.

> toolkit/components/extensions/WebExtensionPolicy.cpp(462,12):  warning:
> local variable 'result' will be copied despite being returned by name [-Wreturn-std-move]
> toolkit/components/extensions/WebExtensionPolicy.cpp(475,10):  warning:
> local variable 'result' will be copied despite being returned by name [-Wreturn-std-move]
`result` may be empty or may be arbitrarily long, so I'll use nsCString inside the function.

> toolkit/xre/CmdLineAndEnvUtils.h(349,10):  warning:
> moving a local object in a return statement prevents copy elision [-Wpessimizing-move]
Returning an UniquePtr, will remove std::move().
Also will `return s` instead of `return nullptr` when `(!s)`, to avoid extra construction which could also prevent elision (not entirely sure, but it's at least not worse!); and it's clearer that the two `return`s return the same already-constructed on-stack object.

> tools/profiler/core/shared-libraries-win32.cc(111,10):  warning:
> local variable 'version' will be copied despite being returned by name [-Wreturn-std-move]
nsPrintfCString -> nsCString, will add std::move().

> xpcom/glue/FileUtils.cpp(179,10):  warning:
> local variable 'fullName' will be copied despite being returned by name [-Wreturn-std-move]
> xpcom/glue/FileUtils.cpp(209,10):  warning:
> local variable 'path' will be copied despite being returned by name [-Wreturn-std-move]
nsAuto{,C}String -> ns{,C}String, will add std::move().

This allowed removals of 'AllowCompilerWarnings' from layout/painting,
netwerk/cookie, and toolkit/components/extensions.

Differential Revision: https://phabricator.services.mozilla.com/D5425

--HG--
extra : moz-landing-system : lando
2018-09-10 15:51:48 +00:00
Nathan Froyd
2788958c91 Bug 1487109 - use a more portable idiom for pausing in SamplerThread::SleepMicro; r=mstange
YieldProcessor() is just _mm_pause in disguise, but it works on more
platforms than the Intel-specific intrinsic.
2018-08-29 17:24:34 -04:00
Nathan Froyd
3fe17471e7 Bug 1486906 - fill in a missing case for aarch64 windows in platform-win32.cpp; r=mstange 2018-08-28 15:58:12 -04:00
Nathan Froyd
ae15c6ad5c Bug 1485716 - part 3 - add aarch64 windows support to the profiler; r=mstange
Frame pointers are enabled in Windows code always, and in our code by
default after the first patch in this series.
2018-08-23 16:48:53 -04:00
Denis Palmeiro
90f5ec05cc bug 785922: Emit column numbers for JS frames and functions in the gecko profiler r=sfink,mstange
Add support for column numbers when profiling JS stack frames and functions.  This will help debug minified scripts when inspecting performance profiles.  The column information will be emitted as a new column property that is part of the frameTable in the profile output, and will also be appended in the descriptive profiler string.

Differential Revision: https://phabricator.services.mozilla.com/D3059

--HG--
extra : moz-landing-system : lando
2018-08-17 19:45:39 +00:00
arthur.iakab
ba75ab7e22 Backed out changeset bb09f2ec0d28 (bug 785922)for causing Android build bustages on profiler/core/platform.cpp CLOSED TREE 2018-08-17 18:22:13 +03:00