Skip to content

RFC perf: export events in a structured way via sysfs

Lin Ming lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest15 patches 22 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/15perf: core, add functions to export events via sysfsinclude/linux/perf_event.h kernel/perf_event.c+123 -00 replies
2/15perf: export generic hardware events via sysfsarch/x86/kernel/cpu/perf_event.c include/linux/perf_event.h kernel/perf_event.c+120 -16 replies
3/15perf: export software events via sysfskernel/perf_event.c+61 -00 replies
4/15perf: export tracepoint events via sysfs: sched, raw_syscalls etc.include/linux/perf_event.h kernel/perf_event.c+54 -01 reply
5/15perf: export tracepoint events via sysfs: i915drivers/gpu/drm/i915/i915_drv.c+12 -10 replies
6/15perf: export tracepoint events via sysfs: iwlwifi and iwlwifi_iodrivers/net/wireless/iwlwifi/iwl3945-base.c+15 -010 replies
7/15perf: export tracepoint events via sysfs: blockfs/partitions/check.c+7 -00 replies
8/15perf: export tracepoint events via sysfs: kvm and kvm_mmuvirt/kvm/kvm_main.c+15 -00 replies
9/15perf: export tracepoint events via sysfs: mcearch/x86/kernel/cpu/mcheck/mce.c+2 -00 replies
10/15perf: export tracepoint events via sysfs: modulekernel/params.c+3 -00 replies
11/15perf: export tracepoint events via sysfs: powerkernel/power/main.c+4 -03 replies
12/15perf: export tracepoint events via sysfs: kmemmm/slub.c+3 -00 replies
13/15perf: export tracepoint events via sysfs: ext4, jbd2, xfs, gfs2fs/namespace.c+17 -00 replies
14/15perf: export tracepoint events via sysfs: scsidrivers/scsi/hosts.c+3 -00 replies
15/15perf: export tracepoint events via sysfs: mac80211drivers/base/class.c+12 -02 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC][PATCH v1 00/15] perf: export events in a structured way via sysfs

Hi, all

(CC driver maintainers since many device tracepoint events are exported)

This patch series is based on the discussion of [rfc] Describe events in a structured way via sysfs
http://lkml.org/lkml/2010/5/21/102

Applied on top of Peter's perf tree, perf-pmu branch.

Hareware/Software/Tracepoint events are exported in a structured way via sysfs, like below
I throw out these patches to see if various events are put under correct sysfs point.

Robert Richter and Corey Ashford have some ideas about what event attributes should be shown in sysfs, but now let's just show "config" and "type" for demo of sysfs structure.

And I'll document the sysfs ABI in later version.

1. Hardware events
/sys/devices/system/cpu/cpu0...cpuN/events

|-- L1-dcache-load-misses  ===> event name
|   |-- config             ===> config value for the event
|   `-- type               ===> event type
|-- cycles
|   |-- config
|   `-- type

.....

2. Software events
/sys/kernel/events

|-- page-faults
|   |-- config
|   `-- type
|-- context-switches
|   |-- config
|   `-- type

....

3. Tracepoint events
/sys/devices/pci0000:00/0000:00:02.0/events

|-- i915_gem_object_create
|   |-- config
|   `-- type
|-- i915_gem_object_bind
|   |-- config
|   `-- type
....
/sys/devices/system/kvm/kvm0/events
|-- kvm_entry
|   |-- config
|   `-- type
|-- kvm_hypercall
|   |-- config
|   `-- type

....

Welcome for any comment.

Thanks,
Lin Ming