diff options
| author | Anuradha Karuppiah <anuradhak@cumulusnetworks.com> | 2020-03-27 07:30:20 -0700 |
|---|---|---|
| committer | Anuradha Karuppiah <anuradhak@cumulusnetworks.com> | 2020-08-05 06:46:12 -0700 |
| commit | 0447957e62c83edb3d9e4da092742426551f4932 (patch) | |
| tree | 0eb8890964394d4a7038a2a0825f1eff561129f6 /lib/thread.h | |
| parent | 19bfb2748633e14ccc0c5e62bf116d647dbb7a7b (diff) | |
lib: timer: move the timer string api to lib
This api was earlier present in the daemon code but as multiple daemons
need it moving it to lib will avoid unnecessary copy-paste.
Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Diffstat (limited to 'lib/thread.h')
| -rw-r--r-- | lib/thread.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/thread.h b/lib/thread.h index 412a4d93bf..c22b2105cd 100644 --- a/lib/thread.h +++ b/lib/thread.h @@ -140,6 +140,8 @@ struct cpu_thread_history { /* Thread yield time. */ #define THREAD_YIELD_TIME_SLOT 10 * 1000L /* 10ms */ +#define THREAD_TIMER_STRLEN 12 + /* Macros. */ #define THREAD_ARG(X) ((X)->arg) #define THREAD_FD(X) ((X)->u.fd) @@ -228,6 +230,8 @@ extern unsigned long thread_consumed_time(RUSAGE_T *after, RUSAGE_T *before, /* only for use in logging functions! */ extern pthread_key_t thread_current; +extern char *thread_timer_to_hhmmss(char *buf, int buf_size, + struct thread *t_timer); #ifdef __cplusplus } |
