зеркало из https://github.com/mozilla/gecko-dev.git
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
d5457902e2
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 |
||
---|---|---|
.cargo | ||
accessible | ||
addon-sdk | ||
b2g | ||
browser | ||
build | ||
caps | ||
chrome | ||
config | ||
db/sqlite3 | ||
devtools | ||
docshell | ||
dom | ||
editor | ||
embedding | ||
extensions | ||
gfx | ||
gradle/wrapper | ||
hal | ||
image | ||
intl | ||
ipc | ||
js | ||
layout | ||
media | ||
memory | ||
mfbt | ||
mobile | ||
modules | ||
mozglue | ||
netwerk | ||
nsprpub | ||
other-licenses | ||
parser | ||
probes | ||
python | ||
rdf | ||
security | ||
services | ||
servo | ||
startupcache | ||
storage | ||
taskcluster | ||
testing | ||
third_party/rust | ||
toolkit | ||
tools | ||
uriloader | ||
view | ||
widget | ||
xpcom | ||
xpfe | ||
.clang-format | ||
.clang-format-ignore | ||
.clang-tidy | ||
.cron.yml | ||
.eslintignore | ||
.eslintrc.js | ||
.flake8 | ||
.gdbinit | ||
.gdbinit_python | ||
.gitignore | ||
.hgignore | ||
.hgtags | ||
.lldbinit | ||
.taskcluster.yml | ||
.ycm_extra_conf.py | ||
AUTHORS | ||
Android.mk | ||
CLOBBER | ||
GNUmakefile | ||
LEGAL | ||
LICENSE | ||
Makefile.in | ||
README.txt | ||
aclocal.m4 | ||
build.gradle | ||
client.mk | ||
client.py | ||
configure.in | ||
configure.py | ||
gradle.properties | ||
gradlew | ||
mach | ||
moz.build | ||
moz.configure | ||
mozilla-config.h.in | ||
old-configure.in | ||
settings.gradle | ||
test.mozbuild |
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/