HomeClusterLabs Projects

Refactor: libpacemaker: Filter out non-regular profile files

Description

Refactor: libpacemaker: Filter out non-regular profile files

profile_filter() previously did not check whether the file was a regular
file, because it didn't have access to the profiling directory path.
There is no user data argument. However, we can hack around this with a
global variable. This way, we don't end up with a "Timings" section of
the output if we're ultimately going to ignore all the files that passed
the scandir() filter.

glibc doesn't enforce PATH_MAX, so we shouldn't assume a path is less
than that. The overhead of crm_strdup_printf() calls is negligible
compared to profiling overhead and does not count toward profiling time.
https://www.gnu.org/software/libc/manual/html_node/Limits-for-Files.html

Signed-off-by: Reid Wahl <nrwahl@protonmail.com>

Details

Provenance
nrwahl2Authored on Sat, Mar 1, 3:48 AM
Parents
rPe49ec15335bc: Refactor: libcrmcommon: Simplify read_local_file()
Branches
Unknown
Tags
Unknown