mirror of
https://github.com/openvswitch/ovs
synced 2025-09-01 06:45:17 +00:00
poll: Suppress logging for pmd threads.
'Unreasonably long poll interval's are reasonable for PMD threads. Also reporting of high CPU usage is not necessary. Signed-off-by: Ilya Maximets <i.maximets@samsung.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
This commit is contained in:
@@ -584,6 +584,15 @@ count_cpu_cores(void)
|
|||||||
|
|
||||||
return n_cores > 0 ? n_cores : 0;
|
return n_cores > 0 ? n_cores : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Returns 'true' if current thread is PMD thread. */
|
||||||
|
bool
|
||||||
|
thread_is_pmd(void)
|
||||||
|
{
|
||||||
|
const char *name = get_subprogram_name();
|
||||||
|
return !strncmp(name, "pmd", 3);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* ovsthread_key. */
|
/* ovsthread_key. */
|
||||||
|
|
||||||
|
@@ -523,5 +523,6 @@ bool may_fork(void);
|
|||||||
/* Useful functions related to threading. */
|
/* Useful functions related to threading. */
|
||||||
|
|
||||||
int count_cpu_cores(void);
|
int count_cpu_cores(void);
|
||||||
|
bool thread_is_pmd(void);
|
||||||
|
|
||||||
#endif /* ovs-thread.h */
|
#endif /* ovs-thread.h */
|
||||||
|
@@ -253,7 +253,9 @@ log_wakeup(const char *where, const struct pollfd *pollfd, int timeout)
|
|||||||
cpu_usage = get_cpu_usage();
|
cpu_usage = get_cpu_usage();
|
||||||
if (VLOG_IS_DBG_ENABLED()) {
|
if (VLOG_IS_DBG_ENABLED()) {
|
||||||
level = VLL_DBG;
|
level = VLL_DBG;
|
||||||
} else if (cpu_usage > 50 && !VLOG_DROP_INFO(&rl)) {
|
} else if (cpu_usage > 50
|
||||||
|
&& !thread_is_pmd()
|
||||||
|
&& !VLOG_DROP_INFO(&rl)) {
|
||||||
level = VLL_INFO;
|
level = VLL_INFO;
|
||||||
} else {
|
} else {
|
||||||
return;
|
return;
|
||||||
|
@@ -270,7 +270,7 @@ time_poll(struct pollfd *pollfds, int n_pollfds, HANDLE *handles OVS_UNUSED,
|
|||||||
time_init();
|
time_init();
|
||||||
coverage_clear();
|
coverage_clear();
|
||||||
coverage_run();
|
coverage_run();
|
||||||
if (*last_wakeup) {
|
if (*last_wakeup && !thread_is_pmd()) {
|
||||||
log_poll_interval(*last_wakeup);
|
log_poll_interval(*last_wakeup);
|
||||||
}
|
}
|
||||||
start = time_msec();
|
start = time_msec();
|
||||||
|
Reference in New Issue
Block a user