Reached code profiler periodically interrupts threads in all Chrome processes
and stores process counter values as array of offsets. Later, this array may be
dumped to the disk or uploaded to a server for further analysis.
In order to collect samples this CL does following:
- Registers a signal handler early in the process creation. This handler writes
the current pc value into array. A signal handler is a process-global attribute
shared by all threads so every thread is able to handle a signal.
- Sets up an interval timer (via timer_create()) measuring CPU time consumed by
the calling process. This timer periodically calls SendSignalToAllThreads() on
a dedicated thread.
- SendSignalToAllThreads() has a cached list of all thread ids belonging
to the current process obtained by parsing /proc/self/task directory. It sends
a signal to all listed threads via tgkill() and periodically updates this list.
This allows to collect ~6000 samples per seconds from all threads.
This CL is based on lizeb@ work: https://crrev.com/c/1171233
Bug: 916263
Change-Id: I661ca6d65be694053458e2a6afa1dab62fd9812c
Reviewed-on: https://chromium-review.googlesource.com/c/1319597
Commit-Queue: Alexandr Ilin <alexilin@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Yaron Friedman <yfriedman@chromium.org>
Reviewed-by: ssid <ssid@chromium.org>
Reviewed-by: Egor Pasko <pasko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#620731}
This provides a mechanism for a renderer to change the priority of
its threads and as a result also the cpuset they are assigned to.
A ChildProcessHost IPC message from the renderer is used to request
a thread priority change and have the browser process identify the
renderer thread that is requesting a priority change by checking all
its threads to find a thread with NSpid field in
/proc/[pid]/task/[thread_id]/status that matches the namespace tid
from the renderer.
This is currently limited to Linux and ChromeOS but follow up work
will investigate the possibility and benefits of doing the same on
other platforms.
Note: Thread priorities in the renderer are already adjusted in a
similar way on Android as the sandbox is not strict enough to
prevent this on Android today.
BUG=chrome-os-partner:56550
TEST=
Review-Url: https://codereview.chromium.org/2334533002
Cr-Commit-Position: refs/heads/master@{#419649}
Since r266618, we require SCM_CREDENTIALS to work correctly across PID
namespaces, and refuse to run on kernels where it doesn't.
Reland of r270173. The original attempt failed to update kControlMsgSize,
which caused failures like this one:
http://build.chromium.org/p/chromium.linux/builders/Linux%20Tests%20%28dbg%29%281%29%2832%29/builds/5169
This is only noticed on 32-bit machines because CMSG_SPACE(sizeof(int))
happens to equal CMSG_SPACE(2*sizeof(int)) on x86-64 due to structure
padding and alignment, but they're different on i386.
Review URL: https://codereview.chromium.org/271703012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@270367 0039d316-1c4b-4281-b951-d872f2087c98
The last use was removed in r269530.
BUG=357670
Review URL: https://codereview.chromium.org/288463002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@270179 0039d316-1c4b-4281-b951-d872f2087c98
Since r266618, we require SCM_CREDENTIALS to work correctly across PID
namespaces, and refuse to run on kernels where it doesn't.
NOTRY=true
Review URL: https://codereview.chromium.org/283643004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@270173 0039d316-1c4b-4281-b951-d872f2087c98
We move the setuid sandbox "client" code to its own location in
/sandbox/linux/suid/client and we create a SetuidSandboxClient class
to use it.
NOTRY=true
Review URL: https://chromiumcodereview.appspot.com/10807059
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@147993 0039d316-1c4b-4281-b951-d872f2087c98
We introduce API versioning to the setuid sandbox and issue warnings when
the versions Chrome and the Sandbox expect are different.
1. The Zygote launcher in the browser will export the API version it expects
to the environment.
2. The setuid sandbox will match its own version with the one in the
environment.
3. Afterwards, it will export the API it provides to the environment for the
sandboxed process.
4. The Zygote (the sandboxed process) will in turn check for the API number.
The double check is needed because a version of the browser or of the setuid
sandbox that does check for API could co-exist with a version that does not.
The various utilities that are part of the setuid sandbox are not versioned
because they have callers that are external to Chrome (in ChromeOS).
When environment variables are not found, we assume version 0. Since the API
is for now set to 0, this change will not produce any warning at the moment.
BUG=None
TEST=None
Review URL: https://chromiumcodereview.appspot.com/10492006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@140456 0039d316-1c4b-4281-b951-d872f2087c98
Kernels newer than 2.6.32 support TID and PID namespacing where
processes' view of their TIDs and PIDs are not globally unique or
externally meaningful. We have workarounds to find the TID and PID of
the crashing process from outside in the browser process. However, we
were only assuming TID namespacing was happening if PID namespacing
was enabled and the kernel had a bug that was fixed since 2.6.38.
This change causes us to always treat the TID as subject to
namespacing. Our trick to find the TID relies on a procfs feature
added in 2008. We assume if that feature is not yet present that
the TID translation is not necessary.
This fixes the bug where all crashes of non-browser processes on Linux
2.6.38+ (Chrome OS r13+) are unusable (result in
UnspecifiedStackSignature).
BUG=chromium-os:15462
TEST=Do about:crash on 2.6.38 kernel and verify proper tid listed in
MDException block
Review URL: http://codereview.chromium.org/7190019
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89795 0039d316-1c4b-4281-b951-d872f2087c98
These symbols are used by chrome/browser/crash_handler_host_linux.cc when building with branding==Chrome, so they need to be exported for shared-library builds to work in that configuration.
BUG=none
TEST=builds
Review URL: http://codereview.chromium.org/7076007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86782 0039d316-1c4b-4281-b951-d872f2087c98
Reapply r83630, r83629, r83583, and fix the one compile error.
TBR=rvargas
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83740 0039d316-1c4b-4281-b951-d872f2087c98
Fix up includes, many files including base/win_util don't actually need it.
TEST=it compiles
BUG=none
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70341 0039d316-1c4b-4281-b951-d872f2087c98
On Mac and Linux, keep the client id in a global variable kept by the
child_process_logging implementations. This allows to read it in a
thread safe fashion when starting a child process.
Also replace std::string with statically allocated buffers for the
various items we add to the crash reports. This allows to properly
handle crashes upon shutdown (std::string would run its destructor,
invalidating the memory).
BUG=53231
TEST=Crash reporting should still work
Review URL: http://codereview.chromium.org/3186028
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57497 0039d316-1c4b-4281-b951-d872f2087c98
BUG=50273
TEST=everything still builds, build is 10% faster on windows, same speed on mac/linux
TBR: erg
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53716 0039d316-1c4b-4281-b951-d872f2087c98
BUG=48997
TEST=Google Chrome gets valid crash reports for about:crash most of the time.
Review URL: http://codereview.chromium.org/2961008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52723 0039d316-1c4b-4281-b951-d872f2087c98
This allows the shared code to build on the BSDs without
them needing to build _linux files.
Review URL: http://codereview.chromium.org/1701005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45380 0039d316-1c4b-4281-b951-d872f2087c98
On Hardy, the DESKTOP_SESSION environment variable is "xfce4" but on Karmic,
it is "xfce"
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/1572042
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44698 0039d316-1c4b-4281-b951-d872f2087c98
This will regress default startup time for users by 50ms. This doesn't matter
because this is what the users want--I've lost count of the number bloggers,
people on twitter, and people in our IRC channel complaining about the lack of
GTK+ integration...when it's just not on by default.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/1442001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42804 0039d316-1c4b-4281-b951-d872f2087c98
While we are at it, reap the sandbox process after it clones the zygote and figure out zygote's actual process id. Save the actual process id rather than that of the sandbox.
Original review: http://codereview.chromium.org/262020
This is try 2 - initialize the sandbox host and zygote for InProcessBrowserTest.
TBR=agl
BUG=20012, 20714, 23072
TEST=Process IDs for renderers should be correct in the task manager and you should be able to use the end process button to kill them.
Review URL: http://codereview.chromium.org/361002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30948 0039d316-1c4b-4281-b951-d872f2087c98
While we are at it, reap the sandbox process after it clones the zygote and figure out zygote's actual process id. Save the actual process id rather than that of the sandbox.
BUG=20012,20714,23072
TEST=Process IDs for renderers should be correct in the task manager and you should be able to use the end process button to kill them.
Review URL: http://codereview.chromium.org/262020
Review URL: http://codereview.chromium.org/359001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30939 0039d316-1c4b-4281-b951-d872f2087c98
While we are at it, reap the sandbox process after it clones the zygote and figure out zygote's actual process id. Save the actual process id rather than that of the sandbox.
BUG=20012,20714,23072
TEST=Process IDs for renderers should be correct in the task manager and you should be able to use the end process button to kill them.
Review URL: http://codereview.chromium.org/262020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30938 0039d316-1c4b-4281-b951-d872f2087c98
Currently it still only ever starts gnome-network-properties but it is now easy to update.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/174106
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23910 0039d316-1c4b-4281-b951-d872f2087c98
/etc/lsb-release does not exist on all distros, and sometimes it does
not provide any useful info. Whereas all LSB complaint distros return
useful data with the lsb_release command.
Review URL: http://codereview.chromium.org/155653
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20936 0039d316-1c4b-4281-b951-d872f2087c98