Re: [PATCH 4/5] tools lib api fs: Add {tracefs,debugfs}_configured() functions

From: Jiri Olsa
Date: Sun Jan 25 2015 - 12:02:19 EST


On Sat, Jan 24, 2015 at 01:13:34PM -0500, Steven Rostedt wrote:

SNIP

> #include <sys/mount.h>
> #include <linux/kernel.h>
>
> @@ -24,6 +27,16 @@ static const char * const debugfs_known_mountpoints[] = {
>
> static bool debugfs_found;
>
> +bool debugfs_configured(void)
> +{
> + struct stat st;
> +
> + if (stat(DEBUGFS_DEFAULT_PATH, &st) < 0)
> + return false;
> +

hum, should this function rather do

bool debugfs_configured(void)
{
return debugfs_find_mountpoint() != NULL;
}


SNIP

> static bool tracefs_found;
>
> +bool tracefs_configured(void)
> +{
> + struct stat st;
> +
> + if (stat(TRACEFS_DEFAULT_PATH, &st) < 0)
> + return false;
> +
> + return true;
> +}

same for this one..

jirka
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/