summaryrefslogtreecommitdiff
path: root/lib/event.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2022-12-11 10:51:58 -0500
committerDonald Sharp <sharpd@nvidia.com>2023-03-24 08:32:17 -0400
commit5f6eaa9b9668f3f09fbf6b1dc4e0645e07f641c9 (patch)
treed8639a3f042a0de1e66bad71d330205619052b6e /lib/event.c
parent70c35c11f2af5f169db446ef02ac0dda7b2822fc (diff)
*: Convert a bunch of thread_XX to event_XX
Convert these functions: thread_getrusage thread_cmd_init thread_consumed_time thread_timer_to_hhmmss thread_is_scheduled thread_ignore_late_timer Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'lib/event.c')
-rw-r--r--lib/event.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/event.c b/lib/event.c
index 59f8928d1b..f5f9c95401 100644
--- a/lib/event.c
+++ b/lib/event.c
@@ -516,7 +516,7 @@ DEFPY_NOSH (show_thread_timers,
return CMD_SUCCESS;
}
-void thread_cmd_init(void)
+void event_cmd_init(void)
{
install_element(VIEW_NODE, &show_thread_cpu_cmd);
install_element(VIEW_NODE, &show_thread_poll_cmd);
@@ -737,7 +737,7 @@ unsigned long event_timer_remain_msec(struct event *thread)
{
int64_t remain;
- if (!thread_is_scheduled(thread))
+ if (!event_is_scheduled(thread))
return 0;
frr_with_mutex (&thread->mtx) {
@@ -780,7 +780,7 @@ static int time_hhmmss(char *buf, int buf_size, long sec)
return wr != 8;
}
-char *thread_timer_to_hhmmss(char *buf, int buf_size, struct event *t_timer)
+char *event_timer_to_hhmmss(char *buf, int buf_size, struct event *t_timer)
{
if (t_timer) {
time_hhmmss(buf, buf_size, event_timer_remain_second(t_timer));
@@ -1865,8 +1865,8 @@ static unsigned long timeval_elapsed(struct timeval a, struct timeval b)
+ (a.tv_usec - b.tv_usec));
}
-unsigned long thread_consumed_time(RUSAGE_T *now, RUSAGE_T *start,
- unsigned long *cputime)
+unsigned long event_consumed_time(RUSAGE_T *now, RUSAGE_T *start,
+ unsigned long *cputime)
{
#ifdef HAVE_CLOCK_THREAD_CPUTIME_ID
@@ -1927,7 +1927,7 @@ void event_set_yield_time(struct event *thread, unsigned long yield_time)
}
}
-void thread_getrusage(RUSAGE_T *r)
+void event_getrusage(RUSAGE_T *r)
{
monotime(&r->real);
if (!cputime_enabled) {
@@ -1993,7 +1993,7 @@ void event_call(struct event *thread)
unsigned long walltime, cputime;
unsigned long exp;
- walltime = thread_consumed_time(&after, &before, &cputime);
+ walltime = event_consumed_time(&after, &before, &cputime);
/* update walltime */
atomic_fetch_add_explicit(&thread->hist->real.total, walltime,