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

Issue 1173263004: [tracing] Send unique tracing process id for cross-process memory dumps identification. (Closed)

Created:
5 years, 6 months ago by ssid
Modified:
5 years, 6 months ago
CC:
chromium-reviews, creis+watch_chromium.org, darin-cc_chromium.org, erikwright+watch_chromium.org, nasko+codewatch_chromium.org, tracing+reviews_chromium.org, wfh+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[tracing] Send unique tracing process id for cross-process memory dumps identification. The memory shared between browser and renderer must be identified with the same unique id for memory dumps in tracing. Currently the child process is not aware of its unique child process id. But, the child process id cannot be exposed in the child process (see discussion in crrev.com/1155683009). So, a hash of the child process id allocated by the browser process is sent to child process along with begin tracing message and will be exposed in the child process MemoryDumpManager. The allocator that needs to create a global guid will use the id to identify memory dumps. See the design doc https://goo.gl/ncMfUV for more details. BUG=497726 Committed: https://crrev.com/a3e7c30a16e711b59226da21f993522ee47ac674 Cr-Commit-Position: refs/heads/master@{#336210}

Patch Set 1 #

Total comments: 6

Patch Set 2 : Fixing nits. #

Total comments: 12

Patch Set 3 : Addressing comments. #

Patch Set 4 : Nits. #

Patch Set 5 : Rebase. #

Total comments: 7

Patch Set 6 : Using hash of the id and not sending id to child process. #

Patch Set 7 : Nits. #

Total comments: 11

Patch Set 8 : Using constant instead of hash #

Total comments: 3

Patch Set 9 : adding comments. #

Total comments: 5

Patch Set 10 : Changing back to hash of id as jam suggested. #

Total comments: 1

Patch Set 11 : Using reinterpret_cast instead of ascii conversion before hashing. #

Total comments: 2

Patch Set 12 : added size arg for hash. #

Total comments: 6

Patch Set 13 : Fixed DCHECK. #

Patch Set 14 : fixed InvalidTracingProcessId value. #

Patch Set 15 : Fixing DCHECK while setting id. #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+72 lines, -11 lines) Patch
M base/trace_event/memory_dump_manager.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 5 chunks +35 lines, -0 lines 0 comments Download
M base/trace_event/memory_dump_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +12 lines, -0 lines 1 comment Download
M components/tracing/child_trace_message_filter.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +2 lines, -1 line 0 comments Download
M components/tracing/child_trace_message_filter.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +7 lines, -1 line 0 comments Download
M components/tracing/tracing_messages.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +3 lines, -2 lines 0 comments Download
M content/browser/browser_child_process_host_impl.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/browser/renderer_host/pepper/browser_ppapi_host_impl.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/browser/renderer_host/render_process_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -1 line 0 comments Download
M content/browser/tracing/trace_message_filter.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +4 lines, -1 line 0 comments Download
M content/browser/tracing/trace_message_filter.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +6 lines, -3 lines 0 comments Download

Messages

Total messages: 47 (10 generated)
ssid
5 years, 6 months ago (2015-06-16 14:43:39 UTC) #2
picksi
https://codereview.chromium.org/1173263004/diff/1/base/trace_event/memory_allocator_dump_guid.cc File base/trace_event/memory_allocator_dump_guid.cc (right): https://codereview.chromium.org/1173263004/diff/1/base/trace_event/memory_allocator_dump_guid.cc#newcode17 base/trace_event/memory_allocator_dump_guid.cc:17: const char kReplaceChildIdStr[] = "$$"; Random thought: Are we ...
5 years, 6 months ago (2015-06-16 16:18:37 UTC) #4
ssid
PTAL. https://codereview.chromium.org/1173263004/diff/1/base/trace_event/memory_allocator_dump_guid.cc File base/trace_event/memory_allocator_dump_guid.cc (right): https://codereview.chromium.org/1173263004/diff/1/base/trace_event/memory_allocator_dump_guid.cc#newcode17 base/trace_event/memory_allocator_dump_guid.cc:17: const char kReplaceChildIdStr[] = "$$"; On 2015/06/16 16:18:37, ...
5 years, 6 months ago (2015-06-19 10:18:15 UTC) #5
Primiano Tucci (use gerrit)
LGTM with some comments. +jam for OWNER review. John, this is essentially a re-write after ...
5 years, 6 months ago (2015-06-19 13:47:50 UTC) #7
ssid
Made changes. Thanks https://codereview.chromium.org/1173263004/diff/20001/base/trace_event/memory_allocator_dump_guid.cc File base/trace_event/memory_allocator_dump_guid.cc (right): https://codereview.chromium.org/1173263004/diff/20001/base/trace_event/memory_allocator_dump_guid.cc#newcode14 base/trace_event/memory_allocator_dump_guid.cc:14: int unique_child_process_id = -1; On 2015/06/19 ...
5 years, 6 months ago (2015-06-19 14:51:19 UTC) #8
ssid
+dcheng for 2 line change in components/tracing/tracing_messages.h
5 years, 6 months ago (2015-06-19 15:21:02 UTC) #10
dcheng
https://codereview.chromium.org/1173263004/diff/80001/base/trace_event/memory_allocator_dump_guid.cc File base/trace_event/memory_allocator_dump_guid.cc (right): https://codereview.chromium.org/1173263004/diff/80001/base/trace_event/memory_allocator_dump_guid.cc#newcode18 base/trace_event/memory_allocator_dump_guid.cc:18: uint64 ExpandChildProcessIdAndHash(std::string guid_str) { const std::string& https://codereview.chromium.org/1173263004/diff/80001/components/tracing/child_trace_message_filter.cc File components/tracing/child_trace_message_filter.cc ...
5 years, 6 months ago (2015-06-20 00:36:28 UTC) #11
Primiano Tucci (use gerrit)
https://codereview.chromium.org/1173263004/diff/80001/base/trace_event/memory_allocator_dump_guid.cc File base/trace_event/memory_allocator_dump_guid.cc (right): https://codereview.chromium.org/1173263004/diff/80001/base/trace_event/memory_allocator_dump_guid.cc#newcode18 base/trace_event/memory_allocator_dump_guid.cc:18: uint64 ExpandChildProcessIdAndHash(std::string guid_str) { On 2015/06/20 00:36:27, dcheng wrote: ...
5 years, 6 months ago (2015-06-20 12:32:31 UTC) #12
Primiano Tucci (use gerrit)
5 years, 6 months ago (2015-06-20 12:32:33 UTC) #13
ssid
https://codereview.chromium.org/1173263004/diff/80001/base/trace_event/memory_allocator_dump_guid.cc File base/trace_event/memory_allocator_dump_guid.cc (right): https://codereview.chromium.org/1173263004/diff/80001/base/trace_event/memory_allocator_dump_guid.cc#newcode18 base/trace_event/memory_allocator_dump_guid.cc:18: uint64 ExpandChildProcessIdAndHash(std::string guid_str) { On 2015/06/20 12:32:31, Primiano Tucci ...
5 years, 6 months ago (2015-06-20 13:07:24 UTC) #14
jam
https://codereview.chromium.org/1173263004/diff/80001/components/tracing/child_trace_message_filter.cc File components/tracing/child_trace_message_filter.cc (right): https://codereview.chromium.org/1173263004/diff/80001/components/tracing/child_trace_message_filter.cc#newcode63 components/tracing/child_trace_message_filter.cc:63: int child_process_id) { On 2015/06/20 13:07:24, ssid wrote: > ...
5 years, 6 months ago (2015-06-22 16:20:14 UTC) #16
ssid
On 2015/06/22 16:20:14, jam wrote: > https://codereview.chromium.org/1173263004/diff/80001/components/tracing/child_trace_message_filter.cc > File components/tracing/child_trace_message_filter.cc (right): > > https://codereview.chromium.org/1173263004/diff/80001/components/tracing/child_trace_message_filter.cc#newcode63 > ...
5 years, 6 months ago (2015-06-22 16:25:49 UTC) #17
jam
On 2015/06/22 16:25:49, ssid wrote: > On 2015/06/22 16:20:14, jam wrote: > > > https://codereview.chromium.org/1173263004/diff/80001/components/tracing/child_trace_message_filter.cc ...
5 years, 6 months ago (2015-06-22 16:35:25 UTC) #18
Primiano Tucci (use gerrit)
https://codereview.chromium.org/1173263004/diff/140001/base/trace_event/memory_dump_manager.h File base/trace_event/memory_dump_manager.h (right): https://codereview.chromium.org/1173263004/diff/140001/base/trace_event/memory_dump_manager.h#newcode85 base/trace_event/memory_dump_manager.h:85: // Sets the unique hash value for identifying child ...
5 years, 6 months ago (2015-06-23 13:35:21 UTC) #20
dcheng
(Am I still supposed to review this? This disappeared from my list of reviews, so ...
5 years, 6 months ago (2015-06-23 21:56:21 UTC) #21
Primiano Tucci (use gerrit)
On 2015/06/23 21:56:21, dcheng wrote: > (Am I still supposed to review this? This disappeared ...
5 years, 6 months ago (2015-06-23 22:10:05 UTC) #22
ssid
Made changes, PTAL https://codereview.chromium.org/1173263004/diff/140001/base/trace_event/memory_dump_manager.h File base/trace_event/memory_dump_manager.h (right): https://codereview.chromium.org/1173263004/diff/140001/base/trace_event/memory_dump_manager.h#newcode85 base/trace_event/memory_dump_manager.h:85: // Sets the unique hash value ...
5 years, 6 months ago (2015-06-24 08:37:58 UTC) #23
Primiano Tucci (use gerrit)
LGTM with some comments. Re-add jam when done https://codereview.chromium.org/1173263004/diff/160001/base/trace_event/memory_dump_manager.cc File base/trace_event/memory_dump_manager.cc (right): https://codereview.chromium.org/1173263004/diff/160001/base/trace_event/memory_dump_manager.cc#newcode440 base/trace_event/memory_dump_manager.cc:440: return ...
5 years, 6 months ago (2015-06-24 09:31:00 UTC) #24
ssid
PTAL now, I have changed the CL to send a hash of the child id.
5 years, 6 months ago (2015-06-24 09:47:42 UTC) #26
picksi
Some drive-by comments from London to Bangalore! https://codereview.chromium.org/1173263004/diff/180001/base/trace_event/memory_dump_manager.cc File base/trace_event/memory_dump_manager.cc (right): https://codereview.chromium.org/1173263004/diff/180001/base/trace_event/memory_dump_manager.cc#newcode438 base/trace_event/memory_dump_manager.cc:438: return 1000 ...
5 years, 6 months ago (2015-06-24 11:12:44 UTC) #27
jam
https://codereview.chromium.org/1173263004/diff/180001/base/trace_event/memory_dump_manager.cc File base/trace_event/memory_dump_manager.cc (right): https://codereview.chromium.org/1173263004/diff/180001/base/trace_event/memory_dump_manager.cc#newcode438 base/trace_event/memory_dump_manager.cc:438: return 1000 + child_process_id; why is this guessable? i.e. ...
5 years, 6 months ago (2015-06-24 16:38:15 UTC) #28
ssid
On 2015/06/24 16:38:15, jam wrote: > https://codereview.chromium.org/1173263004/diff/180001/base/trace_event/memory_dump_manager.cc > File base/trace_event/memory_dump_manager.cc (right): > > https://codereview.chromium.org/1173263004/diff/180001/base/trace_event/memory_dump_manager.cc#newcode438 > ...
5 years, 6 months ago (2015-06-24 16:41:27 UTC) #29
ssid
updated to use hash again..
5 years, 6 months ago (2015-06-24 16:55:17 UTC) #30
jam
lgtm
5 years, 6 months ago (2015-06-24 17:03:09 UTC) #31
Primiano Tucci (use gerrit)
LGTM, ship it once dcheng approves https://codereview.chromium.org/1173263004/diff/180001/base/trace_event/memory_dump_manager.cc File base/trace_event/memory_dump_manager.cc (right): https://codereview.chromium.org/1173263004/diff/180001/base/trace_event/memory_dump_manager.cc#newcode438 base/trace_event/memory_dump_manager.cc:438: return 1000 + ...
5 years, 6 months ago (2015-06-24 17:47:35 UTC) #32
dcheng
https://codereview.chromium.org/1173263004/diff/220001/base/trace_event/memory_dump_manager.cc File base/trace_event/memory_dump_manager.cc (right): https://codereview.chromium.org/1173263004/diff/220001/base/trace_event/memory_dump_manager.cc#newcode439 base/trace_event/memory_dump_manager.cc:439: return Hash(reinterpret_cast<const char*>(&child_process_id)); Don't you need to pass a ...
5 years, 6 months ago (2015-06-24 19:05:36 UTC) #33
ssid
Sorry, done. https://codereview.chromium.org/1173263004/diff/220001/base/trace_event/memory_dump_manager.cc File base/trace_event/memory_dump_manager.cc (right): https://codereview.chromium.org/1173263004/diff/220001/base/trace_event/memory_dump_manager.cc#newcode439 base/trace_event/memory_dump_manager.cc:439: return Hash(reinterpret_cast<const char*>(&child_process_id)); On 2015/06/24 19:05:36, dcheng ...
5 years, 6 months ago (2015-06-24 19:11:07 UTC) #34
dcheng
https://codereview.chromium.org/1173263004/diff/240001/base/trace_event/memory_dump_manager.cc File base/trace_event/memory_dump_manager.cc (right): https://codereview.chromium.org/1173263004/diff/240001/base/trace_event/memory_dump_manager.cc#newcode439 base/trace_event/memory_dump_manager.cc:439: return Hash(reinterpret_cast<const char*>(&child_process_id), What happens if this just happens ...
5 years, 6 months ago (2015-06-24 20:34:07 UTC) #35
ssid
https://codereview.chromium.org/1173263004/diff/240001/base/trace_event/memory_dump_manager.cc File base/trace_event/memory_dump_manager.cc (right): https://codereview.chromium.org/1173263004/diff/240001/base/trace_event/memory_dump_manager.cc#newcode439 base/trace_event/memory_dump_manager.cc:439: return Hash(reinterpret_cast<const char*>(&child_process_id), On 2015/06/24 20:34:06, dcheng wrote: > ...
5 years, 6 months ago (2015-06-25 02:35:49 UTC) #36
dcheng
https://codereview.chromium.org/1173263004/diff/240001/base/trace_event/memory_dump_manager.cc File base/trace_event/memory_dump_manager.cc (right): https://codereview.chromium.org/1173263004/diff/240001/base/trace_event/memory_dump_manager.cc#newcode439 base/trace_event/memory_dump_manager.cc:439: return Hash(reinterpret_cast<const char*>(&child_process_id), On 2015/06/25 at 02:35:49, ssid wrote: ...
5 years, 6 months ago (2015-06-25 02:45:39 UTC) #37
ssid
PTAL. https://codereview.chromium.org/1173263004/diff/240001/base/trace_event/memory_dump_manager.cc File base/trace_event/memory_dump_manager.cc (right): https://codereview.chromium.org/1173263004/diff/240001/base/trace_event/memory_dump_manager.cc#newcode439 base/trace_event/memory_dump_manager.cc:439: return Hash(reinterpret_cast<const char*>(&child_process_id), On 2015/06/25 02:45:39, dcheng wrote: ...
5 years, 6 months ago (2015-06-25 04:04:09 UTC) #39
dcheng
ipc changes lgtm
5 years, 6 months ago (2015-06-25 17:18:23 UTC) #40
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1173263004/320001
5 years, 6 months ago (2015-06-25 17:48:56 UTC) #43
commit-bot: I haz the power
Committed patchset #15 (id:320001)
5 years, 6 months ago (2015-06-25 18:38:12 UTC) #44
commit-bot: I haz the power
Patchset 15 (id:??) landed as https://crrev.com/a3e7c30a16e711b59226da21f993522ee47ac674 Cr-Commit-Position: refs/heads/master@{#336210}
5 years, 6 months ago (2015-06-25 18:40:13 UTC) #45
Mike Wittman
A revert of this CL (patchset #15 id:320001) has been created in https://codereview.chromium.org/1211883003/ by wittman@chromium.org. ...
5 years, 6 months ago (2015-06-25 19:40:19 UTC) #46
dcheng
5 years, 6 months ago (2015-06-25 20:28:37 UTC) #47
Message was sent while issue was closed.
https://codereview.chromium.org/1173263004/diff/320001/base/trace_event/memor...
File base/trace_event/memory_dump_manager.cc (right):

https://codereview.chromium.org/1173263004/diff/320001/base/trace_event/memor...
base/trace_event/memory_dump_manager.cc:138:
MemoryDumpManager::ChildProcessIdToTracingProcessId(-1);
FYI, this introduces a static initializer. Sorry I didn't catch this.

Powered by Google App Engine
This is Rietveld 408576698