Commit 0a1b3b91 authored by sleffler@chromium.org's avatar sleffler@chromium.org

Correct process id for sandbox'd trace events.

Trace events collected from suid sandbox'd threads need to report
their real pid and not the sandbox'd pid so data can be correlated
with system event data.

BUG=chromium-os:27809
TEST=check sandbox'd trace data against the output of ps

Change-Id: Ia8c7725ac6e4f18a2114de027a5d19ba15f49e60


Review URL: http://codereview.chromium.org/10165015

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@133619 0039d316-1c4b-4281-b951-d872f2087c98
parent 37995e12
......@@ -16,6 +16,7 @@
#include "base/basictypes.h"
#include "base/command_line.h"
#include "base/debug/trace_event.h"
#include "base/eintr_wrapper.h"
#include "base/file_path.h"
#include "base/file_util.h"
......@@ -327,6 +328,10 @@ class Zygote {
// Sandboxed processes need to send the global, non-namespaced PID when
// setting up an IPC channel to their parent.
IPC::Channel::SetGlobalPid(real_pid);
// Force the real PID so chrome event data have a PID that corresponds
// to system trace event data.
base::debug::TraceLog::GetInstance()->SetProcessID(
static_cast<int>(real_pid));
#endif
close(pipe_fds[0]);
close(dummy_fd);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment