#define DEBUGFS_MAGIC 0x64626720
#endif
+#ifndef TRACEFS_MAGIC
+#define TRACEFS_MAGIC 0x74726163
+#endif
+
static const char * const sysfs__fs_known_mountpoints[] = {
"/sys",
0,
0,
};
+
+#ifndef TRACEFS_DEFAULT_PATH
+#define TRACEFS_DEFAULT_PATH "/sys/kernel/tracing"
+#endif
+
+static const char * const tracefs__known_mountpoints[] = {
+ TRACEFS_DEFAULT_PATH,
+ "/sys/kernel/debug/tracing",
+ "/tracing",
+ "/trace",
+ 0,
+};
+
struct fs {
const char *name;
const char * const *mounts;
FS__SYSFS = 0,
FS__PROCFS = 1,
FS__DEBUGFS = 2,
+ FS__TRACEFS = 3,
};
+#ifndef TRACEFS_MAGIC
+#define TRACEFS_MAGIC 0x74726163
+#endif
+
static struct fs fs__entries[] = {
[FS__SYSFS] = {
.name = "sysfs",
.mounts = debugfs__known_mountpoints,
.magic = DEBUGFS_MAGIC,
},
+ [FS__TRACEFS] = {
+ .name = "tracefs",
+ .mounts = tracefs__known_mountpoints,
+ .magic = TRACEFS_MAGIC,
+ },
};
static bool fs__read_mounts(struct fs *fs)
FS__MOUNTPOINT(sysfs, FS__SYSFS);
FS__MOUNTPOINT(procfs, FS__PROCFS);
FS__MOUNTPOINT(debugfs, FS__DEBUGFS);
+FS__MOUNTPOINT(tracefs, FS__TRACEFS);
int filename__read_int(const char *filename, int *value)
{
const char *sysfs__mountpoint(void);
const char *procfs__mountpoint(void);
const char *debugfs__mountpoint(void);
+const char *tracefs__mountpoint(void);
int filename__read_int(const char *filename, int *value);
int sysctl__read_int(const char *sysctl, int *value);