Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 223838
b: refs/heads/master
c: 5d508e8
h: refs/heads/master
v: v3
  • Loading branch information
Franck Bui-Huu authored and Ingo Molnar committed Nov 26, 2010
1 parent 7855bf0 commit 69be9ad
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 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: 2e939d1da9b5628642314c1e68b4319e61263c94
refs/heads/master: 5d508e820a23d9b6e8a149dfaa8ba5cbedf3d95c
24 changes: 13 additions & 11 deletions trunk/kernel/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -4917,24 +4917,26 @@ static enum hrtimer_restart perf_swevent_hrtimer(struct hrtimer *hrtimer)
static void perf_swevent_start_hrtimer(struct perf_event *event)
{
struct hw_perf_event *hwc = &event->hw;
s64 period;

if (!is_sampling_event(event))
return;

hrtimer_init(&hwc->hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
hwc->hrtimer.function = perf_swevent_hrtimer;
if (is_sampling_event(event)) {
s64 period = local64_read(&hwc->period_left);

if (period) {
if (period < 0)
period = 10000;
period = local64_read(&hwc->period_left);
if (period) {
if (period < 0)
period = 10000;

local64_set(&hwc->period_left, 0);
} else {
period = max_t(u64, 10000, hwc->sample_period);
}
__hrtimer_start_range_ns(&hwc->hrtimer,
local64_set(&hwc->period_left, 0);
} else {
period = max_t(u64, 10000, hwc->sample_period);
}
__hrtimer_start_range_ns(&hwc->hrtimer,
ns_to_ktime(period), 0,
HRTIMER_MODE_REL_PINNED, 0);
}
}

static void perf_swevent_cancel_hrtimer(struct perf_event *event)
Expand Down

0 comments on commit 69be9ad

Please sign in to comment.