Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 350031
b: refs/heads/master
c: 2663960
h: refs/heads/master
i:
  350029: f0e85b4
  350027: b5ab9dc
  350023: 2efc298
  350015: 6dfbc2c
v: v3
  • Loading branch information
Sukadev Bhattiprolu authored and Arnaldo Carvalho de Melo committed Jan 31, 2013
1 parent cfb576a commit cb58863
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bbdc7aa442630a84feae45f4ca2dd7ed01abc868
refs/heads/master: 2663960c159f23cbfb8e196c96e9fc9f3b5f1a8d
13 changes: 3 additions & 10 deletions trunk/arch/x86/kernel/cpu/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -1310,11 +1310,6 @@ static struct attribute_group x86_pmu_format_group = {
.attrs = NULL,
};

struct perf_pmu_events_attr {
struct device_attribute attr;
u64 id;
};

/*
* Remove all undefined events (x86_pmu.event_map(id) == 0)
* out of events_attr attributes.
Expand Down Expand Up @@ -1348,11 +1343,9 @@ static ssize_t events_sysfs_show(struct device *dev, struct device_attribute *at
#define EVENT_VAR(_id) event_attr_##_id
#define EVENT_PTR(_id) &event_attr_##_id.attr.attr

#define EVENT_ATTR(_name, _id) \
static struct perf_pmu_events_attr EVENT_VAR(_id) = { \
.attr = __ATTR(_name, 0444, events_sysfs_show, NULL), \
.id = PERF_COUNT_HW_##_id, \
};
#define EVENT_ATTR(_name, _id) \
PMU_EVENT_ATTR(_name, EVENT_VAR(_id), PERF_COUNT_HW_##_id, \
events_sysfs_show)

EVENT_ATTR(cpu-cycles, CPU_CYCLES );
EVENT_ATTR(instructions, INSTRUCTIONS );
Expand Down
11 changes: 11 additions & 0 deletions trunk/include/linux/perf_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -817,6 +817,17 @@ do { \
} while (0)


struct perf_pmu_events_attr {
struct device_attribute attr;
u64 id;
};

#define PMU_EVENT_ATTR(_name, _var, _id, _show) \
static struct perf_pmu_events_attr _var = { \
.attr = __ATTR(_name, 0444, _show, NULL), \
.id = _id, \
};

#define PMU_FORMAT_ATTR(_name, _format) \
static ssize_t \
_name##_show(struct device *dev, \
Expand Down

0 comments on commit cb58863

Please sign in to comment.