Граф коммитов

1050 Коммитов

Автор SHA1 Сообщение Дата
Nicholas Nethercote 33da826017 Bug 1340928 (part 15) - Inline and remove ToJSObject(). r=mstange.
It has a single call site.

--HG--
extra : rebase_source : ac17c229cffc6a25014c6060f99892ecbdda74cf
2017-02-22 13:42:14 +11:00
Nicholas Nethercote 354d0d388f Bug 1340928 (part 14) - Factor out code repeated in both ProfileGatherer::Start() methods. r=mstange.
--HG--
extra : rebase_source : 47deafe39aa208654398cb0795831bd273aa3265
2017-02-22 11:46:28 +11:00
Nicholas Nethercote aedaf0a73c Bug 1340928 (part 13) - Merge two ProfileGatherer::Start() variants. r=mstange.
The |nsIFile*| one is only called by the |const nsACString&| one, so this patch
combines them.

--HG--
extra : rebase_source : d8338e88cef4799d95e590c056ab343d5a1c546a
2017-02-22 11:35:43 +11:00
Nicholas Nethercote 348841f745 Bug 1340928 (part 12) - Remove profiler_get_gatherer(). r=mstange.
profiler_get_gatherer() exposes ProfileGatherer to the outside world in a way
that makes future changes difficult.

This patch:

- Removes ProfileGatherer.h from the list of headers exported from the
  profiler.

- Removes nsIProfiler.profileGatherer and nsProfiler::GetProfileGatherer().

- Replaces profiler_get_gatherer() with three new functions that provide
  minimal but sufficient access to ProfileGatherer:
  profiler_will_gather_OOP_profile(), profiler_gathered_OOP_profile(), and
  profiler_OOP_exit_profile().

  These functions provide access to the ProfileGatherer in a similar fashion to
  the pre-existing functions profiler_get_profile_jsobject_async() and
  profiler_save_profile_to_file_async()

This significantly reduces the size of the profiler's API surface.

--HG--
rename : tools/profiler/public/ProfileGatherer.h => tools/profiler/gecko/ProfileGatherer.h
extra : rebase_source : d8e06a1133d4098c3a214858d3ff2c4bdcd9f1f2
2017-02-22 10:19:53 +11:00
Nicholas Nethercote 883fc3f925 Bug 1340928 (part 9) - Remove MOZ_PROFILER_STACK_SCAN env var. r=mstange.
It's used to set gUnwindStackScan, which is never used.

--HG--
extra : rebase_source : 3993df4cba27eb7eec39a40125df9a3190fe25a6
2017-02-21 13:53:19 +11:00
Nicholas Nethercote d60b476a02 Bug 1340928 (part 8) - Pass gStartTime to DuplicateLastSample(). r=mstange.
This removes the one use of gStartTime outside of platform*.cpp, which lets us
restrict its visibility to just that compilation unit.

--HG--
extra : rebase_source : bf7207572cba5c1a31b544ea73e783ecd559978a
2017-02-21 10:18:51 +11:00
Nicholas Nethercote 45a8d3ea6a Bug 1340928 (part 7) - Factor out gIsActive handling in platform-*.cpp. r=mstange.
PlatformStart() and PlatformStop() are currently responsible for setting and
clearing gIsActive, but it's better if we do it in profiler_{start,stop}().

The patch also does the following.

- Adds some missing emacs/vim modelines.

- Makes Platform{Start,Stop}() crash if they have failures. I'm not at all
  confident that ignoring the errors as is currently done will result in
  sensible behaviour, so brittleness is better.

--HG--
extra : rebase_source : b9ab8437f5b92f6a8993ba7677ecb74a321ce219
2017-02-16 15:08:07 +11:00
Nicholas Nethercote 5c520e77db Bug 1340928 (part 6) - Clean up profiler code relating to env vars. r=mstange.
This patch mostly does formatting fixes.

It also removes some declarations from platform.h that are no longer necessary
now that platform-linux-android.cpp is in the same compilation unit as
platform.cpp (due to it being #include-d directly); this required reordering
some things.

--HG--
extra : rebase_source : d07ef71455885fe8f1414d87c261ca054989a6a8
2017-02-16 13:59:35 +11:00
Nicholas Nethercote 8c6f56c330 Bug 1340928 (part 5) - Pass the interval to PlatformStart(). r=mstange.
This avoids the need for platform-linux-android.cpp to read gInterval off the
main thread in an awkward spot. It also makes platform-linux-android.cpp
more like platform-{win32,macos}.cpp.

--HG--
extra : rebase_source : c1c76a382d6373f9fd2e3f89a1e1f8fef9072257
2017-02-15 14:44:12 +11:00
Nicholas Nethercote 598cac65d4 Bug 1340928 (part 4) - Remove redundant PlatformStop() call in profiler_stop(). r=mstange.
There is another PlatformStop() call earlier in the function, and gIsActive is
always false by the time we reach the removed call, so it's dead code.

--HG--
extra : rebase_source : 3b358b6bef47d394d6d6bc76d1153ea38968919e
2017-02-15 14:44:12 +11:00
Nicholas Nethercote a84399b3b5 Bug 1340928 (part 3) - Remove Sampler from ProfileGatherer. r=mstange.
It's only being used in a boolean fashion, so this patch replaces it with a
boolean.

--HG--
extra : rebase_source : 91152dff81107070fa49b3984e1b6759e0cd6d20
2017-02-15 14:44:12 +11:00
Nicholas Nethercote fba65fb101 Bug 1340928 (part 2) - Don't use ThreadInfo to pass Linux memory measurements. r=mstange.
This change means that all the relevant code is now within
platform-linux-android.cpp, which is nice.

--HG--
extra : rebase_source : 886a31005fdb67fae65e6f4209796973f1391244
2017-02-15 14:44:09 +11:00
Nicholas Nethercote 505f2bfb24 Bug 1340928 (part 1) - Two small platform-linux-android.cpp tweaks. r=mstange.
- Don't bother checking gSampler in ProfilerSignalHandler. It is equivalent
  to checking gIsActive and we do that at the top of the loop in
  SignalSender(). There is no point repeatedly checking the same condition in
  the middle of that loop; that just opens up the possibility of partially
  complete samples where some threads are missing.

- Clear gCurrentThreadInfo in SignalSender() instead of in
  ProfilerSignalHandler(). The effect is much the same, but this change means
  gCurrentThreadInfo is both set and cleared in SignalSender(), i.e. on a
  single thread, removing any need for Atomic<>.

--HG--
extra : rebase_source : 645d321de4cad6fdb32383b6f1d0c7cbe54308fc
2017-02-15 14:44:07 +11:00
Nicholas Nethercote aee449d9c2 Bug 1339695 (part 11) - Remove the profiler's OS class. r=mstange.
We don't need OS now that the platform-*.cpp files are in the same compilation
unit as platform.cpp.

The patch removes the sleep functions because they are unnecessary indirection.

OS::Startup() is necessary, but the patch renames it PlatformInit() to match
Platform{Start,Stop}() and profiler_init(), from which it is called.
2017-02-20 09:07:37 +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
Nicholas Nethercote 6562cdd851 Bug 1339695 (part 9) - Rename the platform-* files. r=mstange.
Specifically:

- platform-linux.cc -> platform-linux-android.cpp
- platform-macos.cc -> platform-macos.cpp
- platform-win32.cc -> platform-win32.cpp

Adding "android" to the first one is the most important part, because it makes
things clearer. The .cc to .cpp change is less important but I might as well do
it while I'm in here.

--HG--
rename : tools/profiler/core/platform-linux.cc => tools/profiler/core/platform-linux-android.cpp
rename : tools/profiler/core/platform-macos.cc => tools/profiler/core/platform-macos.cpp
rename : tools/profiler/core/platform-win32.cc => tools/profiler/core/platform-win32.cpp
extra : rebase_source : 371f91c4cd95e88e1723e192e68f16ba66965c8f
2017-02-18 00:56:24 +11:00
Nicholas Nethercote cafb84d8e8 Bug 1339695 (part 8) - Clean up platform detection throughout the profiler. r=mstange.
Currently we use the SPS_* macros in some places, but also use other ones like
__arm__ and ANDROID and XP_{WIN,MAC,LINUX}. This patch makes the profiler
consistently use the SPS_* macros and removes the V8_HOST_ARCH_* macros.

The patch also does the following.

- Cleans up some header inclusions, e.g. including pthread.h directly in the
  files that use it, and removing some unneeded android/log.h inclusions.

- Removes an unused branch in SetSampleContext() -- we don't support ARM on
  anything other than Android, and glibc 2.3 is ancient.

- Doesn't use SPS_* in PseudoStack.h because that would require exporting
  PlatformMacros.h, which doesn't seem worthwhile.

Some things that aid the understanding of this patch.

- XP_LINUX and LINUX are both defined for Linux *and* Android.

- x86/Android is the only supported platform that doesn't define
  HAVE_NATIVE_UNWIND.

- Every platform that defines USE_LUL_STACKWALK also defines
  HAVE_NATIVE_UNWIND.

--HG--
extra : rebase_source : 561b708f9434cabd9c0e00d4f4bfdd53f7008670
2017-02-18 00:56:21 +11:00
Nicholas Nethercote 5449b7be2c Bug 1339695 (part 7) - Remove ENABLE_LEAF_DATA. r=mstange.
It's defined if any of XP_{WIN,MAC,LINUX} are defined and the latter includes
Android as well. So it's defined on all the OSes the profiler supports.

--HG--
extra : rebase_source : 1fa9c1fb573a99375b477a048c0b4575ac1eeca0
2017-02-18 00:55:10 +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
Nicholas Nethercote e3efc284a6 Bug 1340327 - Set bools earlier in profiler_start(). r=mstange.
They must be set before the call to MaybeSetProfiler(), which checks
gProfileThreads, and before the gTaskTracer check.

This patch fixes the failure of some threads (e.g. Compositor) to be profiled,
as well as allowing TaskTracer to start up again!
2017-02-18 10:16:47 +11:00
Wes Kocher 8c4ce17711 Merge inbound to m-c a=merge
MozReview-Commit-ID: DCUf7VEDrTt
2017-02-17 13:38:51 -08:00
Jan de Mooij 7c17ed23c6 Bug 1337499 - Take the Win64 stackwalk lock in WalkStackMain64 to avoid deadlocks. r=mstange 2017-02-17 10:51:11 +01: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 c0c235319e Bug 1339695 (part 6) - Remove some B2G-only code in profiler_register_thread(). r=mstange.
--HG--
extra : rebase_source : ea47de5243533578fd24b51c2c22023bbde1fe93
2017-02-15 16:26:23 +11:00
Nicholas Nethercote 822c7d5ac0 Bug 1339695 (part 5) - Introduce PROFILE_JAVA. r=mstange.
This factors out some common preprocessor conditions.

--HG--
extra : rebase_source : 93d5a9ab1f32adcd62826d9710c1790dff2a787e
2017-02-15 16:25:22 +11:00
Nicholas Nethercote 2947c72043 Bug 1339695 (part 4) - Remove a stray, misspelled SPS_STANDALNOE use. r=mstange.
SPS_STANDALONE was removed in bug 1317771.

--HG--
extra : rebase_source : b98aef0ab8080dcb517c4b7667922804e560c2c1
2017-02-15 16:24:37 +11: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 bf2a7f555a Bug 1339695 (part 2) - Reorder PlatformMacros.h.h. r=mstange.
This change increases consistency:

- Each OS is dealt with one at a time (no more interleaving).

- For each OS, x86 is now the first listed architecture.

The patch also adds the missing "#undef SPS_PLAT_x86_android".

--HG--
extra : rebase_source : 6ab278ff2523269424aa6dc872ec35ca6dc735a4
2017-02-15 16:24:33 +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 912ba37deb Bug 1339435 - Fix bogus assertion in both profiler_time() variants. r=jseward.
--HG--
extra : rebase_source : e752a0bf0b8ea8282bc8f0b477d178325e247397
2017-02-15 14:36:10 +11:00
Nicholas Nethercote 9e451d32b5 Bug 1339327 (part 8) - Move the LUL printing check out of SignalSender()'s inner loop. r=jseward.
Instead of calling MaybeShowStats() every 16th time around the inner loop we
now check every time around the outer loop. Because there are typically 20--50
threads running at once, this results in a slightly lower freqency of printing,
but that seems fine because this is debug-only code.
2017-02-15 14:26:23 +11:00
Nicholas Nethercote ab80c09137 Bug 1339327 (part 7) - Rename some things in platform-linux.cc. r=mstange.
The new names are more consistent, and I find them clearer.

The patch also inlines and removes the horribly-named ProfilerSignalThread()
function.
2017-02-15 14:26:23 +11:00
Nicholas Nethercote 154f14f8b1 Bug 1339327 (part 6) - Remove v8-support.h. r=mstange.
It's entirely unused, except for DISALLOW_COPY_AND_ASSIGN, which is easy to
replace.
2017-02-15 14:26:23 +11:00
Nicholas Nethercote 334f89c567 Bug 1339327 (part 5) - Rename some profiler functions related to sleeping. r=mstange.
The new names make it clearer that these actions apply to just one thread.

- profiler_sleep_start() --> profiler_thread_sleep()
- profiler_sleep_end()   --> profiler_thread_wake()
- profiler_is_sleeping() --> profiler_thread_is_sleeping()
- GeckoProfilerSleepRAII --> GeckoProfilerThreadSleepRAII
- GeckoProfilerWakeRAII  --> GeckoProfilerThreadWakeRAII
2017-02-15 14:26:23 +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 27345fed25 Bug 1339327 (part 3) - Remove ToStreamAsJSON(). r=mstange.
This is possible because profiler_shutdown() can call
profiler_save_profile_to_file() to do the saving.
2017-02-15 14:26:23 +11:00
Nicholas Nethercote b495b1b745 Bug 1339327 (part 2) - Tweak platform-*.cc files. r=mstange.
This patch:

- Improves some comments.

- Adds some assertions.

- Removes unnecessary differences between some Mac and Windows code.

- Removes the unnecessary SamplerThread::mStackSize on Windows.
2017-02-15 14:26:22 +11:00
Nicholas Nethercote 7e180ba10e Bug 1339327 (part 1) - Fix profiler_get_features(). r=mstange.
"unwinder" and "jank" are never checked for via hasFeature(), and are not
mentioned anywhere else in the profiler. This patch removes them from
profiler_get_features().

"restyle" *does* have a hasFeature() call and is handled by
profiler_feature_active(). This patch adds it to profiler_get_features().
2017-02-15 14:26:22 +11:00
Jeff Walden ca2e1ac4c0 Bug 1287006 - Don't pass Maybe by value in miscellaneous places. r=froydnj
--HG--
extra : rebase_source : 145f2fc605ff917d3067826a9daebdce07bde02a
2017-02-13 09:07:40 -08:00
Tom Tromey d2667a2b27 Bug 1060419 - make AppendPrintf and nsPrintfCString use Printf.h, r=froydnj
MozReview-Commit-ID: 2E8FoiNxU8L

--HG--
extra : rebase_source : 810ac727bef0751f24edea18c52e0ec170bf367d
2016-12-14 09:32:21 -07:00
Nicholas Nethercote 9c05f8c8ed Bug 1338957 (part 3) - Simplify sleep handling in PseudoStack. r=mstange.
Sleep handling is currently done with two counters (mSleepId, mSleepIdObserved)
and a boolean (mSleeping). This patch replaces it with a single tri-state
variable (mSleep), which is enough to replicate the functionality.

The patch also clearly documents how this variable is accessed from multiple
threads and the potential inaccuracies that can result from races.
2017-02-13 17:22:44 +11:00
Nicholas Nethercote b623b482a6 Bug 1338957 (part 1) - Reformat PseudoStack.h. r=mstange.
This patch:

- Reformats PseudoStack.h to more closely follow Mozilla style.

- Rewrites some comments to make them more readable, e.g. by properly
  delimiting sentences with upper-case letters and full stops.

- Replaces sMin() with std::min(), because <algorithm> no longer causes
  problems.

- Reorders PseudoStack so that all the data members are at the end, which makes
  them easier to see.
2017-02-13 16:36:25 +11:00
Nicholas Nethercote c0e1a9dba7 Bug 1337189 (follow-up) - Fix MOZ_TASK_TRACER bustage. r=schien.
--HG--
extra : rebase_source : 6456da27632602250bde5bb96623d79ad180964d
2017-02-13 16:34:58 +11:00
Nicholas Nethercote 3466173cca Bug 1337189 (part 26) - Remove Sampler.cpp. r=mstange.
Sampler's constructor and destructor are inlined into profiler_{start,stop}(),
respectively. A trivial Sampler class is left behind (now in platform.cpp)
because there are still numerous gSampler null checks, which I will remove in a
follow-up bug.

PseudoStack::flushSamplerOnShutdown() moves into platform.cpp. MAXPATHLEN is
unused and is deleted.
2017-02-09 17:09:39 +11:00
Nicholas Nethercote 7edc648995 Bug 1337189 (part 25) - Move streaming/saving code out of Sampler. r=mstange. 2017-02-09 17:04:51 +11:00
Nicholas Nethercote f7e99d0285 Bug 1337189 (part 24) - Move RegisterThread() out of Sampler and rename it. r=mstange.
The new name is MaybeSetProfile(), which better reflects what it does.
2017-02-09 15:40:12 +11:00
Nicholas Nethercote 78a76af493 Bug 1337189 (part 23) - Move PlatformData out of Sampler. r=mstange. 2017-02-09 15:04:36 +11:00
Nicholas Nethercote 6462cc823f Bug 1337189 (part 22) - Move CanNotifyObservers() out of Sampler. r=mstange. 2017-02-09 15:01:27 +11:00
Nicholas Nethercote ead0668be5 Bug 1337189 (part 21) - Remove Sampler::SizeOfIncludingThis(). r=mstange. 2017-02-09 15:00:29 +11:00