Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 304896
b: refs/heads/master
c: b02ee9a
h: refs/heads/master
v: v3
  • Loading branch information
Minho Ban authored and Steven Rostedt committed May 8, 2012
1 parent a375f8b commit 5a85a55
Show file tree
Hide file tree
Showing 26 changed files with 160 additions and 788 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: cb04ff9ac424d0e689d9b612e9f73cb443ab4b7e
refs/heads/master: b02ee9a33b65bcc4ad13c12a0b04afdaab3ddd8d
3 changes: 2 additions & 1 deletion trunk/arch/alpha/kernel/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -824,6 +824,7 @@ static void alpha_perf_event_irq_handler(unsigned long la_ptr,

idx = la_ptr;

perf_sample_data_init(&data, 0);
for (j = 0; j < cpuc->n_events; j++) {
if (cpuc->current_idx[j] == idx)
break;
Expand All @@ -847,7 +848,7 @@ static void alpha_perf_event_irq_handler(unsigned long la_ptr,

hwc = &event->hw;
alpha_perf_event_update(event, hwc, idx, alpha_pmu->pmc_max_period[idx]+1);
perf_sample_data_init(&data, 0, hwc->last_period);
data.period = event->hw.last_period;

if (alpha_perf_event_set_period(event, hwc, idx)) {
if (perf_event_overflow(event, &data, regs)) {
Expand Down
4 changes: 3 additions & 1 deletion trunk/arch/arm/kernel/perf_event_v6.c
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,8 @@ armv6pmu_handle_irq(int irq_num,
*/
armv6_pmcr_write(pmcr);

perf_sample_data_init(&data, 0);

cpuc = &__get_cpu_var(cpu_hw_events);
for (idx = 0; idx < cpu_pmu->num_events; ++idx) {
struct perf_event *event = cpuc->events[idx];
Expand All @@ -507,7 +509,7 @@ armv6pmu_handle_irq(int irq_num,

hwc = &event->hw;
armpmu_event_update(event, hwc, idx);
perf_sample_data_init(&data, 0, hwc->last_period);
data.period = event->hw.last_period;
if (!armpmu_event_set_period(event, hwc, idx))
continue;

Expand Down
4 changes: 3 additions & 1 deletion trunk/arch/arm/kernel/perf_event_v7.c
Original file line number Diff line number Diff line change
Expand Up @@ -1077,6 +1077,8 @@ static irqreturn_t armv7pmu_handle_irq(int irq_num, void *dev)
*/
regs = get_irq_regs();

perf_sample_data_init(&data, 0);

cpuc = &__get_cpu_var(cpu_hw_events);
for (idx = 0; idx < cpu_pmu->num_events; ++idx) {
struct perf_event *event = cpuc->events[idx];
Expand All @@ -1095,7 +1097,7 @@ static irqreturn_t armv7pmu_handle_irq(int irq_num, void *dev)

hwc = &event->hw;
armpmu_event_update(event, hwc, idx);
perf_sample_data_init(&data, 0, hwc->last_period);
data.period = event->hw.last_period;
if (!armpmu_event_set_period(event, hwc, idx))
continue;

Expand Down
8 changes: 6 additions & 2 deletions trunk/arch/arm/kernel/perf_event_xscale.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,8 @@ xscale1pmu_handle_irq(int irq_num, void *dev)

regs = get_irq_regs();

perf_sample_data_init(&data, 0);

cpuc = &__get_cpu_var(cpu_hw_events);
for (idx = 0; idx < cpu_pmu->num_events; ++idx) {
struct perf_event *event = cpuc->events[idx];
Expand All @@ -261,7 +263,7 @@ xscale1pmu_handle_irq(int irq_num, void *dev)

hwc = &event->hw;
armpmu_event_update(event, hwc, idx);
perf_sample_data_init(&data, 0, hwc->last_period);
data.period = event->hw.last_period;
if (!armpmu_event_set_period(event, hwc, idx))
continue;

Expand Down Expand Up @@ -586,6 +588,8 @@ xscale2pmu_handle_irq(int irq_num, void *dev)

regs = get_irq_regs();

perf_sample_data_init(&data, 0);

cpuc = &__get_cpu_var(cpu_hw_events);
for (idx = 0; idx < cpu_pmu->num_events; ++idx) {
struct perf_event *event = cpuc->events[idx];
Expand All @@ -599,7 +603,7 @@ xscale2pmu_handle_irq(int irq_num, void *dev)

hwc = &event->hw;
armpmu_event_update(event, hwc, idx);
perf_sample_data_init(&data, 0, hwc->last_period);
data.period = event->hw.last_period;
if (!armpmu_event_set_period(event, hwc, idx))
continue;

Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/mips/kernel/perf_event_mipsxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1325,7 +1325,7 @@ static int mipsxx_pmu_handle_shared_irq(void)

regs = get_irq_regs();

perf_sample_data_init(&data, 0, 0);
perf_sample_data_init(&data, 0);

switch (counters) {
#define HANDLE_COUNTER(n) \
Expand Down
3 changes: 2 additions & 1 deletion trunk/arch/powerpc/perf/core-book3s.c
Original file line number Diff line number Diff line change
Expand Up @@ -1299,7 +1299,8 @@ static void record_and_restart(struct perf_event *event, unsigned long val,
if (record) {
struct perf_sample_data data;

perf_sample_data_init(&data, ~0ULL, event->hw.last_period);
perf_sample_data_init(&data, ~0ULL);
data.period = event->hw.last_period;

if (event->attr.sample_type & PERF_SAMPLE_ADDR)
perf_get_data_addr(regs, &data.addr);
Expand Down
3 changes: 2 additions & 1 deletion trunk/arch/powerpc/perf/core-fsl-emb.c
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,8 @@ static void record_and_restart(struct perf_event *event, unsigned long val,
if (record) {
struct perf_sample_data data;

perf_sample_data_init(&data, 0, event->hw.last_period);
perf_sample_data_init(&data, 0);
data.period = event->hw.last_period;

if (perf_event_overflow(event, &data, regs))
fsl_emb_pmu_stop(event, 0);
Expand Down
4 changes: 3 additions & 1 deletion trunk/arch/sparc/kernel/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -1296,6 +1296,8 @@ static int __kprobes perf_event_nmi_handler(struct notifier_block *self,

regs = args->regs;

perf_sample_data_init(&data, 0);

cpuc = &__get_cpu_var(cpu_hw_events);

/* If the PMU has the TOE IRQ enable bits, we need to do a
Expand All @@ -1319,7 +1321,7 @@ static int __kprobes perf_event_nmi_handler(struct notifier_block *self,
if (val & (1ULL << 31))
continue;

perf_sample_data_init(&data, 0, hwc->last_period);
data.period = event->hw.last_period;
if (!sparc_perf_event_set_period(event, hwc, idx))
continue;

Expand Down
5 changes: 0 additions & 5 deletions trunk/arch/x86/include/asm/msr-index.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,20 +134,15 @@
#define MSR_AMD64_IBSFETCHCTL 0xc0011030
#define MSR_AMD64_IBSFETCHLINAD 0xc0011031
#define MSR_AMD64_IBSFETCHPHYSAD 0xc0011032
#define MSR_AMD64_IBSFETCH_REG_COUNT 3
#define MSR_AMD64_IBSFETCH_REG_MASK ((1UL<<MSR_AMD64_IBSFETCH_REG_COUNT)-1)
#define MSR_AMD64_IBSOPCTL 0xc0011033
#define MSR_AMD64_IBSOPRIP 0xc0011034
#define MSR_AMD64_IBSOPDATA 0xc0011035
#define MSR_AMD64_IBSOPDATA2 0xc0011036
#define MSR_AMD64_IBSOPDATA3 0xc0011037
#define MSR_AMD64_IBSDCLINAD 0xc0011038
#define MSR_AMD64_IBSDCPHYSAD 0xc0011039
#define MSR_AMD64_IBSOP_REG_COUNT 7
#define MSR_AMD64_IBSOP_REG_MASK ((1UL<<MSR_AMD64_IBSOP_REG_COUNT)-1)
#define MSR_AMD64_IBSCTL 0xc001103a
#define MSR_AMD64_IBSBRTARGET 0xc001103b
#define MSR_AMD64_IBS_REG_COUNT_MAX 8 /* includes MSR_AMD64_IBSBRTARGET */

/* Fam 15h MSRs */
#define MSR_F15H_PERF_CTL 0xc0010200
Expand Down
8 changes: 2 additions & 6 deletions trunk/arch/x86/include/asm/perf_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ struct x86_pmu_capability {
#define IBS_CAPS_OPCNT (1U<<4)
#define IBS_CAPS_BRNTRGT (1U<<5)
#define IBS_CAPS_OPCNTEXT (1U<<6)
#define IBS_CAPS_RIPINVALIDCHK (1U<<7)

#define IBS_CAPS_DEFAULT (IBS_CAPS_AVAIL \
| IBS_CAPS_FETCHSAM \
Expand All @@ -171,22 +170,19 @@ struct x86_pmu_capability {
#define IBSCTL_LVT_OFFSET_VALID (1ULL<<8)
#define IBSCTL_LVT_OFFSET_MASK 0x0F

/* ibs fetch bits/masks */
/* IbsFetchCtl bits/masks */
#define IBS_FETCH_RAND_EN (1ULL<<57)
#define IBS_FETCH_VAL (1ULL<<49)
#define IBS_FETCH_ENABLE (1ULL<<48)
#define IBS_FETCH_CNT 0xFFFF0000ULL
#define IBS_FETCH_MAX_CNT 0x0000FFFFULL

/* ibs op bits/masks */
/* lower 4 bits of the current count are ignored: */
#define IBS_OP_CUR_CNT (0xFFFF0ULL<<32)
/* IbsOpCtl bits */
#define IBS_OP_CNT_CTL (1ULL<<19)
#define IBS_OP_VAL (1ULL<<18)
#define IBS_OP_ENABLE (1ULL<<17)
#define IBS_OP_MAX_CNT 0x0000FFFFULL
#define IBS_OP_MAX_CNT_EXT 0x007FFFFFULL /* not a register bit mask */
#define IBS_RIP_INVALID (1ULL<<38)

extern u32 get_ibs_caps(void);

Expand Down
4 changes: 3 additions & 1 deletion trunk/arch/x86/kernel/cpu/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -1183,6 +1183,8 @@ int x86_pmu_handle_irq(struct pt_regs *regs)
int idx, handled = 0;
u64 val;

perf_sample_data_init(&data, 0);

cpuc = &__get_cpu_var(cpu_hw_events);

/*
Expand Down Expand Up @@ -1217,7 +1219,7 @@ int x86_pmu_handle_irq(struct pt_regs *regs)
* event overflow
*/
handled++;
perf_sample_data_init(&data, 0, event->hw.last_period);
data.period = event->hw.last_period;

if (!x86_perf_event_set_period(event))
continue;
Expand Down
7 changes: 1 addition & 6 deletions trunk/arch/x86/kernel/cpu/perf_event_amd.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,8 @@ static u64 amd_pmu_event_map(int hw_event)

static int amd_pmu_hw_config(struct perf_event *event)
{
int ret;
int ret = x86_pmu_hw_config(event);

/* pass precise event sampling to ibs: */
if (event->attr.precise_ip && get_ibs_caps())
return -ENOENT;

ret = x86_pmu_hw_config(event);
if (ret)
return ret;

Expand Down
Loading

0 comments on commit 5a85a55

Please sign in to comment.