diff options
author | markus@chromium.org <markus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-18 01:05:59 +0000 |
---|---|---|
committer | markus@chromium.org <markus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-18 01:05:59 +0000 |
commit | 62dc1f04051694ae381488ef44fad336c6260ad6 (patch) | |
tree | 52ddd2c05f774115269541940c3bb32ddffba215 /sandbox/linux/seccomp/debug.h | |
parent | ec64212b924d80d3ba5da864812b8dea1132854e (diff) | |
download | chromium_src-62dc1f04051694ae381488ef44fad336c6260ad6.zip chromium_src-62dc1f04051694ae381488ef44fad336c6260ad6.tar.gz chromium_src-62dc1f04051694ae381488ef44fad336c6260ad6.tar.bz2 |
Compute and pring the time that it takes to execute system calls. This data
is going to be skewed slightly, as calling gettimeofday() by itself also
takes a little bit of time. But it should be good enough to allow us to see
where we have performance bottlenecks.
TEST=none
BUG=none
Review URL: http://codereview.chromium.org/997009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41905 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sandbox/linux/seccomp/debug.h')
-rw-r--r-- | sandbox/linux/seccomp/debug.h | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/sandbox/linux/seccomp/debug.h b/sandbox/linux/seccomp/debug.h index 4201fbe..eb5a194 100644 --- a/sandbox/linux/seccomp/debug.h +++ b/sandbox/linux/seccomp/debug.h @@ -31,13 +31,23 @@ class Debug { // If debugging is enabled, write the name of the syscall and an optional // message to stderr. - static void syscall(int sysnum, const char* msg, int call = -1) + static void syscall(long long* tm, int sysnum, + const char* msg, int call = -1) #ifndef NDEBUG ; #else { } #endif + // Print how much wall-time has elapsed since the last call to syscall() + static void elapsed(long long tm, int sysnum, int call = -1) + #ifndef NDEBUG + ; + #else + { + } + #endif + // Check whether debugging is enabled. static bool isEnabled() { #ifndef NDEBUG @@ -50,12 +60,16 @@ class Debug { private: #ifndef NDEBUG Debug(); + static bool enter(); + static bool leave(); + static void _message(const char* msg); + static void gettimeofday(long long* tm); static char* itoa(char* s, int n); static Debug debug_; static bool enabled_; - static int numSyscallNames_; + static int numSyscallNames_; static const char **syscallNames_; static std::map<int, std::string> syscallNamesMap_; #endif |