Commit 5ec4c599 authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Ingo Molnar

perf: Do not compute time values unnecessarily

We should not be calling calc_timer_values() for events that do not actually
have an mmap()'ed userpage.
Signed-off-by: default avatarPeter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20130802191630.GT27162@twins.programming.kicks-ass.netSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 948b26b6
...@@ -3670,6 +3670,10 @@ void perf_event_update_userpage(struct perf_event *event) ...@@ -3670,6 +3670,10 @@ void perf_event_update_userpage(struct perf_event *event)
u64 enabled, running, now; u64 enabled, running, now;
rcu_read_lock(); rcu_read_lock();
rb = rcu_dereference(event->rb);
if (!rb)
goto unlock;
/* /*
* compute total_time_enabled, total_time_running * compute total_time_enabled, total_time_running
* based on snapshot values taken when the event * based on snapshot values taken when the event
...@@ -3680,12 +3684,8 @@ void perf_event_update_userpage(struct perf_event *event) ...@@ -3680,12 +3684,8 @@ void perf_event_update_userpage(struct perf_event *event)
* NMI context * NMI context
*/ */
calc_timer_values(event, &now, &enabled, &running); calc_timer_values(event, &now, &enabled, &running);
rb = rcu_dereference(event->rb);
if (!rb)
goto unlock;
userpg = rb->user_page; userpg = rb->user_page;
/* /*
* Disable preemption so as to not let the corresponding user-space * Disable preemption so as to not let the corresponding user-space
* spin too long if we get preempted. * spin too long if we get preempted.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment