diff options
| author | David Lamparter <equinox@diac24.net> | 2021-04-13 20:38:09 +0200 |
|---|---|---|
| committer | David Lamparter <equinox@opensourcerouting.org> | 2021-06-24 16:42:59 +0200 |
| commit | 45f0118832172d71dd19e437112e9907c60331f2 (patch) | |
| tree | af0a4d36c15759b8ad1bf4d3c6450aed492971ec /lib/thread.h | |
| parent | 94a64dab8650bcb017106cbd60d77211da43c815 (diff) | |
lib: make cputime checks runtime options (v2)
...really no reason to force this into a compile time decision. The
only point is avoiding the getrusage() syscall, which can easily be a
runtime decision.
[v2: also split cputime & walltime limits]
Signed-off-by: David Lamparter <equinox@diac24.net>
Diffstat (limited to 'lib/thread.h')
| -rw-r--r-- | lib/thread.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/thread.h b/lib/thread.h index fee728dbf9..737ed005c5 100644 --- a/lib/thread.h +++ b/lib/thread.h @@ -33,6 +33,13 @@ extern "C" { #endif +extern bool cputime_enabled; +extern unsigned long cputime_threshold; +/* capturing wallclock time is always enabled since it is fast (reading + * hardware TSC w/o syscalls) + */ +extern unsigned long walltime_threshold; + struct rusage_t { struct rusage cpu; struct timeval real; |
