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

Issue 8770054: Tool to log the execution of Chrome. Initial add. (Closed)

Created:
9 years ago by glotov
Modified:
8 years, 7 months ago
CC:
chromium-reviews, hclam+watch_chromium.org, ddorwin+watch_chromium.org, fischman+watch_chromium.org, acolwell+watch_chromium.org, annacc+watch_chromium.org, brettw-cc_chromium.org, vrk (LEFT CHROMIUM), scherkus (not reviewing), ihf+watch_chromium.org, Nikita (slow), DaveMoore, navabi1
Visibility:
Public.

Description

Note: this change does nothing unless order_profiling=1 is manually set in GYP defines (or EXTRA_BUILD_ARGS for cros). When enabled, this tool is built into Chrome and makes it log its routine invocations. Every time a routine is called and if it is called for the first time (per each thread), the log is updated with current time and the address of the routine. Later, such logs can be merged (across all threads), symbolized and fed into linker ('order_text_section') so it produces binary with more optimal code layout. This must make code work faster because of better CPU cache utilization. See more technical details in tools/cygprofile/cygprofile.cc header. Cyg prefix is taken after the callback names in gcc that we use to hook the code: __cyg_profile_func_enter and __cyg_profile_func_exit. More info at https://sites.google.com/a/google.com/chrome-msk/dev/boot-speed-up-effort BUG=chromium-os:20187 TEST=units, build cros with declare -x EXTRA_BUILD_ARGS="order_profiling=1 linux_use_tcmalloc=0" run it and check the log at /var/log/chrome/cyglog.*. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=137391

Patch Set 1 #

Total comments: 13

Patch Set 2 : sync to 18.0.1011 and ongoing work #

Patch Set 3 : sync #

Patch Set 4 : sync fix #

Patch Set 5 : fixed review comments #

Total comments: 2

Patch Set 6 : sync and remove commented code #

Patch Set 7 : sync #

Patch Set 8 : moved /base/cygprofile to /tools/cygprofile #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+475 lines, -0 lines) Patch
M build/common.gypi View 1 2 3 4 5 6 7 3 chunks +14 lines, -0 lines 0 comments Download
M chrome/chrome_exe.gypi View 1 2 3 4 5 6 7 1 chunk +5 lines, -0 lines 0 comments Download
M media/media.gyp View 1 2 3 4 5 6 7 2 chunks +14 lines, -0 lines 0 comments Download
M skia/skia.gyp View 1 2 3 4 5 6 7 4 chunks +28 lines, -0 lines 0 comments Download
M third_party/libwebp/libwebp.gyp View 1 1 chunk +9 lines, -0 lines 0 comments Download
A tools/cygprofile/cygprofile.cc View 1 2 3 4 5 6 7 1 chunk +385 lines, -0 lines 4 comments Download
A tools/cygprofile/cygprofile.gyp View 1 2 3 4 5 6 7 1 chunk +20 lines, -0 lines 0 comments Download

Messages

Total messages: 16 (0 generated)
glotov
Dmitry, please have a look. Dave, Nikita, Armand, I added you just in case you ...
9 years ago (2011-12-02 18:35:31 UTC) #1
Dmitry Polukhin
http://codereview.chromium.org/8770054/diff/1/base/cygprofile/cygprofile.cc File base/cygprofile/cygprofile.cc (right): http://codereview.chromium.org/8770054/diff/1/base/cygprofile/cygprofile.cc#newcode61 base/cygprofile/cygprofile.cc:61: CygLogEntry(time_t _seconds, long int _usec, Please don't add _ ...
9 years ago (2011-12-12 06:33:01 UTC) #2
Nikita (slow)
I suggest you should split this CL into 2 parts: 1. Add GYP flags order_profiling ...
9 years ago (2011-12-12 08:53:50 UTC) #3
Nikita (slow)
lgtm Please comment why flags were added only to those gyp files (common.gypi, chrome_exe.gypi, nacl.gypi, ...
9 years ago (2011-12-12 08:57:51 UTC) #4
Nikita (slow)
sorry, I've accidentally pushed "quck lg" button instead of "publish drafts". http://codereview.chromium.org/8770054/diff/1/chrome/nacl.gypi File chrome/nacl.gypi (right): ...
9 years ago (2011-12-12 08:59:17 UTC) #5
glotov
http://codereview.chromium.org/8770054/diff/1/base/cygprofile/cygprofile.cc File base/cygprofile/cygprofile.cc (right): http://codereview.chromium.org/8770054/diff/1/base/cygprofile/cygprofile.cc#newcode61 base/cygprofile/cygprofile.cc:61: CygLogEntry(time_t _seconds, long int _usec, Good. Will try. http://codereview.chromium.org/8770054/diff/1/base/cygprofile/cygprofile.cc#newcode144 ...
9 years ago (2011-12-13 19:45:43 UTC) #6
dpolukhin
http://codereview.chromium.org/8770054/diff/1/base/cygprofile/cygprofile.cc File base/cygprofile/cygprofile.cc (right): http://codereview.chromium.org/8770054/diff/1/base/cygprofile/cygprofile.cc#newcode148 base/cygprofile/cygprofile.cc:148: static base::Lock all_logs_mutex_; On 2011/12/13 19:45:43, glotov wrote: > ...
9 years ago (2011-12-14 07:10:50 UTC) #7
Nikita (slow)
Please create new CL that only contains support for order file as we've discussed. Optimized ...
8 years, 11 months ago (2012-01-20 08:47:01 UTC) #8
glotov
Updated. Please have a look again. http://codereview.chromium.org/8770054/diff/1/base/cygprofile/cygprofile.cc File base/cygprofile/cygprofile.cc (right): http://codereview.chromium.org/8770054/diff/1/base/cygprofile/cygprofile.cc#newcode148 base/cygprofile/cygprofile.cc:148: static base::Lock all_logs_mutex_; ...
8 years, 8 months ago (2012-04-05 13:50:20 UTC) #9
Dmitry Polukhin
LGTM with nit http://codereview.chromium.org/8770054/diff/27001/build/common.gypi File build/common.gypi (right): http://codereview.chromium.org/8770054/diff/27001/build/common.gypi#newcode2121 build/common.gypi:2121: # ], Do you need these ...
8 years, 8 months ago (2012-04-09 11:05:05 UTC) #10
glotov
Hi Brett! I need your owner approval. http://codereview.chromium.org/8770054/diff/27001/build/common.gypi File build/common.gypi (right): http://codereview.chromium.org/8770054/diff/27001/build/common.gypi#newcode2121 build/common.gypi:2121: # ], ...
8 years, 8 months ago (2012-04-11 17:00:33 UTC) #11
brettw
Would this be better in src/tools or src/chrome/tools?
8 years, 8 months ago (2012-04-11 23:37:10 UTC) #12
brettw
Also, can you give more background? This doesn't make any sense to me: "Writes logs ...
8 years, 8 months ago (2012-04-11 23:43:38 UTC) #13
glotov
Hi Brett! Sorry for the delay, it was my vacation. I updated the description and ...
8 years, 7 months ago (2012-05-15 16:01:25 UTC) #14
brettw
I don't understand this well, so I'll assume you guys know what you're doing. Owners ...
8 years, 7 months ago (2012-05-15 22:59:53 UTC) #15
glotov
8 years, 7 months ago (2012-05-16 10:49:14 UTC) #16
http://codereview.chromium.org/8770054/diff/41002/tools/cygprofile/cygprofile.cc
File tools/cygprofile/cygprofile.cc (right):

http://codereview.chromium.org/8770054/diff/41002/tools/cygprofile/cygprofile...
tools/cygprofile/cygprofile.cc:322: for (int i=0; i != buf_.size(); ++i) {
On 2012/05/15 22:59:54, brettw wrote:
> Style nit: spaces around =

Done.

http://codereview.chromium.org/8770054/diff/41002/tools/cygprofile/cygprofile...
tools/cygprofile/cygprofile.cc:344: for(unsigned int secs_to_sleep = 30;
secs_to_sleep != 0;)
On 2012/05/15 22:59:54, brettw wrote:
> Style nit: don't use unsigned here.

Done.

Powered by Google App Engine
This is Rietveld 408576698