Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 288723
b: refs/heads/master
c: 2481c5f
h: refs/heads/master
i:
  288721: c2a1684
  288719: c15306a
v: v3
  • Loading branch information
Stephane Eranian authored and Ingo Molnar committed Mar 5, 2012
1 parent 9bba971 commit 1038616
Show file tree
Hide file tree
Showing 10 changed files with 58 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3e702ff6d1ea12dcf1c798ecb61e7f3a1579df42
refs/heads/master: 2481c5fa6db0237e4f0168f88913178b2b495b7c
4 changes: 4 additions & 0 deletions trunk/arch/alpha/kernel/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,10 @@ static int alpha_pmu_event_init(struct perf_event *event)
{
int err;

/* does not support taken branch sampling */
if (has_branch_stack(event))
return -EOPNOTSUPP;

switch (event->attr.type) {
case PERF_TYPE_RAW:
case PERF_TYPE_HARDWARE:
Expand Down
4 changes: 4 additions & 0 deletions trunk/arch/arm/kernel/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,10 @@ static int armpmu_event_init(struct perf_event *event)
int err = 0;
atomic_t *active_events = &armpmu->active_events;

/* does not support taken branch sampling */
if (has_branch_stack(event))
return -EOPNOTSUPP;

if (armpmu->map_event(event) == -ENOENT)
return -ENOENT;

Expand Down
4 changes: 4 additions & 0 deletions trunk/arch/mips/kernel/perf_event_mipsxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,10 @@ static int mipspmu_event_init(struct perf_event *event)
{
int err = 0;

/* does not support taken branch sampling */
if (has_branch_stack(event))
return -EOPNOTSUPP;

switch (event->attr.type) {
case PERF_TYPE_RAW:
case PERF_TYPE_HARDWARE:
Expand Down
4 changes: 4 additions & 0 deletions trunk/arch/powerpc/kernel/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -1084,6 +1084,10 @@ static int power_pmu_event_init(struct perf_event *event)
if (!ppmu)
return -ENOENT;

/* does not support taken branch sampling */
if (has_branch_stack(event))
return -EOPNOTSUPP;

switch (event->attr.type) {
case PERF_TYPE_HARDWARE:
ev = event->attr.config;
Expand Down
4 changes: 4 additions & 0 deletions trunk/arch/sh/kernel/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,10 @@ static int sh_pmu_event_init(struct perf_event *event)
{
int err;

/* does not support taken branch sampling */
if (has_branch_stack(event))
return -EOPNOTSUPP;

switch (event->attr.type) {
case PERF_TYPE_RAW:
case PERF_TYPE_HW_CACHE:
Expand Down
4 changes: 4 additions & 0 deletions trunk/arch/sparc/kernel/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -1105,6 +1105,10 @@ static int sparc_pmu_event_init(struct perf_event *event)
if (atomic_read(&nmi_active) < 0)
return -ENODEV;

/* does not support taken branch sampling */
if (has_branch_stack(event))
return -EOPNOTSUPP;

switch (attr->type) {
case PERF_TYPE_HARDWARE:
if (attr->config >= sparc_pmu->max_events)
Expand Down
3 changes: 3 additions & 0 deletions trunk/arch/x86/kernel/cpu/perf_event_amd.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ static int amd_pmu_hw_config(struct perf_event *event)
if (ret)
return ret;

if (has_branch_stack(event))
return -EOPNOTSUPP;

if (event->attr.exclude_host && event->attr.exclude_guest)
/*
* When HO == GO == 1 the hardware treats that as GO == HO == 0
Expand Down
24 changes: 24 additions & 0 deletions trunk/kernel/events/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -5044,6 +5044,12 @@ static int perf_swevent_init(struct perf_event *event)
if (event->attr.type != PERF_TYPE_SOFTWARE)
return -ENOENT;

/*
* no branch sampling for software events
*/
if (has_branch_stack(event))
return -EOPNOTSUPP;

switch (event_id) {
case PERF_COUNT_SW_CPU_CLOCK:
case PERF_COUNT_SW_TASK_CLOCK:
Expand Down Expand Up @@ -5154,6 +5160,12 @@ static int perf_tp_event_init(struct perf_event *event)
if (event->attr.type != PERF_TYPE_TRACEPOINT)
return -ENOENT;

/*
* no branch sampling for tracepoint events
*/
if (has_branch_stack(event))
return -EOPNOTSUPP;

err = perf_trace_init(event);
if (err)
return err;
Expand Down Expand Up @@ -5379,6 +5391,12 @@ static int cpu_clock_event_init(struct perf_event *event)
if (event->attr.config != PERF_COUNT_SW_CPU_CLOCK)
return -ENOENT;

/*
* no branch sampling for software events
*/
if (has_branch_stack(event))
return -EOPNOTSUPP;

perf_swevent_init_hrtimer(event);

return 0;
Expand Down Expand Up @@ -5453,6 +5471,12 @@ static int task_clock_event_init(struct perf_event *event)
if (event->attr.config != PERF_COUNT_SW_TASK_CLOCK)
return -ENOENT;

/*
* no branch sampling for software events
*/
if (has_branch_stack(event))
return -EOPNOTSUPP;

perf_swevent_init_hrtimer(event);

return 0;
Expand Down
6 changes: 6 additions & 0 deletions trunk/kernel/events/hw_breakpoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,12 @@ static int hw_breakpoint_event_init(struct perf_event *bp)
if (bp->attr.type != PERF_TYPE_BREAKPOINT)
return -ENOENT;

/*
* no branch sampling for breakpoint events
*/
if (has_branch_stack(bp))
return -EOPNOTSUPP;

err = register_perf_hw_breakpoint(bp);
if (err)
return err;
Expand Down

0 comments on commit 1038616

Please sign in to comment.