Hide Forgot
Description of problem: If corosync is built out-of-tree (using --srcdir to configure) then TOTEM logging doesn't print anything. Version-Release number of selected component (if applicable): How reproducible: Every time Steps to Reproduce: 1. configure corosync to build in a directory other than the source directory. eg: cd .. mkdir build cd build ../corosync/configure --srcdir==../corosync 2. build and install corosync 3. enable logging in corosync.conf eg DEBUG logging (easier to spot) 4. run corosync Actual results: All normal logging appears but there are no TOTEM messages Expected results: TOTEM messages should appear, as they do if corosync is built inside the source tree Additional info: This is caused by the source filenames (from __FILE__ at compilation time) having the configured path in them - in this example ../corosync/exec/totemudp.c etc. The list of totem source filenames passed to libqb loggin facility only has the basenames so the filenames never match up as libqb does an exact string match. I looked into fixing this in libqb but it causes a regression. We can't simply basename() the __FILE__ as it's common also to use __FILE__ to generate the logging source, and using basename() on both removes the distinction between similarly named files from different directories which could be a requirement. So I think this will need fixing in corosync. It's quite simple.
diff --git a/exec/main.c b/exec/main.c index 0ca5634..5fe2c4a 100644 --- a/exec/main.c +++ b/exec/main.c @@ -939,7 +939,7 @@ _logsys_log_printf(int level, int subsys, va_list ap; va_start(ap, format); - qb_log_from_external_source_va(function_name, file_name, + qb_log_from_external_source_va(function_name, basename(file_name), format, level, file_line, subsys, ap); va_end(ap);
commit d245831d65d16f39ef2fb800c66233dfddf475e3 Author: Christine Caulfield <ccaulfie> Date: Tue Apr 26 09:49:53 2016 +0100 logsys: fix TOTEM logging when corosync built out of tree
An improved patch for this: commit 1e2de52ef18c86140892766e97e06e5bf005e5f7 Author: Christine Caulfield <ccaulfie> Date: Tue May 3 11:05:02 2016 +0100 logging: Use our own version of basename basename() function has some potentially odd issues on other platforms. So, to be safe, here's an internal version. Signed-off-by: Christine Caulfield <ccaulfie> Reviewed-by: Jan Friesse <jfriesse>
Closing this 'UPSTREAM' as the patch is upstream and there is no point it in going into RHEL