Prev: [RFC][PATCH v1 12/15] perf: export tracepoint events via sysfs: kmem
Next: [RFC][PATCH v1 02/15] perf: export generic hardware events via sysfs
From: Lin Ming on 22 Jul 2010 07:20 Block tracepoint events are exported like below, /sys/devices/pci0000:00/0000:00:1f.1/host0/target0:0:0/0:0:0:0/block/sda/events |-- block_bio_backmerge | |-- config | `-- type |-- block_bio_bounce | |-- config | `-- type |-- block_bio_complete | |-- config | `-- type |-- block_bio_frontmerge ...... /sys/devices/pci0000:00/0000:00:1f.1/host0/target0:0:0/0:0:0:0/block/sda/sda1/events |-- block_bio_backmerge | |-- config | `-- type |-- block_bio_bounce | |-- config | `-- type |-- block_bio_complete | |-- config | `-- type |-- block_bio_frontmerge ...... /sys/devices/pci0000:00/0000:00:1f.2/host2/target2:0:0/2:0:0:0/block/sr0/events /sys/devices/virtual/block/ram0/events ..... /sys/devices/virtual/block/ram15/events /sys/devices/virtual/block/loop0/events ..... /sys/devices/virtual/block/loop7/events /sys/devices/virtual/block/md0/events --- fs/partitions/check.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/fs/partitions/check.c b/fs/partitions/check.c index 72c5265..e18ac81 100644 --- a/fs/partitions/check.c +++ b/fs/partitions/check.c @@ -21,6 +21,7 @@ #include <linux/ctype.h> #include <linux/genhd.h> #include <linux/blktrace_api.h> +#include <linux/perf_event.h> #include "check.h" @@ -446,6 +447,9 @@ struct hd_struct *add_partition(struct gendisk *disk, int partno, if (err) goto out_put; + /* For example, /sys/block/sda1/events/ */ + perf_sys_add_tp(&pdev->kobj, "block"); + err = -ENOMEM; p->holder_dir = kobject_create_and_add("holders", &pdev->kobj); if (!p->holder_dir) @@ -506,6 +510,9 @@ void register_disk(struct gendisk *disk) device_del(ddev); return; } + + /* For example, /sys/block/sda/events/ */ + perf_sys_add_tp(&ddev->kobj, "block"); #endif disk->part0.holder_dir = kobject_create_and_add("holders", &ddev->kobj); disk->slave_dir = kobject_create_and_add("slaves", &ddev->kobj); -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ |