mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
perf tools: Do not check debugfs MAGIC for tracing files
It's rather strange to be checking the debugfs MAGIC number for the tracing directory. A system admin may want to have a custom set of events to trace and it should be allowed to let the admin make a temp file (even for tracing virtual boxes, this is useful). Also with the coming tracefs, the files may not even be under debugfs, so checking the debugfs MAGIC number is pointless. Signed-off-by: Steven Rostedt <[email protected]> Acked-by: Jiri Olsa <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Masami Hiramatsu <[email protected]> Cc: Namhyung Kim <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
This commit is contained in:
parent
20f86fc1fd
commit
5693c92660
3 changed files with 14 additions and 34 deletions
|
|
@ -20,6 +20,20 @@ static const char * const debugfs_known_mountpoints[] = {
|
|||
|
||||
static bool debugfs_found;
|
||||
|
||||
/* verify that a mountpoint is actually a debugfs instance */
|
||||
|
||||
static int debugfs_valid_mountpoint(const char *debugfs)
|
||||
{
|
||||
struct statfs st_fs;
|
||||
|
||||
if (statfs(debugfs, &st_fs) < 0)
|
||||
return -ENOENT;
|
||||
else if ((long)st_fs.f_type != (long)DEBUGFS_MAGIC)
|
||||
return -ENOENT;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* find the path to the mounted debugfs */
|
||||
const char *debugfs_find_mountpoint(void)
|
||||
{
|
||||
|
|
@ -60,20 +74,6 @@ const char *debugfs_find_mountpoint(void)
|
|||
return debugfs_mountpoint;
|
||||
}
|
||||
|
||||
/* verify that a mountpoint is actually a debugfs instance */
|
||||
|
||||
int debugfs_valid_mountpoint(const char *debugfs)
|
||||
{
|
||||
struct statfs st_fs;
|
||||
|
||||
if (statfs(debugfs, &st_fs) < 0)
|
||||
return -ENOENT;
|
||||
else if ((long)st_fs.f_type != (long)DEBUGFS_MAGIC)
|
||||
return -ENOENT;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* mount the debugfs somewhere if it's not mounted */
|
||||
char *debugfs_mount(const char *mountpoint)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@
|
|||
#endif
|
||||
|
||||
const char *debugfs_find_mountpoint(void);
|
||||
int debugfs_valid_mountpoint(const char *debugfs);
|
||||
char *debugfs_mount(const char *mountpoint);
|
||||
|
||||
extern char debugfs_mountpoint[];
|
||||
|
|
|
|||
Loading…
Reference in a new issue