summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/command.c19
-rw-r--r--lib/event.c9
-rw-r--r--lib/frrevent.h2
3 files changed, 5 insertions, 25 deletions
diff --git a/lib/command.c b/lib/command.c
index affb551b45..1977dc4fae 100644
--- a/lib/command.c
+++ b/lib/command.c
@@ -477,33 +477,18 @@ static int config_write_host(struct vty *vty)
}
log_config_write(vty);
- /* print disable always, but enable only if default is flipped
- * => prep for future removal of compile-time knob
- */
if (!cputime_enabled)
vty_out(vty, "no service cputime-stats\n");
-#ifdef EXCLUDE_CPU_TIME
- else
- vty_out(vty, "service cputime-stats\n");
-#endif
if (!cputime_threshold)
vty_out(vty, "no service cputime-warning\n");
-#if defined(CONSUMED_TIME_CHECK) && CONSUMED_TIME_CHECK != 5000000
- else /* again, always print non-default */
-#else
- else if (cputime_threshold != 5000000)
-#endif
+ else if (cputime_threshold != CONSUMED_TIME_CHECK)
vty_out(vty, "service cputime-warning %lu\n",
cputime_threshold / 1000);
if (!walltime_threshold)
vty_out(vty, "no service walltime-warning\n");
-#if defined(CONSUMED_TIME_CHECK) && CONSUMED_TIME_CHECK != 5000000
- else /* again, always print non-default */
-#else
- else if (walltime_threshold != 5000000)
-#endif
+ else if (walltime_threshold != CONSUMED_TIME_CHECK)
vty_out(vty, "service walltime-warning %lu\n",
walltime_threshold / 1000);
diff --git a/lib/event.c b/lib/event.c
index 458e29f248..122d3cd9a1 100644
--- a/lib/event.c
+++ b/lib/event.c
@@ -75,14 +75,7 @@ static struct list *masters;
static void thread_free(struct event_loop *master, struct event *thread);
-#ifndef EXCLUDE_CPU_TIME
-#define EXCLUDE_CPU_TIME 0
-#endif
-#ifndef CONSUMED_TIME_CHECK
-#define CONSUMED_TIME_CHECK 0
-#endif
-
-bool cputime_enabled = !EXCLUDE_CPU_TIME;
+bool cputime_enabled = true;
unsigned long cputime_threshold = CONSUMED_TIME_CHECK;
unsigned long walltime_threshold = CONSUMED_TIME_CHECK;
diff --git a/lib/frrevent.h b/lib/frrevent.h
index ab779d9088..3f74df359b 100644
--- a/lib/frrevent.h
+++ b/lib/frrevent.h
@@ -18,6 +18,8 @@
extern "C" {
#endif
+#define CONSUMED_TIME_CHECK 5000000
+
extern bool cputime_enabled;
extern unsigned long cputime_threshold;
/* capturing wallclock time is always enabled since it is fast (reading