mirror of
https://github.com/openvswitch/ovs
synced 2025-08-22 01:51:26 +00:00
timeval: Add coverage counter for long poll interval events.
Martin Kennelly observes that even though this data is available to humans via the journal/log files, these aren't exactly easy for a developer to make any kind of behavioral inferences. This kind of log and counter would be useful when checking on system health to let us know that an Open vSwitch component is noticing some kind of system level hiccup. Add a new coverage counter to track information on these events, and let a developer or system engineer know how long these events have occurred with some historical context. Reported-at: https://lists.linuxfoundation.org/pipermail/ovs-discuss/2023-June/052523.html Suggested-by: Martin Kennelly <mkennell@redhat.com> Co-Authored-By: Aaron Conole <aconole@redhat.com> Signed-off-by: Eelco Chaudron <echaudro@redhat.com> Acked-by: Simon Horman <horms@ovn.org> Acked-by: Ilya Maximets <i.maximets@ovn.org> Signed-off-by: Aaron Conole <aconole@redhat.com>
This commit is contained in:
parent
969b3a5706
commit
05d6f419cd
@ -41,6 +41,8 @@
|
||||
|
||||
VLOG_DEFINE_THIS_MODULE(timeval);
|
||||
|
||||
COVERAGE_DEFINE(long_poll_interval);
|
||||
|
||||
#if !defined(HAVE_CLOCK_GETTIME)
|
||||
typedef unsigned int clockid_t;
|
||||
static int clock_gettime(clock_t id, struct timespec *ts);
|
||||
@ -644,6 +646,8 @@ log_poll_interval(long long int last_wakeup)
|
||||
const struct rusage *last_rusage = get_recent_rusage();
|
||||
struct rusage rusage;
|
||||
|
||||
COVERAGE_INC(long_poll_interval);
|
||||
|
||||
if (!getrusage_thread(&rusage)) {
|
||||
VLOG_WARN("Unreasonably long %lldms poll interval"
|
||||
" (%lldms user, %lldms system)",
|
||||
|
Loading…
x
Reference in New Issue
Block a user