From 196f30679536182e3e6083acdab1a28c0aeba561 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 28 Mar 2019 09:59:24 +0100 Subject: [PATCH] analyze: check both possible mount points of tracefs Let's try the new one first, the old one second. --- src/analyze/analyze.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/analyze/analyze.c b/src/analyze/analyze.c index 87c5f0e..ac7cb0d 100644 --- a/src/analyze/analyze.c +++ b/src/analyze/analyze.c @@ -1519,9 +1519,15 @@ static int load_kernel_syscalls(Set **ret) { /* Let's read the available system calls from the list of available tracing events. Slightly dirty, but good * enough for analysis purposes. */ - f = fopen("/sys/kernel/debug/tracing/available_events", "re"); - if (!f) - return log_full_errno(IN_SET(errno, EPERM, EACCES, ENOENT) ? LOG_DEBUG : LOG_WARNING, errno, "Can't read open /sys/kernel/debug/tracing/available_events: %m"); + f = fopen("/sys/kernel/tracing/available_events", "re"); + if (!f) { + /* We tried the non-debugfs mount point and that didn't work. If it wasn't mounted, maybe the + * old debugfs mount point works? */ + f = fopen("/sys/kernel/debug/tracing/available_events", "re"); + if (!f) + return log_full_errno(IN_SET(errno, EPERM, EACCES, ENOENT) ? LOG_DEBUG : LOG_WARNING, errno, + "Can't read open tracefs' available_events file: %m"); + } for (;;) { _cleanup_free_ char *line = NULL; -- 2.7.4