summaryrefslogtreecommitdiffstats
path: root/sandbox/linux/seccomp/debug.h
diff options
context:
space:
mode:
Diffstat (limited to 'sandbox/linux/seccomp/debug.h')
-rw-r--r--sandbox/linux/seccomp/debug.h18
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