Skip to content

Commit

Permalink
Merge pull request FRRouting#14482 from opensourcerouting/fix/walltim…
Browse files Browse the repository at this point in the history
…e_threshold_disable

lib: Drop deprecated enable-time-check, enable-cpu-time compile options
  • Loading branch information
donaldsharp authored Sep 27, 2023
2 parents f289533 + fd0fe0b commit bb308b1
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 73 deletions.
26 changes: 0 additions & 26 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -721,10 +721,6 @@ AC_ARG_ENABLE([gcc_ultra_verbose],
AS_HELP_STRING([--enable-gcc-ultra-verbose], [enable ultra verbose GCC warnings]))
AC_ARG_ENABLE([backtrace],
AS_HELP_STRING([--disable-backtrace], [disable crash backtraces (default autodetect)]))
AC_ARG_ENABLE([time-check],
AS_HELP_STRING([--disable-time-check], [disable slow thread warning messages]))
AC_ARG_ENABLE([cpu-time],
AS_HELP_STRING([--disable-cpu-time], [disable cpu usage data gathering]))
AC_ARG_ENABLE([pcreposix],
AS_HELP_STRING([--enable-pcreposix], [enable using PCRE Posix libs for regex functions]))
AC_ARG_ENABLE([pcre2posix],
Expand Down Expand Up @@ -810,22 +806,6 @@ fi

AM_CONDITIONAL([NETLINK_DEBUG], [test "$enable_netlink_debug" != "no"])

if test "$enable_time_check" != "no" ; then
if test "$enable_time_check" = "yes" -o "$enable_time_check" = "" ; then
AC_DEFINE([CONSUMED_TIME_CHECK], [5000000], [Consumed Time Check])
else
AC_DEFINE_UNQUOTED([CONSUMED_TIME_CHECK], [$enable_time_check], [Consumed Time Check])
fi
fi

case "${enable_cpu_time}" in
"no")
AC_DEFINE([EXCLUDE_CPU_TIME], [1], [Exclude getrusage data gathering])
;;
"*")
;;
esac

if test "$enable_datacenter" = "yes" ; then
AC_DEFINE([HAVE_DATACENTER], [1], [Compile extensions for a DataCenter])
DFLT_NAME="datacenter"
Expand Down Expand Up @@ -2912,12 +2892,6 @@ directory and to the config files in the config file directory."
if test -n "$enable_datacenter"; then
AC_MSG_WARN([The --enable-datacenter compile time option is deprecated. Please modify the init script to pass -F datacenter to the daemons instead.])
fi
if test -n "$enable_time_check"; then
AC_MSG_WARN([The --enable-time-check compile time option is deprecated. Please use the service cputime-stats configuration option instead.])
fi
if test -n "$enable_cpu_time"; then
AC_MSG_WARN([The --enable-cpu-time compile time option is deprecated. Please use the service cputime-warning NNN configuration option instead.])
fi

if test "$enable_doc" != "no" -a "$frr_py_mod_sphinx" = "false"; then
AC_MSG_WARN([sphinx is missing but required to build documentation])
Expand Down
9 changes: 1 addition & 8 deletions doc/user/basic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,6 @@ Basic Config Commands
of some routine in FRR mistakenly blocking/hogging the processing loop and
should be reported as a FRR bug.

The default limit is 5 seconds (i.e. 5000), but this can be changed by the
deprecated ``--enable-time-check=...`` compile-time option.

This command has no effect if :clicmd:`service cputime-stats` is disabled.

.. clicmd:: service walltime-warning (1-4294967295)
Expand All @@ -106,9 +103,6 @@ Basic Config Commands
provide an immediate sign that FRR is not operating correctly due to
externally caused starvation.)

The default limit is 5 seconds as above, including the same deprecated
``--enable-time-check=...`` compile-time option.

.. clicmd:: log trap LEVEL

These commands are deprecated and are present only for historical
Expand Down Expand Up @@ -684,8 +678,7 @@ Terminal Mode Commands
This command displays system run statistics for all the different event
types. If no options is specified all different run types are displayed
together. Additionally you can ask to look at (r)ead, (w)rite, (t)imer,
(e)vent and e(x)ecute thread event types. If you have compiled with
disable-cpu-time then this command will not show up.
(e)vent and e(x)ecute thread event types.

.. clicmd:: show thread poll

Expand Down
14 changes: 0 additions & 14 deletions doc/user/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -351,20 +351,6 @@ options from the list below.

Use libpam for PAM support in vtysh.

.. option:: --enable-time-check XXX

This option is deprecated as it was replaced by the
:clicmd:`service cputime-stats` CLI command, which may be adjusted at
runtime rather than being a compile-time setting. See there for further
detail.

.. option:: --disable-cpu-time

This option is deprecated as it was replaced by the
:clicmd:`service cputime-warning NNN` CLI command, which may be adjusted at
runtime rather than being a compile-time setting. See there for further
detail.

.. option:: --enable-pcreposix

Turn on the usage of PCRE Posix libs for regex functionality.
Expand Down
19 changes: 2 additions & 17 deletions lib/command.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
9 changes: 1 addition & 8 deletions lib/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 2 additions & 0 deletions lib/frrevent.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bb308b1

Please sign in to comment.