Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 191291
b: refs/heads/master
c: 4261e0e
h: refs/heads/master
i:
  191289: 822750e
  191287: 2594329
v: v3
  • Loading branch information
Robert Richter authored and Ingo Molnar committed May 7, 2010
1 parent d921198 commit 084466d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 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: a0507c84bf47dfd204299774f45fd16da33f0619
refs/heads/master: 4261e0e0efd9e04b6c69e0773c3cf4d6f337c416
20 changes: 14 additions & 6 deletions trunk/arch/x86/kernel/cpu/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,8 @@ set_ext_hw_attr(struct hw_perf_event *hwc, struct perf_event_attr *attr)
return 0;
}

static int x86_setup_perfctr(struct perf_event *event);

static int x86_pmu_hw_config(struct perf_event *event)
{
/*
Expand Down Expand Up @@ -453,9 +455,6 @@ static int x86_pmu_hw_config(struct perf_event *event)
*/
static int __hw_perf_event_init(struct perf_event *event)
{
struct perf_event_attr *attr = &event->attr;
struct hw_perf_event *hwc = &event->hw;
u64 config;
int err;

if (!x86_pmu_initialized())
Expand All @@ -482,15 +481,24 @@ static int __hw_perf_event_init(struct perf_event *event)

event->destroy = hw_perf_event_destroy;

hwc->idx = -1;
hwc->last_cpu = -1;
hwc->last_tag = ~0ULL;
event->hw.idx = -1;
event->hw.last_cpu = -1;
event->hw.last_tag = ~0ULL;

/* Processor specifics */
err = x86_pmu.hw_config(event);
if (err)
return err;

return x86_setup_perfctr(event);
}

static int x86_setup_perfctr(struct perf_event *event)
{
struct perf_event_attr *attr = &event->attr;
struct hw_perf_event *hwc = &event->hw;
u64 config;

if (!hwc->sample_period) {
hwc->sample_period = x86_pmu.max_period;
hwc->last_period = hwc->sample_period;
Expand Down

0 comments on commit 084466d

Please sign in to comment.