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

Unified Diff: sandbox/linux/seccomp/stat.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/socketcall.cc ('k') | sandbox/linux/seccomp/syscall.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/linux/seccomp/stat.cc
===================================================================
--- sandbox/linux/seccomp/stat.cc (revision 41782)
+++ sandbox/linux/seccomp/stat.cc (working copy)
@@ -8,7 +8,8 @@
namespace playground {
int Sandbox::sandbox_stat(const char *path, void *buf) {
- Debug::syscall(__NR_stat, "Executing handler");
+ long long tm;
+ Debug::syscall(&tm, __NR_stat, "Executing handler");
size_t len = strlen(path);
struct Request {
int sysnum;
@@ -31,11 +32,13 @@
read(sys, threadFdPub(), &rc, sizeof(rc)) != sizeof(rc)) {
die("Failed to forward stat() request [sandbox]");
}
+ Debug::elapsed(tm, __NR_stat);
return static_cast<int>(rc);
}
int Sandbox::sandbox_lstat(const char *path, void *buf) {
- Debug::syscall(__NR_lstat, "Executing handler");
+ long long tm;
+ Debug::syscall(&tm, __NR_lstat, "Executing handler");
size_t len = strlen(path);
struct Request {
int sysnum;
@@ -58,12 +61,14 @@
read(sys, threadFdPub(), &rc, sizeof(rc)) != sizeof(rc)) {
die("Failed to forward lstat() request [sandbox]");
}
+ Debug::elapsed(tm, __NR_lstat);
return static_cast<int>(rc);
}
#if defined(__NR_stat64)
int Sandbox::sandbox_stat64(const char *path, void *buf) {
- Debug::syscall(__NR_stat64, "Executing handler");
+ long long tm;
+ Debug::syscall(&tm, __NR_stat64, "Executing handler");
size_t len = strlen(path);
struct Request {
int sysnum;
@@ -86,11 +91,13 @@
read(sys, threadFdPub(), &rc, sizeof(rc)) != sizeof(rc)) {
die("Failed to forward stat64() request [sandbox]");
}
+ Debug::elapsed(tm, __NR_stat64);
return static_cast<int>(rc);
}
int Sandbox::sandbox_lstat64(const char *path, void *buf) {
- Debug::syscall(__NR_lstat64, "Executing handler");
+ long long tm;
+ Debug::syscall(&tm, __NR_lstat64, "Executing handler");
size_t len = strlen(path);
struct Request {
int sysnum;
@@ -113,6 +120,7 @@
read(sys, threadFdPub(), &rc, sizeof(rc)) != sizeof(rc)) {
die("Failed to forward lstat64() request [sandbox]");
}
+ Debug::elapsed(tm, __NR_lstat64);
return static_cast<int>(rc);
}
#endif
« no previous file with comments | « sandbox/linux/seccomp/socketcall.cc ('k') | sandbox/linux/seccomp/syscall.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698