Commit Graph

72 Commits

Author SHA1 Message Date
Michael Layzell
cd8964a17f Bug 1380096 - Don't require that sMainThreadRunnableName is null-terminated, r=erahm
MozReview-Commit-ID: 9Zo1vjmKzZC
2017-07-12 15:10:44 -04:00
Michael Layzell
28279ac02e Bug 1377344 - Record the name of the currently running Runnable on thread hangs for BHR, r=njn, r=froydnj
MozReview-Commit-ID: IYRHh6jiTeo
2017-07-04 15:16:19 -04:00
Michael Layzell
18a05cd35b Bug 1373281 - Null-check mStackToFill before collecting psuedostacks, r=froydnj
This was causing a crash on nightly. The browser would try to collect only a
native stack, and then attempt to dereference the null pointer for the
pseudostack. I think this didn't happen on infra as it only occurs when the user
has hung a sufficient number of times.

MozReview-Commit-ID: 6RSW2llKBjT
2017-06-15 17:04:42 -04:00
Michael Layzell
69f986faaf Bug 1357829 - Part 2: Use profiler_suspend_sample_thread in the background hang monitor, r=froydnj
This patch uses the profiler_suspend_sample_thread method which was added in
part 1.

With this patch, we no longer manually run code to pause the target thread,
instead using the profiler's provided code to do so. In addition, we no longer
manually walk the stack to collect native stack frames, instead relying on the
profiler's cross-platform stack walking logic.

This helps remove some of the code from ThreadStackHelper which was redundant
with the profiler. Much of the pseudostack code in ThreadStackHelper is also
redundant, and should hopefully be eliminated in a follow-up.

MozReview-Commit-ID: 4RjLHt6inH9
2017-06-14 12:27:49 -04:00
Nicholas Nethercote
a47be2a53a Bug 1369644 - Remove use of |volatile| from ProfileEntry. r=mstange,shu,jseward,froydnj.
These annotations aren't doing anything useful. The important thing with
the PseudoStack is that, during pushes, the stack pointer incrementing happens
after the new entry is written, and this is ensured by the stack pointer being
Atomic.

The patch also improves the comments on PseudoStack.
2017-06-02 17:16:56 +10:00
Nicholas Nethercote
df71128496 Bug 1366650 (part 1) - Move PseudoStack into SpiderMonkey. r=mstange,shu.
This includes renaming its fields to match SpiderMonkey naming conventions
instead of Gecko naming conventions.

This patch is just about moving the code. The next patch will change
SpiderMonkey to actually use PseudoStack directly.
2017-05-26 09:37:28 +10:00
Nicholas Nethercote
e6089b3411 Bug 1365854 - Remove FRAME_LABEL_COPY. r=mstange,shu.
ProfileEntry has |string|, which can be static or dynamic, and |dynamicString|.
If |string| is dynamic, the FRAME_LABEL_COPY flag must be set, and it will be
copied into profiler output.

But there is only one place that uses dynamic |string| values, in SpiderMonkey.
And that place doesn't use |dynamicString|. So this patch changes that place to
use an empty |string| and put the old dynamic |string| value in
|dynamicString|. This in turn removes the need for FRAME_LABEL_COPY.

One minor wrinkle is that when |dynamicString| is used the old code put a space
between |string| and |dynamicString|. The new code omits the space if |string|
is empty.

The patch also renames ProfileEntry::string as ProfileEntry::label_, which
better matches how it's used, and ProfileEntry::dynamicString as
ProfileEntry::dynamicString_ so the getter can be renamed dynamicString().
2017-05-18 17:17:46 +10:00
Iris Hsiao
f1564c8b92 Backed out 4 changesets (bug 1357829) for build bustage in xpcshell\selftest.py on windows 8 x64 opt. a=backout
Backed out changeset 8ea202bb1103 (bug 1357829)
Backed out changeset cebe4d7abeda (bug 1357829)
Backed out changeset 378d473c9619 (bug 1357829)
Backed out changeset 86ebe868d443 (bug 1357829)
2017-05-19 11:27:38 +08:00
Michael Layzell
c2befa1123 Bug 1357829 - Part 2: Use profiler_suspend_sample_thread in the background hang monitor, r=froydnj
This patch uses the profiler_suspend_sample_thread method which was added in
part 1.

With this patch, we no longer manually run code to pause the target thread,
instead using the profiler's provided code to do so. In addition, we no longer
manually walk the stack to collect native stack frames, instead relying on the
profiler's cross-platform stack walking logic.

This helps remove some of the code from ThreadStackHelper which was redundant
with the profiler. Much of the pseudostack code in ThreadStackHelper is also
redundant, and should hopefully be eliminated in a follow-up.

MozReview-Commit-ID: 4RjLHt6inH9
2017-05-18 13:56:20 -04:00
Michael Layzell
7d3fc6981d Bug 1358619 - Fetch the stack and native stack within the same pause of the target thread, r=froydnj 2017-05-01 13:40:37 -04:00
Michael Layzell
81d95ba1f5 Bug 1346415 - Use FramePointerStackWalk for less deadlocking when stackwalking on x86, r=njn
MozReview-Commit-ID: CAHarvGSuTY
2017-05-01 13:40:37 -04:00
Nicholas Nethercote
c4b55083ae Bug 1359000 (part 4) - De-inline profiler_call_{enter,exit}. r=mstange.
This possibly incurs an extra function call (depends on exactly how much inling
the compiler does). But it helps enormously with subsequent refactorings,
because PseudoStack (and related types) don't need to be visible in
GeckoProfiler.h, which is exported outside the profiler.
2017-04-27 07:36:11 +10:00
Mike Conley
6b1b0329c3 Bug 1312883 - Use MozStackWalk to gather native stacks on Windows. r=gfritzsche,jchen,liuche
MozReview-Commit-ID: A2aZAL03FG2
2017-02-16 12:05:46 -05:00
Mike Conley
872fc93e83 Bug 1312883 - Remove all thread context processing from ThreadStackHelper. r=jchen
MozReview-Commit-ID: LpMSf6bSLy8
2017-02-17 17:13:57 -05:00
Sebastian Hengst
d2fda297ce Backed out changeset d6b3328c9573 (bug 1312883) 2017-02-24 14:25:20 +01:00
Sebastian Hengst
08f2233e92 Backed out changeset fddfc0739043 (bug 1312883) 2017-02-24 14:25:15 +01:00
Mike Conley
a194e7116b Bug 1312883 - Use MozStackWalk to gather native stacks on Windows. r=gfritzsche,jchen,liuche
MozReview-Commit-ID: A2aZAL03FG2
2017-02-16 12:05:46 -05:00
Mike Conley
39eb226f83 Bug 1312883 - Remove all thread context processing from ThreadStackHelper. r=jchen
MozReview-Commit-ID: LpMSf6bSLy8
2017-02-17 17:13:57 -05:00
Julian Seward
eb67afc06a Bug 1341255 - Profiler tidyups: remove StackEntry, rename ProfileEntry to ProfileBufferEntry (part 1: remove StackEntry). r=n.nethercote. 2017-02-23 23:04:13 +01:00
Nicholas Nethercote
c1b079c8b7 Bug 1332577 (part 7) - Rename mozilla_get_pseudo_stack() as profiler_get_pseudo_stack(). r=mstange.
This makes it consistent with other profiler functions.
2017-01-20 15:07:05 +11:00
Mike Conley
5503a2dc58 Bug 1312597 - Increase ThreadStackHelper's initial max buffer size to avoid (chrome script) placeholder in BHR pseudostacks. r=jchen
MozReview-Commit-ID: 6gE4eug7cmY
2016-10-25 14:28:23 -04:00
Jan de Mooij
7e23a13833 Bug 1302914 - Use GetThreadContext after calling SuspendThread to ensure threads are really suspended. r=froydnj 2016-09-29 20:05:36 +02:00
Jon Coppeard
25973c4e78 Bug 1298639 - Use bytecode offsets rather than direct pointer in profiling API r=shu 2016-09-13 14:06:46 +02:00
Igor
9c81c3c1ee Bug 1293384 - Part 2: Rename Snprintf.h header to Sprintf.h. r=froydnj 2016-08-14 23:43:21 -07:00
Igor
972b8460e2 Bug 1293384 - Part 1: Rename snprintf_literal to SprintfLiteral. r=froydnj 2016-08-14 23:44:00 -07:00
Ted Mielczarek
ed5c22bc25 bug 1069556 - sync to Breakpad c53ed143108948eb7e2d7ee77dc8c0d92050ce7c. r=glandium, benwa
This commit contains a few things:
* Update our copy of google-breakpad to upstream c53ed143108948eb7e2d7ee77dc8c0d92050ce7c
* Get rid of all but one local patch, fold a few related local patches into one
* Misc build fixup to sync with upstream--adding a few new moz.build files,
  source files
* The final bits of unhooking Breakpad from the profiler:
** Revert to only building toolkit/crashreporter if MOZ_CRASHREPORTER.
** Stop building bits of Breakpad that we only needed for the profiler.
** Remove a few bits of profiler code that were used to interface with Breakpad.
** Remove toolkit/crashreporter/breakpad-logging, which was only used to
   suppress Breakpad logging for the in-process stackwalker.
* Upstream removed their Android-compat sys/ucontext.h because the Android NDK
  added it, but the bionic we're using for Gonk builds is too old, so add a
  copy of the previous version of those files to
  toolkit/crashreporter/gonk-include to keep Gonk building.
* Consolidate moz.build files under toolkit/crashreporter/google-breakpad/client/linux
2016-01-27 09:39:53 -05:00
Chris Peterson
82d3961d8f Bug 1207031 - Suppress -Wshadow warnings from google-breakpad headers in xpcom/threads. r=froydnj 2015-09-21 22:41:52 -07:00
Jim Chen
a3b0963b55 Bug 1196381 - Eliminate breakpad dependency in ThreadStackHelper; r=nfroyd r=snorp
The breakpad dependency in ThreadStackHelper is preventing us from
upgrading our in-tree copy to a newer version (bug 1069556). This patch
gets rid of that dependency. This makes native stack frames not work
for BHR, but because of the ftp.m.o decommissioning, native
symbolication was already broken and naive stack frames already don't
work, so we don't really lose anything from this patch.

Eventually we want to make ThreadStackHelper use other means of
unwinding, such as LUL for Linux

I added | #if 0 | around the code to fill the thread context, but left
the code in because I think we'll evenually want to reuse some of that
code.
2015-09-18 09:17:10 -04:00
Miko Mynttinen
7ac3faa6c3 Bug 1197316 - Remove PR_snprintf calls in xpcom/. r=froydnj 2015-08-22 17:57:52 -07:00
Birunthan Mohanathas
a29151dc87 Bug 1182996 - Fix and add missing namespace comments. rs=ehsan
The bulk of this commit was generated by running:

  run-clang-tidy.py \
    -checks='-*,llvm-namespace-comment' \
    -header-filter=^/.../mozilla-central/.* \
    -fix
2015-07-13 08:25:42 -07:00
Nathan Froyd
1f9672eb8e Bug 1169034 - include <cstdlib> in ThreadStackHelper.cpp to declare correct overload for std::abs; r=jseward
The integer-valued {,l,ll}abs functions come from <stdlib.h>, and so the
integer-valued overload for std::abs comes from <cstdlib>.
2015-05-27 16:54:38 -04:00
Jim Chen
d226e2c08b Bug 1164090 - Check for Windows path separator in BHR file name; r=snorp 2015-05-19 11:27:18 -04:00
Trevor Saunders
2cab0ab3a9 bug 1146027 - more final r=froydnj 2015-03-24 17:51:43 -04:00
Jim Chen
8c8c301f3e Bug 1113416 - Don't read stack labels inside hang monitor sighandler; r=nfroyd r=snorp
When we're inside the hang monitor's signal handler, we must not read any string labels. Doing so may result in on-demand decompression kicking in on Android, which may result in a deadlock.
2015-01-10 12:41:48 -05:00
Jim Chen
e034c991d4 Bug 1109291 - Include better paths for hanging chrome scripts in profile extensions directory; r=snorp r=bsmedberg 2014-12-16 17:09:17 -05:00
Jim Chen
982fedb933 Bug 1091758 - Report full paths for most chrome scripts; r=snorp 2014-11-25 15:35:21 -08:00
Julian Seward
6cf9921f9c Bug 1100911 - For MacOS builds running on Valgrind, make ThreadStackHelper::GetStack be a no-op. r=nchen. 2014-11-20 20:50:26 +01:00
Tom Schuster
4e0dfb7481 Bug 1069694 - Remove OldDebugAPI from the browser. r=shu 2014-10-12 19:37:41 +02:00
Tom Schuster
27edac60d0 Bug 1069694 - Remove or move around functions in OldDebugAPI. r=shu 2014-09-23 15:25:31 +02:00
Birunthan Mohanathas
6e9ec233ed Bug 1046841 - Fix more style violations in previously touched .cpp files in xpcom/. r=froydnj 2014-08-25 12:17:15 -07:00
Jim Chen
9318e6e2f2 Bug 1050440 - Remove repeated js::RunScript frames in ThreadStackHelper; r=snorp 2014-08-14 17:17:55 -04:00
Julian Seward
0ca4d05ba8 Bug 1050185 - Make ThreadStackHelper::FillThreadContext Valgrind-friendly. r=nchen 2014-08-12 12:15:06 +02:00
Jim Chen
cee6c98c81 Bug 1049161 - Fix ThreadStackHelper thread handle permissions on Windows; r=snorp 2014-08-08 18:11:53 -04:00
Jeff Walden
4e7053ed2b Bug 1047123 - ThreadStackHelper should use UniquePtr<uint8_t[]>, not ScopedDeleteArray. r=jchen 2014-08-01 10:49:37 -07:00
Jan Beich
cc56bb4105 Bug 1045176 - Unbreak build on non-SPS platforms after bug 1016629. r=nchen 2014-07-28 12:29:00 +02:00
Jim Chen
6593aa5354 Bug 1016629 - g. Avoid ASan flag when copying stack; r=snorp 2014-07-28 13:30:22 -04:00
Jim Chen
bc67208ff7 Bug 1016629 - e. Implement platform-specific code for filling in context; r=snorp r=jseward 2014-07-28 13:30:21 -04:00
Jim Chen
20e91cc373 Bug 1016629 - d. Add and implement GetNativeStack method in ThreadStackHelper; r=snorp r=jseward 2014-07-28 13:30:21 -04:00
Jim Chen
751190fb1d Bug 1016629 - c. Add define for ThreadStackHelper pseudostack support; r=snorp 2014-07-28 13:30:20 -04:00
Jim Chen
7a41d1bffa Bug 1016629 - b. Use RAII class to assign mStackToFill; r=snorp 2014-07-28 13:30:20 -04:00