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
The whitelisting function thisTestLeaksUncaughtRejectionsAndShouldBeFixed was replaced by expectUncaughtRejection, and existing calls did not take effect anymore.
MozReview-Commit-ID: 3uOxkgWYWEz
--HG--
extra : rebase_source : 6b27b77da78743880529adae7adf4ec2aa64dfea
extra : intermediate-source : 5809a30a0c4817509beb1078cf336d8367b8107a
extra : source : 6f0394b523a66dab444b8551deb8f3c6c81d8f31
Change how comments are handled due to ESLint's 4 reworked comment handling.
MozReview-Commit-ID: BG4cvbhy45Z
--HG--
extra : rebase_source : 8fc4d40bf2a8cb74be7964c9d308c056edf51058
Trivial update to Python package paths to reflect their new location.
MozReview-Commit-ID: EWaIHrLFWgD
--HG--
extra : rebase_source : b3a033bffe6f8f933807d6e71dccd49c37c75844
This patch makes the following changes to the macros.
- Removes PROFILER_LABEL_FUNC. It's only suitable for use in functions outside
classes, due to PROFILER_FUNCTION_NAME not getting class names, and it was
mostly misused.
- Removes PROFILER_FUNCTION_NAME. It's no longer used, and __func__ is
universally available now anyway.
- Combines the first two string literal arguments of PROFILER_LABEL and
PROFILER_LABEL_DYNAMIC into a single argument. There was no good reason for
them to be separate, and it forced a '::' in the label, which isn't always
appropriate. Also, the meaning of the "name_space" argument was interpreted
in an interesting variety of ways.
- Adds an "AUTO_" prefix to PROFILER_LABEL and PROFILER_LABEL_DYNAMIC, to make
it clearer they construct RAII objects rather than just being function calls.
(I myself have screwed up the scoping because of this in the past.)
- Fills in the 'js::ProfileEntry::Category::' qualifier within the macro, so
the caller doesn't need to. This makes a *lot* more of the uses fit onto a
single line.
The patch also makes the following changes to the macro uses (beyond those
required by the changes described above).
- Fixes a bunch of labels that had gotten out of sync with the name of the
class and/or function that encloses them.
- Removes a useless PROFILER_LABEL use within a trivial scope in
EventStateManager::DispatchMouseOrPointerEvent(). It clearly wasn't serving
any useful purpose. It also serves as extra evidence that the AUTO_ prefix is
a good idea.
- Tweaks DecodePool::SyncRunIf{Preferred,Possible} so that the labelling is
done within them, instead of at their callsites, because that's a more
standard way of doing things.
--HG--
extra : rebase_source : 318d1bc6fc1425a94aacbf489dd46e4f83211de4
PROFILER_MARKER is now just a trivial wrapper for profiler_add_marker(). This
patch removes it.
--HG--
extra : rebase_source : 9858f34763bb343757896a91ab7ad8bd8e56b076
This patch reduces the differences between builds where the profiler is enabled
and those where the profiler is disabled. It does this by removing numerous
MOZ_GECKO_PROFILER checks.
These changes have the following consequences.
- Various functions and classes are now defined in all builds, and so can be
used unconditionally: profiler_add_marker(), profiler_set_js_context(),
profiler_clear_js_context(), profiler_get_pseudo_stack(), AutoProfilerLabel.
(They are effectively no-ops in non-profiler builds, of course.)
- The no-op versions of PROFILER_* are now gone. The remaining versions are
almost no-ops when the profiler isn't built.
--HG--
extra : rebase_source : 8fb5e8757600210c2f77865694d25162f0b7698a
This patch gives some structure and order to the profiler's API.
It also renames AutoProfilerRegister as AutoProfilerRegisterThread, to match
profiler_register_thread().
This option causes MOZ_USE_SYSTRACE to be defined. The only use of that is in
GeckoProfiler.h where it causes the PROFILER_PLATFORM_TRACING macro to set
android::ScopedTrace. But android::ScopedTrace was defined in widget/gonk/
which was recently removed, so this won't work any more.
Furthermore, all that android::ScopedTrace did was to do a pair of
atrace_{begin,end}() calls, which doesn't seem that useful.
The rev option is inherently broken. It does let you lint files touched by any
revision, but it doesn't update those files to that revision first. Instead,
they get linted at whatever the working directory is and their results are
bogus. Even if we did some magic to update the files to the proper revision
with in-memory version control magic, the config files would still be out of
date.
Plus, the new --outgoing option does pretty much the only thing --rev was good
for. Rather than cause confusion, I think it's better to just remove the
option.
MozReview-Commit-ID: 2y2UnfIkvsR
--HG--
extra : rebase_source : 9b5c142270c98905d71ebb89d1620e91914c0b47
This was a regression from bug 1288432. The 'extensions' config in mozlint required a
leading period, but eslint requires them without the period (and this got copied over
to the linter definition). The result was mozlint filtering out any files (not dirs)
that were passed in.
This just modifies mozlint to strip out the period so both are acceptable.
MozReview-Commit-ID: CbNynYzrbGz
--HG--
extra : rebase_source : 51c740cb1d2febaee3ae46784f83381cda5e5eaa
tools/fuzzing/libfuzzer/harness/LibFuzzerTestHarness.h:118:10: warning: unused member function 'failed' [-Wunused-member-function]
MozReview-Commit-ID: 7hsvvnnolcl
--HG--
extra : source : f80cd86fd1e116f59b23539292bb6d5dd6afcc7c
extra : intermediate-source : bb240b1bedb9c4503d34370f652b4a5dc9f68628