diff options
author | William Tu <u9012063@gmail.com> | 2020-03-23 07:44:48 -0700 |
---|---|---|
committer | William Tu <u9012063@gmail.com> | 2020-03-23 09:43:06 -0700 |
commit | ecd4a8fcdff2ebf35cdb36355167d34e99df6dd5 (patch) | |
tree | cd8b56bce4e2543e26bc403d711d1a0928b2cd7a /include/openvswitch | |
parent | c59922767ea3812763686613444a342e5daa67f7 (diff) | |
download | openvswitch-ecd4a8fcdff2ebf35cdb36355167d34e99df6dd5.tar.gz |
fatal-signal: Log backtrace when no monitor daemon.
Currently the backtrace logging is only available when monitor
daemon is running. This patch enables backtrace logging when
no monitor daemon exists. At signal handling context, it detects
whether monitor daemon exists. If not, write directly the backtrace
to the vlog fd. Note that using VLOG_* macro doesn't work due to
it's buffer I/O, so this patch directly issue write() syscall to
the file descriptor.
For some system we stop using monitor daemon and use systemd to
monitor ovs-vswitchd, thus need this patch. Example of
ovs-vswitchd.log (note that there is no timestamp printed):
2020-03-23T14:42:12.949Z|00049|memory|INFO|175332 kB peak resident
2020-03-23T14:42:12.949Z|00050|memory|INFO|handlers:2 ports:3 reva
SIGSEGV detected, backtrace:
0x0000000000486969 <fatal_signal_handler+0x49>
0x00007f7f5e57f4b0 <killpg+0x40>
0x000000000047daa8 <pmd_thread_main+0x238>
0x0000000000504edd <ovsthread_wrapper+0x7d>
0x00007f7f5f0476ba <start_thread+0xca>
0x00007f7f5e65141d <clone+0x6d>
0x0000000000000000 <+0x0>
Acked-by: Ben Pfaff <blp@ovn.org>
Signed-off-by: William Tu <u9012063@gmail.com>
Diffstat (limited to 'include/openvswitch')
-rw-r--r-- | include/openvswitch/vlog.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/openvswitch/vlog.h b/include/openvswitch/vlog.h index 19da4ab62..476bf3d6d 100644 --- a/include/openvswitch/vlog.h +++ b/include/openvswitch/vlog.h @@ -143,6 +143,9 @@ void vlog_set_syslog_method(const char *method); /* Configure syslog target. */ void vlog_set_syslog_target(const char *target); +/* Return the log_fd. */ +int vlog_get_fd(void); + /* Initialization. */ void vlog_init(void); void vlog_enable_async(void); |