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>