Commit Graph

22 Commits

Author SHA1 Message Date
Markus Stange
13cdaa1908 Bug 1329111 - Supply SharedLibraryInfo with the absolute module path and debug path on all platforms. r=marco
MozReview-Commit-ID: 9R3ecPxGoMr

--HG--
extra : rebase_source : 3cc2af0e5c2b40f349f9e77e06731188d9af07ea
2017-03-14 18:26:50 -04:00
Dan Minor
52f0cc6d8b Bug 1343557 - Make PfxInstr::operator== const; r=jseward
MozReview-Commit-ID: 5WpBNHbqz0q

--HG--
extra : rebase_source : 04a53887c9542cdafbb5d837090a62dd56a1333d
2017-03-01 15:26:29 -05:00
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
Nicholas Nethercote
4b44b699f4 Bug 1339695 (part 10) - Rename SPS_* macros as GP_*. r=jseward.
This removes the final mentions of the old "SPS" name.

--HG--
extra : rebase_source : 1bb36686d21ff8376326d35416b497f58e03fcde
2017-02-18 00:57:03 +11:00
Marco Castelluccio
3aec408e65 Bug 1330833 - Add the new "modules" (DLLs) ping type. r=Dexter,mstange,jorendorff, data-review=bsmedberg 2017-02-18 14:17:30 +00:00
Wes Kocher
4fb32a5a83 Backed out 2 changesets (bug 1330833) for windows 64 xpcshell failures a=backout
Backed out changeset 466565fa382a (bug 1330833)
Backed out changeset 927194e7769d (bug 1330833)

MozReview-Commit-ID: GB4KsH29xYC
2017-02-16 17:20:54 -08:00
Marco Castelluccio
fb547d31c7 Bug 1330833 - Add the new "modules" (DLLs) ping type. r=Dexter,mstange,jorendorff, data-review=bsmedberg 2017-02-16 17:09:32 +00:00
Nicholas Nethercote
0b2102e7db Bug 1339695 (part 3) - Introduce USE_FAULTY_LIB. r=jseward.
This factors out some common preprocessor conditions.

--HG--
extra : rebase_source : 444ce4fbccdeb130c604ed12e36ea9c6496a3c85
2017-02-15 16:24:35 +11:00
Nicholas Nethercote
8eb85b796e Bug 1339695 (part 1) - Remove LUL_{ARCH,OS,PLAT}_* macros. r=jseward.
They duplicate the equivalent SPS_* macros. (The SPS_* macros have already
crept into use in some places within LUL.)

--HG--
extra : rebase_source : 65ed6e6e147189814511b0ca38342fec118478b9
2017-02-15 16:13:01 +11:00
Nicholas Nethercote
74eeaa5980 Bug 1339327 (part 4) - Rename some globals in the profiler. r=mstange.
The 'g' prefix is for global variables. The 's' prefix is for static class
members.
2017-02-15 14:26:23 +11:00
Nicholas Nethercote
d6624d0e50 Bug 816598 - Add a memory reporter for the Gecko Profiler. r=mstange,jseward.
It's fairly straightforward, and measures the important parts of:

- Sampler, PseudoStack, ProfileBuffer, ThreadInfo.

- LUL, PriMap, SecMap

Coverage isn't perfect, but it gets the major things I found via DMD on Linux.

Example output in about:memory:

├──151.21 MB (49.73%) -- profiler
│  ├──141.49 MB (46.53%) ── lul
│  └────9.72 MB (03.20%) ── sampler

--HG--
extra : rebase_source : 67d2ada42aead43f68f5100a08204a1d1f1cfceb
2017-01-30 12:37:26 +11:00
Julian Seward
eed29460b1 Bug 1245477 - Crashes in lul::DerefTUW. r=nfroyd.
--HG--
extra : rebase_source : 647ea253f987720f3a641f382426de3d8ad1d1d4
2017-02-06 09:03:38 +01:00
Nicholas Nethercote
cb7d796cb1 Bug 1333296 (part 3) - Remove SPS mentions in tools/profiler. r=mstange.
--HG--
extra : rebase_source : d4ee3eccbffc86ea902be2b80a159fb84445c027
2017-01-24 14:18:50 +11:00
Tom Schuster
774a8bf34d Bug 1302163 - Change code to use SprintfLiteral instead of snprintf. r=ehsan 2016-10-04 17:57:51 +02:00
Igor
175543fda8 Bug 1293384 - Part 2: Rename Snprintf.h header to Sprintf.h. r=froydnj 2016-08-14 23:43:21 -07:00
Igor
a57972337d Bug 1293384 - Part 1: Rename snprintf_literal to SprintfLiteral. r=froydnj 2016-08-14 23:44:00 -07:00
Nicholas Nethercote
ec89bbf7f2 Bug 1237151 (part 3) - Remove ignored qualifiers in all remaining code. r=froydnj. 2016-01-05 17:08:45 -08:00
Bogdan Postelnicu
e98cb50956 Bug 1228339 - Initialize members in class. r=jseward 2015-12-02 02:50:00 +01:00
Nigel Babu
cda29316d8 Backed out changeset 0d6721e243d3 (bug 1228339) for build bustage
CLOSED TREE

--HG--
extra : amend_source : 68000631ca959f6ac64d1ed9d01fe091f933370a
2015-12-02 14:09:40 +05:30
Bogdan Postelnicu
b33bbc96f1 Bug 1228339 - initialize memebers in class. r=jseward
--HG--
extra : rebase_source : e66d5752d36299c357a8ca1fdb737ef010fc67ba
2015-11-26 07:03:00 +01:00
Ehsan Akhgari
08955238cb Bug 1189465 - Make LULStats constructor explicit; r=BenWa 2015-07-30 20:31:08 -04:00
Benoit Girard
daba448963 Bug 1178892 - Split the profiler into Core & Gecko files and break apart monolithic headers. r=mstange
--HG--
rename : tools/profiler/EHABIStackWalk.cpp => tools/profiler/core/EHABIStackWalk.cpp
rename : tools/profiler/EHABIStackWalk.h => tools/profiler/core/EHABIStackWalk.h
rename : tools/profiler/TableTicker.cpp => tools/profiler/core/GeckoSampler.cpp
rename : tools/profiler/TableTicker.h => tools/profiler/core/GeckoSampler.h
rename : tools/profiler/IntelPowerGadget.cpp => tools/profiler/core/IntelPowerGadget.cpp
rename : tools/profiler/IntelPowerGadget.h => tools/profiler/core/IntelPowerGadget.h
rename : tools/profiler/PlatformMacros.h => tools/profiler/core/PlatformMacros.h
rename : tools/profiler/ProfileEntry.cpp => tools/profiler/core/ProfileEntry.cpp
rename : tools/profiler/ProfileEntry.h => tools/profiler/core/ProfileEntry.h
rename : tools/profiler/ProfileJSONWriter.cpp => tools/profiler/core/ProfileJSONWriter.cpp
rename : tools/profiler/ProfileJSONWriter.h => tools/profiler/core/ProfileJSONWriter.h
rename : tools/profiler/ProfilerBacktrace.cpp => tools/profiler/core/ProfilerBacktrace.cpp
rename : tools/profiler/ProfilerMarkers.cpp => tools/profiler/core/ProfilerMarkers.cpp
rename : tools/profiler/SyncProfile.cpp => tools/profiler/core/SyncProfile.cpp
rename : tools/profiler/SyncProfile.h => tools/profiler/core/SyncProfile.h
rename : tools/profiler/platform-linux.cc => tools/profiler/core/platform-linux.cc
rename : tools/profiler/platform-macos.cc => tools/profiler/core/platform-macos.cc
rename : tools/profiler/platform-win32.cc => tools/profiler/core/platform-win32.cc
rename : tools/profiler/platform.cpp => tools/profiler/core/platform.cpp
rename : tools/profiler/platform.h => tools/profiler/core/platform.h
rename : tools/profiler/shared-libraries-linux.cc => tools/profiler/core/shared-libraries-linux.cc
rename : tools/profiler/shared-libraries-macos.cc => tools/profiler/core/shared-libraries-macos.cc
rename : tools/profiler/shared-libraries-win32.cc => tools/profiler/core/shared-libraries-win32.cc
rename : tools/profiler/shim_mac_dump_syms.h => tools/profiler/core/shim_mac_dump_syms.h
rename : tools/profiler/shim_mac_dump_syms.mm => tools/profiler/core/shim_mac_dump_syms.mm
rename : tools/profiler/v8-support.h => tools/profiler/core/v8-support.h
rename : tools/profiler/ProfileGatherer.cpp => tools/profiler/gecko/ProfileGatherer.cpp
rename : tools/profiler/Profiler.jsm => tools/profiler/gecko/Profiler.jsm
rename : tools/profiler/ProfilerIOInterposeObserver.cpp => tools/profiler/gecko/ProfilerIOInterposeObserver.cpp
rename : tools/profiler/ProfilerIOInterposeObserver.h => tools/profiler/gecko/ProfilerIOInterposeObserver.h
rename : tools/profiler/SaveProfileTask.cpp => tools/profiler/gecko/SaveProfileTask.cpp
rename : tools/profiler/SaveProfileTask.h => tools/profiler/gecko/SaveProfileTask.h
rename : tools/profiler/ThreadResponsiveness.cpp => tools/profiler/gecko/ThreadResponsiveness.cpp
rename : tools/profiler/ThreadResponsiveness.h => tools/profiler/gecko/ThreadResponsiveness.h
rename : tools/profiler/local_debug_info_symbolizer.cc => tools/profiler/gecko/local_debug_info_symbolizer.cc
rename : tools/profiler/local_debug_info_symbolizer.h => tools/profiler/gecko/local_debug_info_symbolizer.h
rename : tools/profiler/nsIProfileSaveEvent.idl => tools/profiler/gecko/nsIProfileSaveEvent.idl
rename : tools/profiler/nsIProfiler.idl => tools/profiler/gecko/nsIProfiler.idl
rename : tools/profiler/nsProfiler.cpp => tools/profiler/gecko/nsProfiler.cpp
rename : tools/profiler/nsProfiler.h => tools/profiler/gecko/nsProfiler.h
rename : tools/profiler/nsProfilerCIID.h => tools/profiler/gecko/nsProfilerCIID.h
rename : tools/profiler/nsProfilerFactory.cpp => tools/profiler/gecko/nsProfilerFactory.cpp
rename : tools/profiler/nsProfilerStartParams.cpp => tools/profiler/gecko/nsProfilerStartParams.cpp
rename : tools/profiler/nsProfilerStartParams.h => tools/profiler/gecko/nsProfilerStartParams.h
rename : tools/profiler/AutoObjectMapper.cpp => tools/profiler/lul/AutoObjectMapper.cpp
rename : tools/profiler/AutoObjectMapper.h => tools/profiler/lul/AutoObjectMapper.h
rename : tools/profiler/LulCommon.cpp => tools/profiler/lul/LulCommon.cpp
rename : tools/profiler/LulCommonExt.h => tools/profiler/lul/LulCommonExt.h
rename : tools/profiler/LulDwarf.cpp => tools/profiler/lul/LulDwarf.cpp
rename : tools/profiler/LulDwarfExt.h => tools/profiler/lul/LulDwarfExt.h
rename : tools/profiler/LulDwarfInt.h => tools/profiler/lul/LulDwarfInt.h
rename : tools/profiler/LulDwarfSummariser.cpp => tools/profiler/lul/LulDwarfSummariser.cpp
rename : tools/profiler/LulDwarfSummariser.h => tools/profiler/lul/LulDwarfSummariser.h
rename : tools/profiler/LulElf.cpp => tools/profiler/lul/LulElf.cpp
rename : tools/profiler/LulElfExt.h => tools/profiler/lul/LulElfExt.h
rename : tools/profiler/LulElfInt.h => tools/profiler/lul/LulElfInt.h
rename : tools/profiler/LulMain.cpp => tools/profiler/lul/LulMain.cpp
rename : tools/profiler/LulMain.h => tools/profiler/lul/LulMain.h
rename : tools/profiler/LulMainInt.h => tools/profiler/lul/LulMainInt.h
rename : tools/profiler/LulPlatformMacros.h => tools/profiler/lul/LulPlatformMacros.h
rename : tools/profiler/platform-linux-lul.cpp => tools/profiler/lul/platform-linux-lul.cpp
rename : tools/profiler/platform-linux-lul.h => tools/profiler/lul/platform-linux-lul.h
rename : tools/profiler/GeckoProfiler.h => tools/profiler/public/GeckoProfiler.h
rename : tools/profiler/GeckoProfilerFunc.h => tools/profiler/public/GeckoProfilerFunc.h
rename : tools/profiler/GeckoProfilerImpl.h => tools/profiler/public/GeckoProfilerImpl.h
rename : tools/profiler/ProfileGatherer.h => tools/profiler/public/ProfileGatherer.h
rename : tools/profiler/ProfilerBacktrace.h => tools/profiler/public/ProfilerBacktrace.h
rename : tools/profiler/ProfilerMarkers.h => tools/profiler/public/ProfilerMarkers.h
rename : tools/profiler/PseudoStack.h => tools/profiler/public/PseudoStack.h
rename : tools/profiler/shared-libraries.h => tools/profiler/public/shared-libraries.h
rename : tools/profiler/GeckoTaskTracer.cpp => tools/profiler/tasktracer/GeckoTaskTracer.cpp
rename : tools/profiler/GeckoTaskTracer.h => tools/profiler/tasktracer/GeckoTaskTracer.h
rename : tools/profiler/GeckoTaskTracerImpl.h => tools/profiler/tasktracer/GeckoTaskTracerImpl.h
rename : tools/profiler/SourceEventTypeMap.h => tools/profiler/tasktracer/SourceEventTypeMap.h
rename : tools/profiler/TracedTaskCommon.cpp => tools/profiler/tasktracer/TracedTaskCommon.cpp
rename : tools/profiler/TracedTaskCommon.h => tools/profiler/tasktracer/TracedTaskCommon.h
extra : commitid : EGgqHIgsN6z
2015-06-30 15:03:45 -04:00