Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 323047
b: refs/heads/master
c: bad9ac2
h: refs/heads/master
i:
  323045: a10b55c
  323043: 810d165
  323039: 0fe58be
v: v3
  • Loading branch information
Robert Richter authored and Ingo Molnar committed Sep 13, 2012
1 parent fd6f5a8 commit 1896611
Show file tree
Hide file tree
Showing 3 changed files with 15 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: 35534b201c9f115c68962c095b5a9aad204d025f
refs/heads/master: bad9ac2d7f878a31cf1ae8c1ee3768077d222bcb
12 changes: 12 additions & 0 deletions trunk/arch/x86/kernel/cpu/perf_event_amd_ibs.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,15 @@ static int perf_ibs_precise_event(struct perf_event *event, u64 *config)
return -EOPNOTSUPP;
}

static const struct perf_event_attr ibs_notsupp = {
.exclude_user = 1,
.exclude_kernel = 1,
.exclude_hv = 1,
.exclude_idle = 1,
.exclude_host = 1,
.exclude_guest = 1,
};

static int perf_ibs_init(struct perf_event *event)
{
struct hw_perf_event *hwc = &event->hw;
Expand All @@ -229,6 +238,9 @@ static int perf_ibs_init(struct perf_event *event)
if (event->pmu != &perf_ibs->pmu)
return -ENOENT;

if (perf_flags(&event->attr) & perf_flags(&ibs_notsupp))
return -EINVAL;

if (config & ~perf_ibs->config_mask)
return -EINVAL;

Expand Down
2 changes: 2 additions & 0 deletions trunk/include/linux/perf_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,8 @@ struct perf_event_attr {
__u64 branch_sample_type; /* enum branch_sample_type */
};

#define perf_flags(attr) (*(&(attr)->read_format + 1))

/*
* Ioctls that can be done on a perf event fd:
*/
Expand Down

0 comments on commit 1896611

Please sign in to comment.