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

Unified Diff: sandbox/linux/seccomp/ipc.cc

Issue 997009: Compute and pring the time that it takes to execute system calls. This data... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sandbox/linux/seccomp/ioctl.cc ('k') | sandbox/linux/seccomp/madvise.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/linux/seccomp/ipc.cc
===================================================================
--- sandbox/linux/seccomp/ipc.cc (revision 41782)
+++ sandbox/linux/seccomp/ipc.cc (working copy)
@@ -19,7 +19,8 @@
#if defined(__NR_shmget)
void* Sandbox::sandbox_shmat(int shmid, const void* shmaddr, int shmflg) {
- Debug::syscall(__NR_shmat, "Executing handler");
+ long long tm;
+ Debug::syscall(&tm, __NR_shmat, "Executing handler");
struct {
int sysnum;
@@ -39,11 +40,13 @@
read(sys, threadFdPub(), &rc, sizeof(rc)) != sizeof(rc)) {
die("Failed to forward shmat() request [sandbox]");
}
+ Debug::elapsed(tm, __NR_shmat);
return reinterpret_cast<void *>(rc);
}
int Sandbox::sandbox_shmctl(int shmid, int cmd, void* buf) {
- Debug::syscall(__NR_shmctl, "Executing handler");
+ long long tm;
+ Debug::syscall(&tm, __NR_shmctl, "Executing handler");
struct {
int sysnum;
@@ -63,11 +66,13 @@
read(sys, threadFdPub(), &rc, sizeof(rc)) != sizeof(rc)) {
die("Failed to forward shmctl() request [sandbox]");
}
+ Debug::elapsed(tm, __NR_shmctl);
return static_cast<int>(rc);
}
int Sandbox::sandbox_shmdt(const void* shmaddr) {
- Debug::syscall(__NR_shmdt, "Executing handler");
+ long long tm;
+ Debug::syscall(&tm, __NR_shmdt, "Executing handler");
struct {
int sysnum;
@@ -85,11 +90,13 @@
read(sys, threadFdPub(), &rc, sizeof(rc)) != sizeof(rc)) {
die("Failed to forward shmdt() request [sandbox]");
}
+ Debug::elapsed(tm, __NR_shmdt);
return static_cast<int>(rc);
}
int Sandbox::sandbox_shmget(int key, size_t size, int shmflg) {
- Debug::syscall(__NR_shmget, "Executing handler");
+ long long tm;
+ Debug::syscall(&tm, __NR_shmget, "Executing handler");
struct {
int sysnum;
@@ -109,6 +116,7 @@
read(sys, threadFdPub(), &rc, sizeof(rc)) != sizeof(rc)) {
die("Failed to forward shmget() request [sandbox]");
}
+ Debug::elapsed(tm, __NR_shmget);
return static_cast<int>(rc);
}
@@ -240,7 +248,8 @@
int Sandbox::sandbox_ipc(unsigned call, int first, int second, int third,
void* ptr, long fifth) {
- Debug::syscall(__NR_ipc, "Executing handler", call);
+ long long tm;
+ Debug::syscall(&tm, __NR_ipc, "Executing handler", call);
struct {
int sysnum;
long long cookie;
@@ -262,6 +271,7 @@
read(sys, threadFdPub(), &rc, sizeof(rc)) != sizeof(rc)) {
die("Failed to forward ipc() request [sandbox]");
}
+ Debug::elapsed(tm, __NR_ipc, call);
return static_cast<int>(rc);
}
« no previous file with comments | « sandbox/linux/seccomp/ioctl.cc ('k') | sandbox/linux/seccomp/madvise.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698