Read-only Git mirror of the Mercurial gecko repositories at https://hg.mozilla.org. How to contribute: https://firefox-source-docs.mozilla.org/contributing/contribution_quickref.html
Перейти к файлу
Nicholas Nethercote d5457902e2 Bug 1342306 (part 3) - Properly synchronize the global state in platform*.cpp. r=mstange.
This patch properly synchronizes all the global state in platform*.cpp, which
gets us a long way towards implementing bug 1330184.

- Most of the global state goes in a new class, ProfilerState, with a single
  instance, gPS. All accesses to gPS are protected by gPSMutex. All functions
  that access ProfilerState require a token proving that gPS is locked; this
  makes things much clearer.

  gRegisteredThreadsMutex is removed because it is subsumed by gPSMutex.

- gVerbosity, however, does not go in ProfilerState. It stays separate, and
  gains its own mutex, gVerbosityMutex.

Also, the tracking of the current profiler state is streamlined. Previously it
was tracked via:

- stack_key_initialized, gInitCount, gSampler, gIsProfiling, gIsActive, and
  gIsPaused.

Now it is tracked via:

- gPS, gPS->sActivity, and gPS->mIsPaused.

This means that the Sampler class is no longer necessary, and the patch removes
it.

Other changes of note made by the patch are as follows.

- It removes ThreadInfo::{mMutex,GetMutex}. This mutex was only used in two
  places, and both these are now protected by gPSMutex.

- It tweaks the LOG calls. All the main functions (init(), shutdown(), start(),
  stop()) now do consistent BEGIN/END logging, and a couple of other low-value
  incidental LOG calls have been removed.

- It adds a lot of release assertions requiring that gPS be initialized (e.g.
  profiler_init() has been called but profiler_shutdown() has not).

- It uses alphabetical order for everything involving profiler feature names.

- It removes Platform{Start,Stop}() and SamplerThread::{Start,Stop}Sampler().
  These are no longer necessary now that SamplerThread::sInstance has been
  replaced with ProfilerState::mSamplerThread which allows more direct access
  to the current SamplerThread instance.

- It removes PseudoStack::mPrivacyMode. This was derived from the "privacy"
  feature, and we now use gPS->mFeaturePrivacy directly, which is simpler.
  It also replaces profiler_in_privacy_mode() with
  profiler_is_active_and_not_in_privacy_mode(), which avoids an unnecessary
  lock/unlock of gPSMutex on a moderately hot path.

Finally, the new code does more locking than the old one. A number of operation
The following operations now lock a mutex when they previously didn't; the
following are ones that are significant, according to some ad hoc profiling.

- profiler_tracing()
- profiler_is_active()
- profiler_is_active_and_not_in_privacy_mode()
- profiler_add_marker()
- profiler_feature_active()
- SamplerThread::Run() [when the profiler is paused]

All up this roughly doubles the amount of mutex locking done by the profiler.
It's probably possible to avoid this increase by allowing careful unlocked
access to three of the fields in ProfilerState (mActivityGeneration,
mFeaturePrivacy, mStartTime), but this should only be done as a follow-up if
the extra locking is found to be a problem.

--HG--
extra : rebase_source : c2e41231f131b3e9ccd23ddf43626b54ccc77b7b
2017-03-08 12:40:39 +11:00
.cargo Bug 1277338 - Part 1: Turn js/src into the mozjs-sys crate; r=sfink 2016-10-13 16:12:42 -07:00
accessible Bug 1331434 - Part 4: Return early after throwing in AccessibleNode::Get, r=surkov 2017-03-07 19:06:48 -05:00
addon-sdk Bug 774744 - Clarify the parameter name or role of the value in some NOT_NONNULL_OBJECT error. r=jwalden 2017-03-07 19:54:23 +09:00
b2g Bug 1344711 - hand cleanup of remaining useless try blocks around get*Pref calls identified by eslint, r=jaws. 2017-03-07 15:29:48 +01:00
browser Merge m-c to inbound, a=merge 2017-03-07 16:45:07 -08:00
build Merge m-c to inbound, a=merge 2017-03-07 16:45:07 -08:00
caps merge mozilla-inbound to mozilla-central a=merge 2017-03-07 15:13:31 +01:00
chrome merge mozilla-inbound to mozilla-central a=merge 2017-02-03 13:25:24 +01:00
config Update configs. IGNORE BROKEN CHANGESETS CLOSED TREE NO BUG a=release ba=release 2017-03-06 23:53:55 +01:00
db/sqlite3 Bug 1340028 - Remove the CLANG_VERSION macro from the in-tree SQLite. r=mak 2017-02-16 09:46:41 -05:00
devtools Merge inbound to central, a=merge 2017-03-07 16:40:44 -08:00
docshell merge mozilla-inbound to mozilla-central a=merge 2017-03-07 15:13:31 +01:00
dom Bug 1331434 - Part 9: Return after ErrorResult::Throw in /dom, r=ehsan 2017-03-07 19:06:48 -05:00
editor Bug 1317322 - Part 1: Activate `paste` in menus when within <textarea> controls, r=ehsan 2017-03-06 14:37:39 -05:00
embedding Bug 1332392 - embedding/* should have BUG_COMPONENTS specified in moz.build files. r=ted 2017-02-06 09:45:58 -05:00
extensions Bug 1340486 - Remove duplication of code at nsHttpNegotiate/NTLMAuth::TestPref and MatchesBaseURI r=mayhemer 2017-02-27 17:57:59 +01:00
gfx Bug 1254776 - VRDisplay.requestPresent must succeed only when called from a user-gesture or trusted event,r=qdot 2017-03-07 16:04:12 -08:00
gradle/wrapper Bug 1300094 - Update Gradle to 2.14.1 and Gradle Plugin to 2.1.3 r=sebastian 2016-09-22 14:31:01 -07:00
hal Bug 1060419 - make log_print use Printf.h, r=froydnj 2016-12-15 20:16:31 -07:00
image Backed out changeset 588c44c7a966 (bug 1058040) 2017-03-02 11:24:33 +08:00
intl Bug 1344596 - Allow OSPreferences API without ENABLE_INTL_API. r=gandalf 2017-03-06 11:03:46 +09:00
ipc Backed out changeset 2288120b007e (bug 1345111) for Windows build failures a=backout 2017-03-07 17:28:01 -08:00
js Backed out changeset efec0bd16f22 (bug 1345261) for failures in test_discardSystemSource.xul 2017-03-07 19:03:00 -08:00
layout Merge inbound to central, a=merge 2017-03-07 16:40:44 -08:00
media Merge m-c to inbound, a=merge 2017-03-07 16:45:07 -08:00
memory Backed out changeset 24bea8bde57d (bug 1343432) for build bustage 2017-03-02 11:23:28 +08:00
mfbt Bug 1331434 - Part 2: Add MOZ_MAY_CALL_AFTER_MUST_RETURN and MOZ_MUST_RETURN_FROM_CALLER annotations, r=ehsan 2017-03-07 19:06:48 -05:00
mobile Backed out 2 changesets (bug 1343613) for Android crashes in nsWindow::GeckoViewSupport::EnableEventDispatcher] 2017-03-07 18:56:35 -08:00
modules Bug 1254776 - VRDisplay.requestPresent must succeed only when called from a user-gesture or trusted event,r=qdot 2017-03-07 16:04:12 -08:00
mozglue Bug 1344827: Only disable critical section debug info on beta and release; r=fitzgen 2017-03-06 12:11:45 -07:00
netwerk Bug 1345240 - Trigger Reads After FlushWrite with no new writable streams in h2 r=hurley 2017-03-07 15:56:41 -05:00
nsprpub Bug 1331810: enable sending of 0 size UDP packets in NSPR. r=ted 2017-01-18 11:50:12 -08:00
other-licenses Bug 1324617 - Allow any of multiple installations to be set as the Windows default browser; r=jimm,rstrong 2017-01-09 08:14:00 -08:00
parser Bug 1342144 - Remove version parameter from the type attribute of script elements. r=jmaher 2017-02-23 06:10:07 +09:00
probes Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00
python Bug 1314678 - Use hfs and dmg tools rather than mozinstall to unpack downloaded builds during cross artifact builds. r=mshal 2017-03-07 10:21:34 -08:00
rdf Bug 1344876 - add BUG_COMPONENT to rdf/* files. r=pike 2017-03-07 13:06:54 -05:00
security Merge inbound to central, a=merge 2017-03-07 16:40:44 -08:00
services merge autoland to mozilla-central a=merge 2017-03-07 15:04:48 +01:00
servo servo: Merge #15855 - s/IframeLoadEventSteps/IFrameLoadEventSteps/g (from ferjm:IframeLoadEventSteps); r=Ms2ger 2017-03-07 09:38:44 -08:00
startupcache Bug 1341794 - annotate startupcache/* moz.build file with BUG_COMPONENT. r=froydnj 2017-02-23 08:01:45 -05:00
storage Bug 1342441 - Improve the Wrong Sqlite Version message. r=asuth 2017-02-24 17:39:30 +01:00
taskcluster Merge m-c to inbound, a=merge 2017-03-07 16:45:07 -08:00
testing Merge m-c to inbound, a=merge 2017-03-07 16:45:07 -08:00
third_party/rust Merge m-c to graphics 2017-03-01 09:45:49 -05:00
toolkit Merge m-c to inbound, a=merge 2017-03-07 16:45:07 -08:00
tools Bug 1342306 (part 3) - Properly synchronize the global state in platform*.cpp. r=mstange. 2017-03-08 12:40:39 +11:00
uriloader Bug 1344711 - script-generated patch to remove try blocks around get*Pref calls, r=jaws. 2017-03-07 15:29:48 +01:00
view Bug 1302071 - Part 5: Bucket PresContext invalidations by transaction ID, and only deliver them when the associated composite has completed. r=tnikkel 2017-02-17 15:16:15 +13:00
widget Backed out 2 changesets (bug 1343613) for Android crashes in nsWindow::GeckoViewSupport::EnableEventDispatcher] 2017-03-07 18:56:35 -08:00
xpcom Bug 1331434 - Part 2: Add MOZ_MAY_CALL_AFTER_MUST_RETURN and MOZ_MUST_RETURN_FROM_CALLER annotations, r=ehsan 2017-03-07 19:06:48 -05:00
xpfe Bug 1341801 - xpfe/test/* files do not seem to be references anywhere. r=enndeakin 2017-03-01 08:20:25 -05:00
.clang-format Bug 1322321 - Update the clang format file to match more our coding style r=ehsan 2016-12-06 17:43:17 -10:00
.clang-format-ignore Bug 1343068 - Add the JNI generate files in the list of ignored elements r=mystor 2017-02-27 23:27:53 +01:00
.clang-tidy Bug 1319396 - Update the list of checkers in the .clang-tidy file r=Ehsan 2016-11-22 12:30:19 +01:00
.cron.yml Bug 1338385 - Add cron job for nightly coverage tests run; r=jmaher 2017-02-08 11:16:25 -08:00
.eslintignore Bug 1344027 - Fix most of the remaining ESLint no-undef issues in browser/components. r=jaws 2017-03-03 09:29:14 +00:00
.eslintrc.js Bug 1344711 - Add an eslint rule to report an error when a get*Pref call is the only instruction in a try block, r=jaws. 2017-03-07 15:29:47 +01:00
.flake8 Bug 1321956 - Disable flake8 check for 'visually indented line with same indent as next logical line', r=ahal 2016-12-08 09:53:21 -10:00
.gdbinit Bug 1317802 - don't stop for SIGSYS in .gdbinit; r=jld 2016-11-16 01:13:22 -05:00
.gdbinit_python bug 985566 - add some pretty printers to .gdbinit r=froydnj r=glandium 2016-06-02 13:33:07 -04:00
.gitignore Bug 1301790 - Bundle codemirror into a single script;r=gl 2016-09-11 09:38:51 -07:00
.hgignore Bug 1332691: Add script to regenerate tests, update the WPT manifest and expectations; r=luke 2017-02-17 20:13:54 +01:00
.hgtags No bug - Tagging mozilla-central 6583496f169cd8a13c531ed16e98e8bf313eda8e with FIREFOX_AURORA_54_BASE a=release DONTBUILD CLOSED TREE 2017-03-06 23:43:32 +01:00
.lldbinit Bug 1254128 - Make the Mozilla .lldbinit use the full path for topsrcdir. r=sparky 2016-03-01 16:36:08 +00:00
.taskcluster.yml Bug 1334810: temporarily revert {{owner}}; r=garndt 2017-02-07 16:18:19 +00:00
.ycm_extra_conf.py Bug 1293534: Fix .ycm_extra_conf after bug 1195748. r=gps 2016-08-09 10:30:58 -07:00
AUTHORS Bug 1302763 - Move docker images out of testing/docker into taskcluster/docker; r=dustin r=CuriousLearner 2016-10-20 18:25:34 +05:30
Android.mk
CLOBBER Update configs. IGNORE BROKEN CHANGESETS CLOSED TREE NO BUG a=release ba=release 2017-03-06 23:53:55 +01:00
GNUmakefile
LEGAL
LICENSE
Makefile.in Bug 1339182 - Remove OSX universal support in the build system; r=glandium 2017-02-10 16:52:17 -05:00
README.txt
aclocal.m4 Bug 1262155 - Use moz.build instead of libffi's build system. r=ted,glandium 2016-08-08 16:58:54 -07:00
build.gradle Bug 1318823 - Use com.getkeepsafe.dexcount in Gradle builds. r=sebastian 2016-11-18 18:28:58 -08:00
client.mk Bug 1317778 - Emit a depfile with python configure dependencies so Make will know when to re-run configure. r=glandium 2016-12-02 10:05:57 -08:00
client.py
configure.in Bug 1295751 - Make it possible to copy configure.in to configure. r=gps 2016-08-16 19:35:00 -07:00
configure.py Bug 1316140 - Allow use of multiprocessing from config.status on windows. r=mshal 2016-12-21 16:28:28 -08:00
gradle.properties
gradlew
mach Bug 1316140 - Allow use of multiprocessing from config.status on windows. r=mshal 2016-12-21 16:28:28 -08:00
moz.build Bug 1335873 - Add marionette-harness python tests to root moz.build file, r=mshal 2017-03-01 11:52:51 -05:00
moz.configure Bug 1339673 - Add an option to disable building the gtest xul and set it for valgrind builds in automation. r=ted 2017-02-16 10:47:55 -08:00
mozilla-config.h.in Bug 1231314 - Turn mozilla-config.h and js-confdefs.h into CONFIGURE_DEFINE_FILES. r=gps 2015-12-15 08:06:11 +09:00
old-configure.in Bug 1314678 - Don't perform clang plugin checks in artifact builds. r=mshal 2017-03-07 10:21:33 -08:00
settings.gradle Bug 1291363 - Add geckoview and geckoview_example Gradle projects. r=jchen,sebastian 2016-10-05 20:23:38 -07:00
test.mozbuild Bug 1229233 - Add a (incomplete) end-to-end build test. r=gps 2015-12-01 13:57:52 +09:00

README.txt

An explanation of the Mozilla Source Code Directory Structure and links to
project pages with documentation can be found at:

    https://developer.mozilla.org/en/Mozilla_Source_Code_Directory_Structure

For information on how to build Mozilla from the source code, see:

    http://developer.mozilla.org/en/docs/Build_Documentation

To have your bug fix / feature added to Mozilla, you should create a patch and
submit it to Bugzilla (https://bugzilla.mozilla.org). Instructions are at:

    http://developer.mozilla.org/en/docs/Creating_a_patch
    http://developer.mozilla.org/en/docs/Getting_your_patch_in_the_tree

If you have a question about developing Mozilla, and can't find the solution
on http://developer.mozilla.org, you can try asking your question in a
mozilla.* Usenet group, or on IRC at irc.mozilla.org. [The Mozilla news groups
are accessible on Google Groups, or news.mozilla.org with a NNTP reader.]

You can download nightly development builds from the Mozilla FTP server.
Keep in mind that nightly builds, which are used by Mozilla developers for
testing, may be buggy. Firefox nightlies, for example, can be found at:

    https://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central/
            - or -
    http://nightly.mozilla.org/