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

Issue 217483006: Normalizing source file names before calculating hash (Closed)

Created:
6 years, 8 months ago by vadimt
Modified:
6 years, 8 months ago
CC:
chromium-reviews, Ilya Sherman, jar (doing other things), asvitkine+watch_chromium.org
Visibility:
Public.

Description

Normalizing source file names before calculating hash by extracting the last component of the file path. This hash is sent as TrackedObject.source_file_name_hash field. This solves the problem described in the bug to a degree that we can build a functioning prototype for the server-side analysis tool. The tool will use (filename:line) pair to identify a piece of code that posts a task, and extract parameters to PostTask (and similar) functions to conveniently identify the task. This solution is not final because the short filenames are not unique, and we’ll have about 6 conflicting pairs. This is OK for the proof-of-concept tool; further development might go in 1 of 2 different directions: 1. We like the results of the (file, line) method mentioned above, and we improve this solution, for example, by renaming files to make them unique. 2. We don’t like it, probably because of inconsistency of names on the server-side tool and the chrome://profiler page, and because it doesn’t show task entrypoints when the closure is created outside of the PostTask parameters list. In this case, we may want to explore adding an identifying parameter to the closure constructor. I’m not going to dive too deep into this, but we have a design for this. Anyways, in this case, we won’t use filename to identify tasks, and the fact that they are not unique will be OK. For the record, there were other alternatives to extracting the last component, mainly: 1. Post-preprocessing (sic!) or compile-time or post-compile step that normalizes file names. The issue was the high price (may be weeks of work), which is not OK for a proof-of-concept tool. For example, if we choose later to pass ID in the closure, this work would be wasted. 2. Identify the task by PC (program counter) instead of (file, line). This would require extending the UMA with a map of addresses of loaded modules, per process, and add 2 fields to TrackedObject: PC and module ID. This may be too much for a prototype. There also are some concerns regarding the server-side part of this approach. BUG=357787 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=261407

Patch Set 1 #

Total comments: 12

Patch Set 2 : isherman@ comments #

Patch Set 3 : Second round of comments. #

Total comments: 9

Patch Set 4 : N+1 st wave of comments #

Patch Set 5 : N+2 nd wave of comments. #

Total comments: 2

Patch Set 6 : Final nits #

Patch Set 7 : Rebasing #

Unified diffs Side-by-side diffs Delta from patch set Stats (+63 lines, -16 lines) Patch
M chrome/browser/metrics/metrics_log.cc View 1 2 3 4 5 6 2 chunks +10 lines, -1 line 0 comments Download
M chrome/browser/metrics/metrics_log_unittest.cc View 1 2 3 4 5 6 7 chunks +53 lines, -15 lines 0 comments Download

Messages

Total messages: 29 (0 generated)
vadimt
jar and/or isherman and/or asvitkine, please provide OWNERs approval.
6 years, 8 months ago (2014-03-28 23:44:35 UTC) #1
jar (doing other things)
https://codereview.chromium.org/217483006/diff/1/chrome/browser/metrics/metrics_log.cc File chrome/browser/metrics/metrics_log.cc (right): https://codereview.chromium.org/217483006/diff/1/chrome/browser/metrics/metrics_log.cc#newcode280 chrome/browser/metrics/metrics_log.cc:280: std::string NormalizeFileName(const std::string& file_name) { nit: The argument is ...
6 years, 8 months ago (2014-03-29 00:32:25 UTC) #2
vadimt
https://codereview.chromium.org/217483006/diff/1/chrome/browser/metrics/metrics_log.cc File chrome/browser/metrics/metrics_log.cc (right): https://codereview.chromium.org/217483006/diff/1/chrome/browser/metrics/metrics_log.cc#newcode280 chrome/browser/metrics/metrics_log.cc:280: std::string NormalizeFileName(const std::string& file_name) { In fact, the parameter ...
6 years, 8 months ago (2014-03-29 00:45:50 UTC) #3
jar (doing other things)
LGTM (but I'd like Ilya to chime in). https://codereview.chromium.org/217483006/diff/1/chrome/browser/metrics/metrics_log.cc File chrome/browser/metrics/metrics_log.cc (right): https://codereview.chromium.org/217483006/diff/1/chrome/browser/metrics/metrics_log.cc#newcode280 chrome/browser/metrics/metrics_log.cc:280: std::string ...
6 years, 8 months ago (2014-03-29 00:52:22 UTC) #4
Ilya Sherman
https://codereview.chromium.org/217483006/diff/1/chrome/browser/metrics/metrics_log.cc File chrome/browser/metrics/metrics_log.cc (right): https://codereview.chromium.org/217483006/diff/1/chrome/browser/metrics/metrics_log.cc#newcode290 chrome/browser/metrics/metrics_log.cc:290: return file_name.substr(i); IMO this method would be clearer if ...
6 years, 8 months ago (2014-03-29 01:06:49 UTC) #5
Ilya Sherman
6 years, 8 months ago (2014-03-29 01:07:47 UTC) #6
vadimt
https://codereview.chromium.org/217483006/diff/1/chrome/browser/metrics/metrics_log.cc File chrome/browser/metrics/metrics_log.cc (right): https://codereview.chromium.org/217483006/diff/1/chrome/browser/metrics/metrics_log.cc#newcode290 chrome/browser/metrics/metrics_log.cc:290: return file_name.substr(i); Yeah, but that is much less efficient, ...
6 years, 8 months ago (2014-03-31 18:10:14 UTC) #7
Ilya Sherman
https://codereview.chromium.org/217483006/diff/1/chrome/browser/metrics/metrics_log.cc File chrome/browser/metrics/metrics_log.cc (right): https://codereview.chromium.org/217483006/diff/1/chrome/browser/metrics/metrics_log.cc#newcode290 chrome/browser/metrics/metrics_log.cc:290: return file_name.substr(i); On 2014/03/31 18:10:14, vadimt wrote: > Yeah, ...
6 years, 8 months ago (2014-03-31 23:44:47 UTC) #8
vadimt
https://codereview.chromium.org/217483006/diff/1/chrome/browser/metrics/metrics_log.cc File chrome/browser/metrics/metrics_log.cc (right): https://codereview.chromium.org/217483006/diff/1/chrome/browser/metrics/metrics_log.cc#newcode290 chrome/browser/metrics/metrics_log.cc:290: return file_name.substr(i); Done, but using find_last_of. Looks OK?
6 years, 8 months ago (2014-04-01 18:24:10 UTC) #9
jar (doing other things)
https://codereview.chromium.org/217483006/diff/40001/chrome/browser/metrics/metrics_log.cc File chrome/browser/metrics/metrics_log.cc (right): https://codereview.chromium.org/217483006/diff/40001/chrome/browser/metrics/metrics_log.cc#newcode281 chrome/browser/metrics/metrics_log.cc:281: return file_name.substr(file_name.find_last_of("\\/") + 1); I think the code works... ...
6 years, 8 months ago (2014-04-01 18:46:12 UTC) #10
vadimt
https://codereview.chromium.org/217483006/diff/40001/chrome/browser/metrics/metrics_log.cc File chrome/browser/metrics/metrics_log.cc (right): https://codereview.chromium.org/217483006/diff/40001/chrome/browser/metrics/metrics_log.cc#newcode281 chrome/browser/metrics/metrics_log.cc:281: return file_name.substr(file_name.find_last_of("\\/") + 1); It's not a problem for ...
6 years, 8 months ago (2014-04-01 18:59:01 UTC) #11
jar (doing other things)
LGTM https://codereview.chromium.org/217483006/diff/40001/chrome/browser/metrics/metrics_log.cc File chrome/browser/metrics/metrics_log.cc (right): https://codereview.chromium.org/217483006/diff/40001/chrome/browser/metrics/metrics_log.cc#newcode281 chrome/browser/metrics/metrics_log.cc:281: return file_name.substr(file_name.find_last_of("\\/") + 1); On 2014/04/01 18:59:01, vadimt ...
6 years, 8 months ago (2014-04-01 19:16:16 UTC) #12
Ilya Sherman
https://codereview.chromium.org/217483006/diff/40001/chrome/browser/metrics/metrics_log.cc File chrome/browser/metrics/metrics_log.cc (right): https://codereview.chromium.org/217483006/diff/40001/chrome/browser/metrics/metrics_log.cc#newcode281 chrome/browser/metrics/metrics_log.cc:281: return file_name.substr(file_name.find_last_of("\\/") + 1); On 2014/04/01 19:16:17, jar wrote: ...
6 years, 8 months ago (2014-04-02 06:56:15 UTC) #13
vadimt
https://codereview.chromium.org/217483006/diff/40001/chrome/browser/metrics/metrics_log.cc File chrome/browser/metrics/metrics_log.cc (right): https://codereview.chromium.org/217483006/diff/40001/chrome/browser/metrics/metrics_log.cc#newcode281 chrome/browser/metrics/metrics_log.cc:281: return file_name.substr(file_name.find_last_of("\\/") + 1); On 2014/04/02 06:56:15, Ilya Sherman ...
6 years, 8 months ago (2014-04-02 17:50:25 UTC) #14
Ilya Sherman
https://codereview.chromium.org/217483006/diff/40001/chrome/browser/metrics/metrics_log_unittest.cc File chrome/browser/metrics/metrics_log_unittest.cc (right): https://codereview.chromium.org/217483006/diff/40001/chrome/browser/metrics/metrics_log_unittest.cc#newcode592 chrome/browser/metrics/metrics_log_unittest.cc:592: EXPECT_EQ(MetricsLogBase::Hash("file3"), On 2014/04/02 17:50:25, vadimt wrote: > Replacing with ...
6 years, 8 months ago (2014-04-02 22:55:16 UTC) #15
vadimt
https://codereview.chromium.org/217483006/diff/40001/chrome/browser/metrics/metrics_log_unittest.cc File chrome/browser/metrics/metrics_log_unittest.cc (right): https://codereview.chromium.org/217483006/diff/40001/chrome/browser/metrics/metrics_log_unittest.cc#newcode592 chrome/browser/metrics/metrics_log_unittest.cc:592: EXPECT_EQ(MetricsLogBase::Hash("file3"), How about this?
6 years, 8 months ago (2014-04-03 00:41:47 UTC) #16
Ilya Sherman
LGTM % a final nit. Thanks, Vadim! https://codereview.chromium.org/217483006/diff/80001/chrome/browser/metrics/metrics_log_unittest.cc File chrome/browser/metrics/metrics_log_unittest.cc (right): https://codereview.chromium.org/217483006/diff/80001/chrome/browser/metrics/metrics_log_unittest.cc#newcode475 chrome/browser/metrics/metrics_log_unittest.cc:475: metrics::HashMetricName("birth_thread*")); nit: ...
6 years, 8 months ago (2014-04-03 00:49:57 UTC) #17
vadimt
https://codereview.chromium.org/217483006/diff/80001/chrome/browser/metrics/metrics_log_unittest.cc File chrome/browser/metrics/metrics_log_unittest.cc (right): https://codereview.chromium.org/217483006/diff/80001/chrome/browser/metrics/metrics_log_unittest.cc#newcode475 chrome/browser/metrics/metrics_log_unittest.cc:475: metrics::HashMetricName("birth_thread*")); On 2014/04/03 00:49:58, Ilya Sherman wrote: > nit: ...
6 years, 8 months ago (2014-04-03 00:54:54 UTC) #18
vadimt
The CQ bit was checked by vadimt@chromium.org
6 years, 8 months ago (2014-04-03 00:54:59 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/vadimt@chromium.org/217483006/100001
6 years, 8 months ago (2014-04-03 01:00:59 UTC) #20
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-04-03 01:23:10 UTC) #21
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.chromium on win_chromium_compile_dbg
6 years, 8 months ago (2014-04-03 01:23:11 UTC) #22
vadimt
The CQ bit was checked by vadimt@chromium.org
6 years, 8 months ago (2014-04-03 01:37:14 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/vadimt@chromium.org/217483006/120001
6 years, 8 months ago (2014-04-03 01:50:23 UTC) #24
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-04-03 08:37:22 UTC) #25
commit-bot: I haz the power
Commit queue rejected this change because the description was changed between the time the change ...
6 years, 8 months ago (2014-04-03 08:37:22 UTC) #26
vadimt
The CQ bit was checked by vadimt@chromium.org
6 years, 8 months ago (2014-04-03 14:24:01 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/vadimt@chromium.org/217483006/120001
6 years, 8 months ago (2014-04-03 14:24:17 UTC) #28
commit-bot: I haz the power
6 years, 8 months ago (2014-04-03 15:25:02 UTC) #29
Message was sent while issue was closed.
Change committed as 261407

Powered by Google App Engine
This is Rietveld 408576698