This works since we added the modules as local references in package.json.
MozReview-Commit-ID: 5e6EkcThJTX
--HG--
extra : rebase_source : 8d432c5fa9620981c20af7a3608f282508c51930
This patch changes ProfileBuffer arguments from pointers to references. For
functions that modify the ProfileBuffer, it also moves the argument to the end.
--HG--
extra : rebase_source : 394dd3effc852447c703c0f5802c092ae96e2eaa
When a sample with a label and a dynamic string is written to the
ProfileBuffer, the profiler currently joins them together (up to a max length
of 512, omitting any that exceed this) and then writes a CodeLocation entry
with an empty string followed by a sequence of EmbeddedString entries. When
parsing those entries, we allow a length up to 8192, but that limit is never
reached due to the prior limit of 512.
This patch makes the following changes.
- Removes the joining at write time. Labels and dynamic strings are now written
separately into the ProfileBuffer. The 512 limit still applies, but just for
dynamic strings; dynamic strings longer than that are replaced with "(too
long)". (Labels also always take up one entry, because they only require a
single pointer, because they are always static strings.) The joining is
now done when the ProfileBuffer is parsed, and the max length for the joined
string is still 512; any strings exceeding 512 at that point are truncated,
rather than omitted. (This also happens to be outside the profier's critical
section.)
- Renames CodeLocation as Label and EmbeddedString as DynamicStringFragment.
This makes the ProfileBuffer entry names better match the names used in
GeckoProfiler.h.
- Moves AddDynamicCodeLocation(), now called addDynamicStringEntry(), into
ProfileBuffer.
- Adds some testing of long and overly-long dynamic strings to the GTest.
--HG--
extra : rebase_source : 38bdf6e84fa19576c9e0291249e84b19dbb421f7
Currently LUL is a member of CorePS, meaning that it is guarded by the PSMutex.
This mutex is grabbed by the main thread at random points during the execution
of the program. This is unfortunate, as initializing LUL can take a long
time (>1s on my local machine), and we definitely don't want to be blocking the
main thread waiting for it.
In addition, in the BHR case, we used to be grabbing LUL when we got our first
hang, while both the PSMutex and the BHR monitor were being held. This meant
that the main thread could make no progress during LUL initializaion, as the BHR
monitor is grabbed by the main thread on every spin of the event loop.
This patch moves that initialization to be behind a completely separate lock,
and makes BHR initialize it on the background thread before acquiring the BHR
lock, meaning that no locks other than the one guarding LUL should be held
during its initialization.
MozReview-Commit-ID: GwNYQaEAqJ1
The eslint task ignores warnings, therefore the vcs hook should as well. The --quiet argument will
be ignored by other linters.
This also makes tools/lint/hooks.py executable which was preventing it from being used on git.
MozReview-Commit-ID: DXbx01shJmX
--HG--
extra : rebase_source : 9c80a069f486c0b6b7b9c970b84d44b964c59a0f
The profiler writes ProfileBuffer entries in a particular order, and then later
has to parse them, mostly in StreamSamplesToJSON(). That function's parsing
code is poorly structured and rather gross, at least partly because no explicit
grammar is identified.
This patch identifies the grammar in a comment, and in the same comment also
includes some examples of the more complicated subsequences. Once written down,
the grammar is obviously suboptimal -- the |Sample| entries serve no useful
purpose, for example -- but I will leave grammar improvements as follow-ups.
The patch also rewrites the parser in a more typical fashion that obviously
matches the grammar. The new parser is slightly more verbose but far easier to
understand.
--HG--
extra : rebase_source : 762c21a68cdc18ff25b5feda3c5dfcf33afa53be
This adds pre-push and pre-commit hooks for both hg and git. All
four possibilities are implemented in the same file.
To enable a pre-push hg hook, add the following to hgrc:
[hooks]
pre-push.lint = python:/path/to/gecko/tools/lint/hooks.py:hg
To enable a pre-commit hg hook, add the following to hgrc:
[hooks]
pretxncommit.lint = python:/path/to/gecko/tools/lint/hooks.py:hg
To enable a pre-push git hook, run the following command:
$ ln -s /path/to/gecko/tools/lint/hooks.py .git/hooks/pre-push
To enable a pre-commit git hook, run the following command:
$ ln -s /path/to/gecko/tools/lint/hooks.py .git/hooks/pre-commit
MozReview-Commit-ID: DUxCKN2fiag
--HG--
extra : rebase_source : 67c97a3fd8adc50d6bb3c488345077065b63de7d
The patch also changes ProfileBuffer::processEmbeddedString() to take the
readAheadPos, instead of recomputing it.
--HG--
extra : rebase_source : 62bacb4c7cc61f43d78ada342af0a813c307b96a
The double variant is always 8 bytes, so the chars variant can be too. As well
as reducing memory usage on 32-bit platforms, this patch makes the code
clearer.
--HG--
extra : rebase_source : 8f3dd0a1e35c18ac812fa5db7c3f6e4626447c4c
- It's common for unions to be named |u|, because this makes it obvious that
it's a union when you access it, which is good. This patch introduces that
for the union in ProfilerBufferEntry. (This required move the union setting in
each constructor from the initializer list to the constructor body.)
- Each union variant had the prefix "mTag". But that's a bad name, because
|mKind| is actually the tag. So this patch removes the "Tag".
- |mTagData| was a poor name for the |const char*| variant, so this patch
renames it |mString|.
- The patch moves |mKind| before |u|, because that's the normal way that tagged
unions are done.
--HG--
extra : rebase_source : 563cbcf6414fa3c45abcdd5eafd99965bb842de5
If marker pointer is null the uses of it will immediately crash, so asserting
non-nullness doesn't add much. And removing the getter makes it more similar to
the other union variants.
--HG--
extra : rebase_source : a1066ef98ac5d2dae5303b465106b844937cfb73
This requires:
- Moving the constructors of ProfilerMarkerPayload and its subclasses into the
.h file so they are visible even when ProfilerMarkerPayload.cpp isn't
compiled.
- Similarly, using a macro to make StreamPayload() a crashing no-op when the
profiler isn't enabled. (It is never called in that case.)
--HG--
extra : rebase_source : 7aad2fdb1bd4e49782024dba6664e8f992771520
No point having all these explicit empty destructors.
Also, we can avoid IOMarkerPayload's constructor by using a UniqueFreePtr.
--HG--
extra : rebase_source : 0a2a5aecb66a2990c9188354c861f67633ed2fee
Currently LUL is a member of CorePS, meaning that it is guarded by the PSMutex.
This mutex is grabbed by the main thread at random points during the execution
of the program. This is unfortunate, as initializing LUL can take a long
time (>1s on my local machine), and we definitely don't want to be blocking the
main thread waiting for it.
In addition, in the BHR case, we used to be grabbing LUL when we got our first
hang, while both the PSMutex and the BHR monitor were being held. This meant
that the main thread could make no progress during LUL initializaion, as the BHR
monitor is grabbed by the main thread on every spin of the event loop.
This patch moves that initialization to be behind a completely separate lock,
and makes BHR initialize it on the background thread before acquiring the BHR
lock, meaning that no locks other than the one guarding LUL should be held
during its initialization.
MozReview-Commit-ID: GwNYQaEAqJ1