]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
analyze: check both possible mount points of tracefs
authorLennart Poettering <lennart@poettering.net>
Thu, 28 Mar 2019 08:59:24 +0000 (09:59 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 29 Mar 2019 13:57:37 +0000 (14:57 +0100)
Let's try the new one first, the old one second.

src/analyze/analyze.c

index 87c5f0e43c8c028d9dd6427c6241d72e693b8fab..ac7cb0da630811057a3734b1974a3a3e2b5d37ee 100644 (file)
@@ -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;