* [RFC][PATCH v1 13/15] perf: export tracepoint events via sysfs: ext4, jbd2, xfs, gfs2
@ 2010-07-22 11:17 Lin Ming
0 siblings, 0 replies; only message in thread
From: Lin Ming @ 2010-07-22 11:17 UTC (permalink / raw)
To: Ingo Molnar
Cc: Robert Richter, Corey Ashford, Johannes Berg, Peter Zijlstra,
Greg KH, Frederic Weisbecker, Paul Mundt, eranian@gmail.com,
Gary.Mohr@Bull.com, arjan@linux.intel.com, Zhang, Yanmin,
Paul Mackerras, David S. Miller, Russell King,
Arnaldo Carvalho de Melo, Will Deacon, Maynard Johnson, Carl Love,
Kay Sievers, lkml, Thomas Gleixner, Steven Rostedt
ext4, jbd2, xfs, gfs2 tracepoint events are exported like below,
/sys/fs/events/
|-- ext4_alloc_da_blocks
| |-- config
| `-- type
....
....
|-- jbd2_checkpoint
| |-- config
| `-- type
....
....
|-- xfs_agf
| |-- config
| `-- type
....
....
|-- gfs2_block_alloc
| |-- config
| `-- type
....
....
---
fs/namespace.c | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/fs/namespace.c b/fs/namespace.c
index 88058de..b4bc3dd 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -29,6 +29,7 @@
#include <linux/log2.h>
#include <linux/idr.h>
#include <linux/fs_struct.h>
+#include <linux/perf_event.h>
#include <asm/uaccess.h>
#include <asm/unistd.h>
#include "pnode.h"
@@ -2305,6 +2306,20 @@ static void __init init_mount_tree(void)
set_fs_root(current->fs, &root);
}
+static void fs_sys_add_tp(struct kobject *kobj)
+{
+ struct kobject *events_kobj;
+
+ events_kobj = perf_sys_create_events_dir(kobj);
+ if (events_kobj)
+ return;
+
+ perf_sys_add_tp_events(events_kobj, "ext4");
+ perf_sys_add_tp_events(events_kobj, "jbd2");
+ perf_sys_add_tp_events(events_kobj, "xfs");
+ perf_sys_add_tp_events(events_kobj, "gfs2");
+}
+
void __init mnt_init(void)
{
unsigned u;
@@ -2332,6 +2347,8 @@ void __init mnt_init(void)
fs_kobj = kobject_create_and_add("fs", NULL);
if (!fs_kobj)
printk(KERN_WARNING "%s: kobj create error\n", __func__);
+ else
+ fs_sys_add_tp(fs_kobj);
init_rootfs();
init_mount_tree();
}
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2010-07-22 11:17 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-22 11:17 [RFC][PATCH v1 13/15] perf: export tracepoint events via sysfs: ext4, jbd2, xfs, gfs2 Lin Ming
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).