From: Arnaldo Carvalho de Melo Date: Thu, 22 Jan 2015 19:35:42 +0000 (-0300) Subject: tools lib fs debugfs: Check if debugfs is mounted when handling ENOENT X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f816b3cc99804a9f771315331deb36abec47f5b4;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git tools lib fs debugfs: Check if debugfs is mounted when handling ENOENT If debugfs was already mounted, then its a matter of not finding the tracepoint, tell the user that perhaps a CONFIG_ setting is not enabled. Cc: Adrian Hunter Cc: Borislav Petkov Cc: David Ahern Cc: Don Zickus Cc: Frederic Weisbecker Cc: Jiri Olsa Cc: Namhyung Kim Cc: Stephane Eranian Link: http://lkml.kernel.org/n/tip-6chfytoflyx3jwfqm7ebltu0@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/lib/api/fs/debugfs.c b/tools/lib/api/fs/debugfs.c index bf9e21648894..d2b18e887071 100644 --- a/tools/lib/api/fs/debugfs.c +++ b/tools/lib/api/fs/debugfs.c @@ -106,6 +106,13 @@ int debugfs__strerror_open(int err, char *buf, size_t size, const char *filename switch (err) { case ENOENT: + if (debugfs_found) { + snprintf(buf, size, + "Error:\tFile %s/%s not found.\n" + "Hint:\tPerhaps this kernel misses some CONFIG_ setting to enable this feature?.\n", + debugfs_mountpoint, filename); + break; + } snprintf(buf, size, "%s", "Error:\tUnable to find debugfs\n" "Hint:\tWas your kernel compiled with debugfs support?\n"