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
Go to file
Michael Layzell dd07e2a56b Bug 1357829 - Part 1: Expose profiler_suspend_and_sample_thread, r=njn
This patch performs a refactoring to the internals of the profiler in order to
expose a function, profiler_suspend_and_sample_thread, which can be called from a
background thread to suspend, sample the native stack, and then resume the
target passed-in thread.

The interface was designed to expose as few internals of the profiler as
possible, exposing only a single callback which accepts the list of program
counters and stack pointers collected during the backtrace.

A method `profiler_current_thread_id` was also added to get the thread_id of the
current thread, which can then be passed by another thread into
profiler_suspend_sample_thread to sample the stack of that thread.

This is implemented in two parts:

1) Splitting SamplerThread into two classes: Sampler, and SamplerThread.

Sampler was created to extract the core logic from SamplerThread which manages
unix signals on android and linux, as well as suspends the target thread on all
platforms. SamplerThread was then modified to subclass this type, adding the
extra methods and fields required for the creation and management of the actual
Sampler Thread.

Some work was done to ensure that the methods on Sampler would not require
ActivePS to be present, as we intend to sample threads when the profiler is not
active for the Background Hang Reporter.

2) Moving the Tick() logic into the TickController interface.

A TickController interface was added to platform which has 2 methods: Tick and
Backtrace. The Tick method replaces the previous Tick() static method, allowing
it to be overridden by a different consumer of SuspendAndSampleAndResumeThread,
while the Backtrace() method replaces the previous MergeStacksIntoProfile
method, allowing it to be overridden by different consumers of
DoNativeBacktrace.

This interface object is then used to wrap implementation specific data, such as
the ProfilerBuffer, and is threaded through the SuspendAndSampleAndResumeThread
and DoNativeBacktrace methods.

This change added 2 virtual calls to the SamplerThread's critical section, which
I believe should be a small enough overhead that it will not affect profiling
performance. These virtual calls could be avoided using templating, but I
decided that doing so would be unnecessary.

MozReview-Commit-ID: AT48xb2asgV
2017-05-18 13:56:20 -04:00
.cargo Bug 1277338 - Part 1: Turn js/src into the mozjs-sys crate; r=sfink 2016-10-13 16:12:42 -07:00
.vscode Add some task definitions to run mach from VSCode (bug 1323308). r=gps 2017-05-04 18:03:54 +03:00
accessible Bug 1363027 - keep removing accessible alive during event coalescence, r=davidb 2017-05-12 14:02:15 -04:00
addon-sdk Bug 1355324 - Create a popup to switch between sidebars from the sidebar header;r=Gijs 2017-05-16 10:31:00 -07:00
browser Bug 1365588 - fix l10n repacks for DevEdition on Beta, gecko, DONTBUILD, r=rail 2017-05-17 17:24:01 -07:00
build Merge inbound to central, a=merge 2017-05-17 14:48:30 -07:00
caps Bug 1348362 - Cleanup chrome://global/skin/icons - Remove unused files. r=dao 2017-05-07 19:16:27 +01:00
chrome Bug 780562 - Remove support for the chrome "platform" flag. r=bsmedberg 2017-04-14 20:48:53 +09:00
config Bug 1361458 - Generate the phase tree for GC statistics recording ahead of time r=sfink 2017-05-17 10:37:18 +01:00
db Bug 1352260 - Upgrade to SQLite 3.18.0. r=mak 2017-04-01 15:08:18 -04:00
devtools Bug 1365635 - Fix payload queue and damp regression r=Honza 2017-05-17 23:53:00 +08:00
docshell Merge mozilla-central to mozilla-inbound 2017-05-18 14:59:47 +02:00
dom Bug 1364118 - List JS bytecode cache preferences in all.js. r=mrbkap 2017-05-18 14:12:15 +00:00
editor Merge inbound to m-c a=merge 2017-05-11 17:30:41 -07:00
embedding Bug 1356569 - Remove notifyObservers' last parameter when it is falsy, r=jaws. 2017-04-14 21:51:39 +02:00
extensions Bug 1359490 - add an event loop spinning abstraction function; r=gerald 2017-05-15 09:34:19 -04:00
gfx Bug 1365935 - add Moz2D Factory methods for making an FT_Library. r=jrmuizel 2017-05-18 13:16:06 -04:00
gradle/wrapper
hal Bug 1357323 - Remove the gonk code that was referenced by the build system. r=gps 2017-04-18 17:46:39 +09:00
image Back out changesets from bug 1342567. 2017-05-17 16:17:23 -05:00
intl Bug 1358159 - Handle string terminator for GetLocaleInfoEx. r=jfkthame 2017-05-10 12:42:26 -07:00
ipc Revert "Bug 1363877 - Label IPC shmem messages as SystemGroup (r=dvander)" for valgrind failures 2017-05-17 12:58:35 -07:00
js Bug 1365654 - Fix style bustage r=me 2017-05-18 16:47:53 +01:00
layout Bug 1365831 - Replace assertion that non-display SVG containers are only reflowed with NS_FRAME_IS_DIRTY with a real test of the condition. r=heycam 2017-05-18 09:24:33 -07:00
media Bug 1365090: use target bitrate instead of max for simulcast. r=bwc 2017-05-16 16:15:04 -07:00
memory Backed out changeset 484c5137e19f (bug 1365194) to clean up spidermonkey 2017-05-17 11:44:17 +02:00
mfbt Bug 1331718 - Part 2: Add unit tests for SmallPointerArray. r=froydnj 2017-05-10 05:07:38 +02:00
mobile merge mozilla-inbound to mozilla-central a=merge 2017-05-18 12:05:45 +08:00
modules Bug 1364118 - List JS bytecode cache preferences in all.js. r=mrbkap 2017-05-18 14:12:15 +00:00
mozglue merge mozilla-inbound to mozilla-central a=merge 2017-05-18 14:19:18 +02:00
netwerk Bug 1354405 - Add new telemetry probe for bandwidth cost for rcwn, r=michal, valentin, data-r=bsmedberg 2017-05-02 10:08:06 +08:00
nsprpub Bug 1350291, uplift NSPR_4_15_BETA2, r=franziskus 2017-05-10 17:36:58 +02:00
other-licenses Bug 1361326 - Delay-load DLL's used by the 7-zip self-extractor. r=rstrong 2017-05-05 15:33:18 -07:00
parser Bug 1355441 - Reuse StackNode in TreeBuilder to avoid malloc. r=hsivonen. 2017-05-15 17:18:20 +03:00
probes Bug 1344878 - add BUG_COMPONENT to probes/* files. r=Ms2ger 2017-03-24 09:50:48 -04:00
python Bug 1307301 - Don't attempt to compress compressed files when packing the symbols archive. r=ted 2017-04-27 22:51:19 -07:00
rdf Bug 1330235 - Remove NS_STDCALL_FUNCPROTO and replace its usage with decltype. r=froydnj 2017-05-09 23:00:37 +10:00
security Merge inbound to central, a=merge 2017-05-17 14:48:30 -07:00
services Bug 1357116 - Load the blocklist updater module lazily r=florian,mgoodwin 2017-04-20 10:35:04 +02:00
servo servo: Merge #16814 - Implement Houdini worklets (from asajeffrey:script-worklets); r=jdm 2017-05-17 16:20:42 -05:00
startupcache Bug 1334318 - remove last uses of PR_smprintf; r=froydnj 2017-04-28 10:13:26 -06:00
storage Bug 1363992 - Remove support for system jemalloc. r=njn 2017-05-11 13:03:20 +09:00
taskcluster Bug 1365763 - Make all spidermonkey tasks depend on more file changes. r=sfink 2017-05-17 18:51:12 +09:00
testing Bug 1365588 - fix l10n repacks for DevEdition on Beta, gecko, DONTBUILD, r=rail 2017-05-17 17:24:01 -07:00
third_party Bug 1341102: Revendor rust dependencies. r=me 2017-05-17 16:48:39 +02:00
toolkit Merge mozilla-central to mozilla-inbound 2017-05-18 14:59:47 +02:00
tools Bug 1357829 - Part 1: Expose profiler_suspend_and_sample_thread, r=njn 2017-05-18 13:56:20 -04:00
uriloader Bug 1364050 - Part 5 - Update obsolete references in code comments. r=mak 2017-05-05 13:11:49 +01:00
view Bug 1363000 - re-enable <select> related SVG crashtests. r=heycam 2017-05-12 10:52:16 +08:00
widget Bug 1360321 - 5. Fix warnings in widget; r=snorp 2017-05-17 13:06:23 -04:00
xpcom Revert "Bug 1363877 - Label IPC shmem messages as SystemGroup (r=dvander)" for valgrind failures 2017-05-17 12:58:35 -07:00
xpfe Bug 1359490 - add an event loop spinning abstraction function; r=gerald 2017-05-15 09:34:19 -04: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 1363992 - Remove jemalloc 4. r=njn 2017-05-11 13:23:07 +09: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 1358976 - Stop automatic triggers of nightly builds on mozilla-aurora r=dustin DONTBUILD 2017-05-15 09:55:48 -04:00
.eslintignore Bug 1362421 - Enable eslint on caps/tests/mochitest/browser_checkloaduri.js. r=standard8 2017-05-12 20:06:39 +05:30
.eslintrc.js Backed out changeset e0f9c56c15f0 (bug 1362947) for linting failures, e.g. at accessible/tests/mochitest/jsat/doc_content_text.html:15. r=backout 2017-05-11 10:15:55 +02: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
.gitignore Add some task definitions to run mach from VSCode (bug 1323308). r=gps 2017-05-04 18:03:54 +03:00
.hgignore Add some task definitions to run mach from VSCode (bug 1323308). r=gps 2017-05-04 18:03:54 +03: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
.inferconfig Bug 1357629 - Add httpclientandroidlib to .inferconfig ignore list r=nalexander,njpark 2017-04-18 20:05:25 -07:00
.lldbinit
.taskcluster.yml Bug 591688 - Notify when decision task fails r=dustin,gps 2017-04-12 21:01:46 -07:00
.ycm_extra_conf.py
aclocal.m4 Bug 1363992 - Remove jemalloc 4. r=njn 2017-05-11 13:23:07 +09:00
Android.mk
AUTHORS Bug 1349980 - update task generation to support -g in try syntax for running OS X tasks in generic-worker,r=dustin 2017-04-06 18:50:41 +02: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
CLOBBER Backed out changeset 64c183fa4dd3 (bug 1340627) 2017-05-11 12:51:47 +02:00
configure.in
configure.py Bug 1316140 - Allow use of multiprocessing from config.status on windows. r=mshal 2016-12-21 16:28:28 -08:00
GNUmakefile
gradle.properties
gradlew
LEGAL
LICENSE
mach Bug 1316140 - Allow use of multiprocessing from config.status on windows. r=mshal 2016-12-21 16:28:28 -08:00
Makefile.in Bug 1307301 - Don't attempt to compress compressed files when packing the symbols archive. r=ted 2017-04-27 22:51:19 -07:00
moz.build Bug 1262241 - Move the definition of the js library to a subdirectory. r=mshal 2017-04-04 11:43:14 +09:00
moz.configure Bug 1355584 Make NSIS an optional requirement for MINGW builds r=glandium 2017-04-12 11:21:13 -05:00
mozilla-config.h.in
npm-shrinkwrap.json Backed out changeset e0f9c56c15f0 (bug 1362947) for linting failures, e.g. at accessible/tests/mochitest/jsat/doc_content_text.html:15. r=backout 2017-05-11 10:15:55 +02:00
old-configure.in Bug 1364066 - Re-enable bundled NSS on Solaris. r=glandium 2017-05-11 06:14:57 -07:00
package.json Backed out changeset e0f9c56c15f0 (bug 1362947) for linting failures, e.g. at accessible/tests/mochitest/jsat/doc_content_text.html:15. r=backout 2017-05-11 10:15:55 +02:00
README.txt Bug 1349108 - Update links in README.txt to HTTPS r=RyanVM 2017-03-21 00:11:02 -04: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

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:

    https://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:

    https://developer.mozilla.org/en/docs/Creating_a_patch
    https://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 https://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 -
    https://nightly.mozilla.org/