Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 211820
b: refs/heads/master
c: fa407f3
h: refs/heads/master
v: v3
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Sep 9, 2010
1 parent 469776c commit 3066390
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 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: ad5133b7030d04ce7701aa7cbe98f561347c79c2
refs/heads/master: fa407f35e0298d841e4088f95a7f9cf6e725c6d5
1 change: 0 additions & 1 deletion trunk/include/linux/perf_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,6 @@ struct hw_perf_event {
int last_cpu;
};
struct { /* software */
s64 remaining;
struct hrtimer hrtimer;
};
#ifdef CONFIG_HAVE_HW_BREAKPOINT
Expand Down
13 changes: 6 additions & 7 deletions trunk/kernel/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -4800,14 +4800,13 @@ static void perf_swevent_start_hrtimer(struct perf_event *event)
hrtimer_init(&hwc->hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
hwc->hrtimer.function = perf_swevent_hrtimer;
if (hwc->sample_period) {
u64 period;
s64 period = local64_read(&hwc->period_left);

if (hwc->remaining) {
if (hwc->remaining < 0)
if (period) {
if (period < 0)
period = 10000;
else
period = hwc->remaining;
hwc->remaining = 0;

local64_set(&hwc->period_left, 0);
} else {
period = max_t(u64, 10000, hwc->sample_period);
}
Expand All @@ -4823,7 +4822,7 @@ static void perf_swevent_cancel_hrtimer(struct perf_event *event)

if (hwc->sample_period) {
ktime_t remaining = hrtimer_get_remaining(&hwc->hrtimer);
hwc->remaining = ktime_to_ns(remaining);
local64_set(&hwc->period_left, ktime_to_ns(remaining));

hrtimer_cancel(&hwc->hrtimer);
}
Expand Down

0 comments on commit 3066390

Please sign in to comment.