]> www.infradead.org Git - users/jedix/linux-maple.git/commit
perf: Fix running time accounting
authorPeter Zijlstra <peterz@infradead.org>
Mon, 27 Jul 2015 08:35:07 +0000 (10:35 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 13 Sep 2015 16:07:39 +0000 (09:07 -0700)
commitb8cae722c4afc4c116dc34e013c82cd5bbc68bb8
tree25b24dac89c90fa1d9c3771edad88ecbbb8a9889
parent75d370fe0b1159aedf960c843b514b39c82e822f
perf: Fix running time accounting

commit 00a2916f7f82c348a2a94dbb572874173bc308a3 upstream.

A recent fix to the shadow timestamp inadvertly broke the running time
accounting.

We must not update the running timestamp if we fail to schedule the
event, the event will not have ran. This can (and did) result in
negative total runtime because the stopped timestamp was before the
running timestamp (we 'started' but never stopped the event -- because
it never really started we didn't have to stop it either).

Reported-and-Tested-by: Vince Weaver <vincent.weaver@maine.edu>
Fixes: 72f669c0086f ("perf: Update shadow timestamp before add event")
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Shaohua Li <shli@fb.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/events/core.c