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

Issue 1342453003: Stack sampling profiler to profile on Mac. TEST-- not for commit. (Closed)

Created:
5 years, 3 months ago by sydli
Modified:
5 years ago
Reviewers:
Robert Sesek
CC:
chromium-reviews, Alexei Svitkine (slow)
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Stack sampling profiler to profile on Mac. TEST-- not for commit. BUG=

Patch Set 1 #

Patch Set 2 : Safe jump #

Patch Set 3 : Module id works for non-fat object files. #

Patch Set 4 : Removed MD5 IDs and added support for IDing FAT Mach-O files. #

Patch Set 5 : BUILD.gn update #

Total comments: 4

Patch Set 6 : No more disk accesses and moved impl to *_mac.cc file. #

Patch Set 7 : Build fixes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+310 lines, -1 line) Patch
M base/BUILD.gn View 1 2 3 4 5 6 2 chunks +5 lines, -0 lines 0 comments Download
M base/base.gypi View 1 2 3 4 5 6 2 chunks +6 lines, -0 lines 0 comments Download
A base/profiler/native_stack_sampler_mac.cc View 1 2 3 4 5 6 1 chunk +298 lines, -0 lines 0 comments Download
M base/profiler/stack_sampling_profiler_unittest.cc View 1 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 3 (2 generated)
Robert Sesek
5 years, 3 months ago (2015-09-14 18:55:54 UTC) #3
Just some high-level comments.

https://codereview.chromium.org/1342453003/diff/100001/base/profiler/native_s...
File base/profiler/native_stack_sampler_posix.cc (right):

https://codereview.chromium.org/1342453003/diff/100001/base/profiler/native_s...
base/profiler/native_stack_sampler_posix.cc:69: void
ConvertIdentifierToString(const unsigned char identifier[16],
Can you use HexEncode() from base/strings/string_number_conversions.h instead ?

https://codereview.chromium.org/1342453003/diff/100001/base/profiler/native_s...
base/profiler/native_stack_sampler_posix.cc:240: GetUniqueId(inf.dli_fname,
&unique_id);
Touching disk here is going to be a huge hit on some machines and under some
circumstances. But you also do not need to. Use dli_fbase instead, which is a
pointer to the mach_header. The image, and all of its information, is already
loaded into memory. There's no reason to access disk for it.

https://codereview.chromium.org/1342453003/diff/100001/base/profiler/native_s...
base/profiler/native_stack_sampler_posix.cc:266: class NativeStackSamplerMac :
public NativeStackSampler {
This should move into native_stack_sampler_mac.cc (and the impl above), since
it's not POSIX.

https://codereview.chromium.org/1342453003/diff/100001/base/profiler/native_s...
base/profiler/native_stack_sampler_posix.cc:288: // (See
base/threading/platform_thread_posix.cc:128)
This seems like a bug. May want to file one for this to redefine it as a
mach_port_t, since that's what it really is.

Powered by Google App Engine
This is Rietveld 408576698