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

Unified Diff: sandbox/linux/seccomp/syscall.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/stat.cc ('k') | sandbox/linux/seccomp/trusted_process.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/linux/seccomp/syscall.cc
===================================================================
--- sandbox/linux/seccomp/syscall.cc (revision 41782)
+++ sandbox/linux/seccomp/syscall.cc (working copy)
@@ -271,19 +271,20 @@
// these system calls are not restricted in Seccomp mode. But depending on
// the exact instruction sequence in libc, we might not be able to reliably
// filter out these system calls at the time when we instrument the code.
- SysCalls sys;
- long rc;
+ SysCalls sys;
+ long rc;
+ long long tm;
switch (syscallNum) {
case __NR_read:
- Debug::syscall(syscallNum, "Allowing unrestricted system call");
+ Debug::syscall(&tm, syscallNum, "Allowing unrestricted system call");
rc = sys.read((long)arg0, arg1, (size_t)arg2);
break;
case __NR_write:
- Debug::syscall(syscallNum, "Allowing unrestricted system call");
+ Debug::syscall(&tm, syscallNum, "Allowing unrestricted system call");
rc = sys.write((long)arg0, arg1, (size_t)arg2);
break;
case __NR_rt_sigreturn:
- Debug::syscall(syscallNum, "Allowing unrestricted system call");
+ Debug::syscall(&tm, syscallNum, "Allowing unrestricted system call");
rc = sys.rt_sigreturn((unsigned long)arg0);
break;
default:
@@ -295,7 +296,7 @@
if ((unsigned)syscallNum <= maxSyscall &&
syscallTable[syscallNum].handler == UNRESTRICTED_SYSCALL) {
- Debug::syscall(syscallNum, "Allowing unrestricted system call");
+ Debug::syscall(&tm, syscallNum, "Allowing unrestricted system call");
perform_unrestricted:
struct {
int sysnum;
@@ -309,9 +310,10 @@
read(sys, thread, &rc, sizeof(rc)) != sizeof(rc)) {
die("Failed to forward unrestricted system call");
}
+ Debug::elapsed(tm, syscallNum);
return rc;
} else if (Debug::isEnabled()) {
- Debug::syscall(syscallNum,
+ Debug::syscall(&tm, syscallNum,
"In production mode, this call would be disallowed");
goto perform_unrestricted;
} else {
@@ -321,6 +323,7 @@
if (rc < 0) {
rc = -sys.my_errno;
}
+ Debug::elapsed(tm, syscallNum);
return (void *)rc;
}
« no previous file with comments | « sandbox/linux/seccomp/stat.cc ('k') | sandbox/linux/seccomp/trusted_process.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698