From 193e14e401c88d2d9e822a2474b0f777efff4958 Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Wed, 17 Jul 2024 02:17:59 +0300 Subject: [PATCH] lib: Rename `clear thread cpu ...` to `clear event cpu ...` Add a deprecation cycle also. Signed-off-by: Donatas Abraitis --- lib/event.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/lib/event.c b/lib/event.c index c04d309bc2..f4aa7c58b9 100644 --- a/lib/event.c +++ b/lib/event.c @@ -429,12 +429,15 @@ DEFUN_NOSH (show_event_poll, return CMD_SUCCESS; } -DEFUN (clear_thread_cpu, - clear_thread_cpu_cmd, - "clear thread cpu [FILTER]", +#if CONFDATE > 20241231 +CPP_NOTICE("Remove `clear thread cpu` command") +#endif +DEFUN (clear_event_cpu, + clear_event_cpu_cmd, + "clear event cpu [FILTER]", "Clear stored data in all pthreads\n" - "Thread information\n" - "Thread CPU usage\n" + "Event information\n" + "Event CPU usage\n" "Display filter (rwtexb)\n") { uint8_t filter = (uint8_t)-1U; @@ -454,6 +457,14 @@ DEFUN (clear_thread_cpu, return CMD_SUCCESS; } +ALIAS (clear_event_cpu, + clear_thread_cpu_cmd, + "clear thread cpu [FILTER]", + "Clear stored data in all pthreads\n" + "Thread information\n" + "Thread CPU usage\n" + "Display filter (rwtexb)\n") + static void show_event_timers_helper(struct vty *vty, struct event_loop *m) { const char *name = m->name ? m->name : "main"; @@ -494,6 +505,7 @@ void event_cmd_init(void) install_element(VIEW_NODE, &show_event_cpu_cmd); install_element(VIEW_NODE, &show_event_poll_cmd); install_element(ENABLE_NODE, &clear_thread_cpu_cmd); + install_element(ENABLE_NODE, &clear_event_cpu_cmd); install_element(CONFIG_NODE, &service_cputime_stats_cmd); install_element(CONFIG_NODE, &service_cputime_warning_cmd); -- 2.39.5