Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 338880
b: refs/heads/master
c: 0bf79d4
h: refs/heads/master
v: v3
  • Loading branch information
Jiri Olsa authored and Ingo Molnar committed Oct 24, 2012
1 parent e7b0dad commit 8da7c89
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 6 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: 43c032febde48aabcf6d59f47cdcb7b5debbdc63
refs/heads/master: 0bf79d44133de42af01a70a1700b8bb4b6d3fb92
3 changes: 1 addition & 2 deletions trunk/arch/x86/kernel/cpu/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -1392,9 +1392,8 @@ static struct attribute_group x86_pmu_events_group = {
.attrs = events_attr,
};

ssize_t x86_event_sysfs_show(char *page, u64 config)
ssize_t x86_event_sysfs_show(char *page, u64 config, u64 event)
{
u64 event = (config & ARCH_PERFMON_EVENTSEL_EVENT);
u64 umask = (config & ARCH_PERFMON_EVENTSEL_UMASK) >> 8;
u64 cmask = (config & ARCH_PERFMON_EVENTSEL_CMASK) >> 24;
bool edge = (config & ARCH_PERFMON_EVENTSEL_EDGE);
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/x86/kernel/cpu/perf_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ static inline void set_linear_ip(struct pt_regs *regs, unsigned long ip)
regs->ip = ip;
}

ssize_t x86_event_sysfs_show(char *page, u64 config);
ssize_t x86_event_sysfs_show(char *page, u64 config, u64 event);

#ifdef CONFIG_CPU_SUP_AMD

Expand Down
9 changes: 9 additions & 0 deletions trunk/arch/x86/kernel/cpu/perf_event_amd.c
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,14 @@ amd_get_event_constraints_f15h(struct cpu_hw_events *cpuc, struct perf_event *ev
}
}

static ssize_t amd_event_sysfs_show(char *page, u64 config)
{
u64 event = (config & ARCH_PERFMON_EVENTSEL_EVENT) |
(config & AMD64_EVENTSEL_EVENT) >> 24;

return x86_event_sysfs_show(page, config, event);
}

static __initconst const struct x86_pmu amd_pmu = {
.name = "AMD",
.handle_irq = x86_pmu_handle_irq,
Expand All @@ -591,6 +599,7 @@ static __initconst const struct x86_pmu amd_pmu = {
.put_event_constraints = amd_put_event_constraints,

.format_attrs = amd_format_attr,
.events_sysfs_show = amd_event_sysfs_show,

.cpu_prepare = amd_pmu_cpu_prepare,
.cpu_starting = amd_pmu_cpu_starting,
Expand Down
11 changes: 9 additions & 2 deletions trunk/arch/x86/kernel/cpu/perf_event_intel.c
Original file line number Diff line number Diff line change
Expand Up @@ -1603,6 +1603,13 @@ static struct attribute *intel_arch_formats_attr[] = {
NULL,
};

ssize_t intel_event_sysfs_show(char *page, u64 config)
{
u64 event = (config & ARCH_PERFMON_EVENTSEL_EVENT);

return x86_event_sysfs_show(page, config, event);
}

static __initconst const struct x86_pmu core_pmu = {
.name = "core",
.handle_irq = x86_pmu_handle_irq,
Expand All @@ -1628,7 +1635,7 @@ static __initconst const struct x86_pmu core_pmu = {
.event_constraints = intel_core_event_constraints,
.guest_get_msrs = core_guest_get_msrs,
.format_attrs = intel_arch_formats_attr,
.events_sysfs_show = x86_event_sysfs_show,
.events_sysfs_show = intel_event_sysfs_show,
};

struct intel_shared_regs *allocate_shared_regs(int cpu)
Expand Down Expand Up @@ -1767,7 +1774,7 @@ static __initconst const struct x86_pmu intel_pmu = {
.pebs_aliases = intel_pebs_aliases_core2,

.format_attrs = intel_arch3_formats_attr,
.events_sysfs_show = x86_event_sysfs_show,
.events_sysfs_show = intel_event_sysfs_show,

.cpu_prepare = intel_pmu_cpu_prepare,
.cpu_starting = intel_pmu_cpu_starting,
Expand Down

0 comments on commit 8da7c89

Please sign in to comment.