Skip to content

Commit

Permalink
Merge pull request #14211 from opensourcerouting/fix/backport_fedf911…
Browse files Browse the repository at this point in the history
…9a1964abf8e476f239d81b3f4ce385b1d_8.5

lib: Allow unsetting walltime-warning and cpu-warning
  • Loading branch information
donaldsharp authored Aug 16, 2023
2 parents 98c232f + c503809 commit 3d1b6c0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 26 deletions.
20 changes: 2 additions & 18 deletions lib/thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ DEFPY (service_cputime_stats,

DEFPY (service_cputime_warning,
service_cputime_warning_cmd,
"[no] service cputime-warning (1-4294967295)",
"[no] service cputime-warning ![(1-4294967295)]",
NO_STR
"Set up miscellaneous service\n"
"Warn for tasks exceeding CPU usage threshold\n"
Expand All @@ -381,16 +381,9 @@ DEFPY (service_cputime_warning,
return CMD_SUCCESS;
}

ALIAS (service_cputime_warning,
no_service_cputime_warning_cmd,
"no service cputime-warning",
NO_STR
"Set up miscellaneous service\n"
"Warn for tasks exceeding CPU usage threshold\n")

DEFPY (service_walltime_warning,
service_walltime_warning_cmd,
"[no] service walltime-warning (1-4294967295)",
"[no] service walltime-warning ![(1-4294967295)]",
NO_STR
"Set up miscellaneous service\n"
"Warn for tasks exceeding total wallclock threshold\n"
Expand All @@ -403,13 +396,6 @@ DEFPY (service_walltime_warning,
return CMD_SUCCESS;
}

ALIAS (service_walltime_warning,
no_service_walltime_warning_cmd,
"no service walltime-warning",
NO_STR
"Set up miscellaneous service\n"
"Warn for tasks exceeding total wallclock threshold\n")

static void show_thread_poll_helper(struct vty *vty, struct thread_master *m)
{
const char *name = m->name ? m->name : "main";
Expand Down Expand Up @@ -539,9 +525,7 @@ void thread_cmd_init(void)

install_element(CONFIG_NODE, &service_cputime_stats_cmd);
install_element(CONFIG_NODE, &service_cputime_warning_cmd);
install_element(CONFIG_NODE, &no_service_cputime_warning_cmd);
install_element(CONFIG_NODE, &service_walltime_warning_cmd);
install_element(CONFIG_NODE, &no_service_walltime_warning_cmd);

install_element(VIEW_NODE, &show_thread_timers_cmd);
}
Expand Down
12 changes: 4 additions & 8 deletions vtysh/vtysh_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -495,8 +495,7 @@ void vtysh_config_parse_line(void *arg, const char *line)
config = config_get(RPKI_NODE, line);
else {
if (strncmp(line, "log", strlen("log")) == 0 ||
strncmp(line, "hostname", strlen("hostname")) ==
0 ||
strncmp(line, "hostname", strlen("hostname")) == 0 ||
strncmp(line, "domainname", strlen("domainname")) ==
0 ||
strncmp(line, "allow-reserved-ranges",
Expand All @@ -508,12 +507,9 @@ void vtysh_config_parse_line(void *arg, const char *line)
strlen("no ip prefix-list")) == 0 ||
strncmp(line, "no ipv6 prefix-list",
strlen("no ipv6 prefix-list")) == 0 ||
strncmp(line, "service ", strlen("service ")) ==
0 ||
strncmp(line, "no service cputime-stats",
strlen("no service cputime-stats")) == 0 ||
strncmp(line, "service cputime-warning",
strlen("service cputime-warning")) == 0)
strncmp(line, "service ", strlen("service ")) == 0 ||
strncmp(line, "no service ",
strlen("no service ")) == 0)
config_add_line_uniq(config_top, line);
else
config_add_line(config_top, line);
Expand Down

0 comments on commit 3d1b6c0

Please sign in to comment.