Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Issue 1263403002: Stack sampling profiler: re-enable stack collection for stacks terminated by leaf functions (Closed)

Created:
5 years, 4 months ago by Mike Wittman
Modified:
5 years, 4 months ago
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Stack sampling profiler: re-enable stack collection for stacks terminated by leaf functions Collect the 5% of leaf-terminated stacks that we're currently missing. Avoids crashes we saw previously on unwinding frames in injected third party modules with functions not adhering to the Microsoft x64 calling conventions, by blacklisting leaf unwinding for these modules when we first see a bad frame. With this change there's still a very small possibility of crashing if a stack happens to start with one of the bad third party functions. This change will allow us to collect crash data on this case and inform a decision about appropriate heuristics to deal with it. BUG=516402 Committed: https://crrev.com/863f84165da958298516064732d4d5b62ad7eb59 Cr-Commit-Position: refs/heads/master@{#345012}

Patch Set 1 #

Patch Set 2 : enable at startup, add CHECK #

Total comments: 7

Patch Set 3 : test unwinding #

Total comments: 8

Patch Set 4 : initialize with declared constant #

Patch Set 5 : add comment #

Total comments: 4

Patch Set 6 : update comments #

Patch Set 7 : rebase #

Patch Set 8 : fix GN link #

Unified diffs Side-by-side diffs Delta from patch set Stats (+588 lines, -45 lines) Patch
M base/BUILD.gn View 1 2 3 4 5 6 7 1 chunk +5 lines, -0 lines 0 comments Download
M base/base.gyp View 1 2 3 4 5 6 7 1 chunk +5 lines, -0 lines 0 comments Download
M base/base.gypi View 1 2 3 4 5 6 7 1 chunk +4 lines, -0 lines 0 comments Download
M base/profiler/native_stack_sampler_win.cc View 1 2 9 chunks +20 lines, -45 lines 0 comments Download
A base/profiler/win32_stack_frame_unwinder.h View 1 2 1 chunk +82 lines, -0 lines 0 comments Download
A base/profiler/win32_stack_frame_unwinder.cc View 1 2 3 4 5 1 chunk +212 lines, -0 lines 0 comments Download
A base/profiler/win32_stack_frame_unwinder_unittest.cc View 1 2 3 4 1 chunk +231 lines, -0 lines 0 comments Download
M chrome/browser/chrome_browser_main.h View 1 2 chunks +5 lines, -0 lines 0 comments Download
M chrome/browser/chrome_browser_main.cc View 1 2 3 4 5 6 7 2 chunks +24 lines, -0 lines 0 comments Download

Messages

Total messages: 33 (9 generated)
Mike Wittman
Hi Zach, can you take a look at this before I send it on to ...
5 years, 4 months ago (2015-08-03 19:57:31 UTC) #2
zturner
lgtm. Seems ok to me, but you might want multiple opinions given the complexity
5 years, 4 months ago (2015-08-05 17:05:55 UTC) #3
Mike Wittman
Hi Nico, would you be willing to review this in the absence of cpu@?
5 years, 4 months ago (2015-08-05 22:07:07 UTC) #5
Nico
I think landing this is generally fine. It's somewhat complex, but it's limited to a ...
5 years, 4 months ago (2015-08-15 01:44:18 UTC) #6
Mike Wittman
Thanks for the review. On 2015/08/15 01:44:18, Nico (hiding) wrote: > I think landing this ...
5 years, 4 months ago (2015-08-16 00:54:12 UTC) #7
Nico
https://codereview.chromium.org/1263403002/diff/20001/base/profiler/native_stack_sampler_win.cc File base/profiler/native_stack_sampler_win.cc (right): https://codereview.chromium.org/1263403002/diff/20001/base/profiler/native_stack_sampler_win.cc#newcode146 base/profiler/native_stack_sampler_win.cc:146: // We blacklist the module as untrustable for unwinding ...
5 years, 4 months ago (2015-08-16 01:32:00 UTC) #8
Mike Wittman
I've refactored the code to use a testable stack unwinding interface, and added unit tests. ...
5 years, 4 months ago (2015-08-18 21:16:56 UTC) #10
Nico
lgtm, thanks! https://codereview.chromium.org/1263403002/diff/60001/base/profiler/win32_stack_frame_unwinder.h File base/profiler/win32_stack_frame_unwinder.h (right): https://codereview.chromium.org/1263403002/diff/60001/base/profiler/win32_stack_frame_unwinder.h#newcode31 base/profiler/win32_stack_frame_unwinder.h:31: virtual PRUNTIME_FUNCTION LookupFunctionEntry(DWORD64 program_counter, LookUp ("look up" ...
5 years, 4 months ago (2015-08-18 23:20:25 UTC) #11
Mike Wittman
https://codereview.chromium.org/1263403002/diff/60001/base/profiler/win32_stack_frame_unwinder.h File base/profiler/win32_stack_frame_unwinder.h (right): https://codereview.chromium.org/1263403002/diff/60001/base/profiler/win32_stack_frame_unwinder.h#newcode31 base/profiler/win32_stack_frame_unwinder.h:31: virtual PRUNTIME_FUNCTION LookupFunctionEntry(DWORD64 program_counter, On 2015/08/18 23:20:24, Nico wrote: ...
5 years, 4 months ago (2015-08-18 23:43:11 UTC) #12
Mike Wittman
Carlos, do you want to take a look at this now that you're back?
5 years, 4 months ago (2015-08-18 23:43:59 UTC) #14
Nico
https://codereview.chromium.org/1263403002/diff/60001/base/profiler/win32_stack_frame_unwinder_unittest.cc File base/profiler/win32_stack_frame_unwinder_unittest.cc (right): https://codereview.chromium.org/1263403002/diff/60001/base/profiler/win32_stack_frame_unwinder_unittest.cc#newcode111 base/profiler/win32_stack_frame_unwinder_unittest.cc:111: scoped_ptr<Win32StackFrameUnwinder> unwinder = CreateUnwinder(); On 2015/08/18 23:43:10, Mike Wittman ...
5 years, 4 months ago (2015-08-18 23:49:48 UTC) #15
Mike Wittman
https://codereview.chromium.org/1263403002/diff/60001/base/profiler/win32_stack_frame_unwinder_unittest.cc File base/profiler/win32_stack_frame_unwinder_unittest.cc (right): https://codereview.chromium.org/1263403002/diff/60001/base/profiler/win32_stack_frame_unwinder_unittest.cc#newcode111 base/profiler/win32_stack_frame_unwinder_unittest.cc:111: scoped_ptr<Win32StackFrameUnwinder> unwinder = CreateUnwinder(); On 2015/08/18 23:49:48, Nico wrote: ...
5 years, 4 months ago (2015-08-18 23:58:18 UTC) #16
cpu_(ooo_6.6-7.5)
Scary indeed. I stared at it for a while and it looks correct https://codereview.chromium.org/1263403002/diff/100001/base/profiler/win32_stack_frame_unwinder.cc File ...
5 years, 4 months ago (2015-08-19 19:07:24 UTC) #17
Mike Wittman
https://codereview.chromium.org/1263403002/diff/100001/base/profiler/win32_stack_frame_unwinder.cc File base/profiler/win32_stack_frame_unwinder.cc (right): https://codereview.chromium.org/1263403002/diff/100001/base/profiler/win32_stack_frame_unwinder.cc#newcode19 base/profiler/win32_stack_frame_unwinder.cc:19: // encountered as the last frame on the call ...
5 years, 4 months ago (2015-08-19 19:54:41 UTC) #18
cpu_(ooo_6.6-7.5)
lgtm
5 years, 4 months ago (2015-08-21 19:49:27 UTC) #19
cpu_(ooo_6.6-7.5)
the updated comment by the way says the same to me, that is we suspend ...
5 years, 4 months ago (2015-08-21 19:55:22 UTC) #20
Mike Wittman
On 2015/08/21 19:55:22, cpu wrote: > the updated comment by the way says the same ...
5 years, 4 months ago (2015-08-21 20:04:37 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1263403002/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1263403002/140001
5 years, 4 months ago (2015-08-23 20:28:49 UTC) #24
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_rel_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/102867)
5 years, 4 months ago (2015-08-23 21:22:27 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1263403002/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1263403002/160001
5 years, 4 months ago (2015-08-23 23:39:59 UTC) #29
commit-bot: I haz the power
Committed patchset #8 (id:160001)
5 years, 4 months ago (2015-08-24 00:43:01 UTC) #30
commit-bot: I haz the power
Patchset 8 (id:??) landed as https://crrev.com/863f84165da958298516064732d4d5b62ad7eb59 Cr-Commit-Position: refs/heads/master@{#345012}
5 years, 4 months ago (2015-08-24 00:43:45 UTC) #31
Nico
This breaks the win/clang build, can you fix please? In file included from ..\..\base\profiler\native_stack_sampler_win.cc:13: ..\..\base/profiler/win32_stack_frame_unwinder.h(48,5) ...
5 years, 4 months ago (2015-08-24 02:46:53 UTC) #32
Nico
5 years, 4 months ago (2015-08-24 03:33:15 UTC) #33
Message was sent while issue was closed.
nvm, got it: https://codereview.chromium.org/1313543002/

On Sun, Aug 23, 2015 at 7:46 PM, <thakis@chromium.org> wrote:

> This breaks the win/clang build, can you fix please?
>
> In file included from ..\..\base\profiler\native_stack_sampler_win.cc:13:
> ..\..\base/profiler/win32_stack_frame_unwinder.h(48,5) : error:
> [chromium-style]
> 'virtual' is redundant; 'override' implies 'virtual'.
>     virtual PRUNTIME_FUNCTION LookupFunctionEntry(DWORD64 program_counter,
>     ^~~~~~~~
> ..\..\base/profiler/win32_stack_frame_unwinder.h(51,5) : error:
> [chromium-style]
> 'virtual' is redundant; 'override' implies 'virtual'.
>     virtual void VirtualUnwind(DWORD64 image_base, DWORD64 program_counter,
>     ^~~~~~~~
> 2 errors generated.
>
>
>
http://build.chromium.org/p/chromium.fyi/builders/CrWinClang/builds/2782/step...
>
> https://codereview.chromium.org/1263403002/
>

To unsubscribe from this group and stop receiving emails from it, send an email
to chromium-reviews+unsubscribe@chromium.org.

Powered by Google App Engine
This is Rietveld 408576698