sparc64: Fix perf performance counter overflow calculation
If sparc_perf_event_update() is called between performcnce counter
overflow interrupts then everything is fine and the total event
count calculation is correct. If however, the
sparc_perf_event_update() is only called when the performance counter
overflows, we do not take the counter wrap into consideration.
This leaves us with an incorrect value for the total event count.
This patch fixes this issue by taking the counter overflow situation
into consideration.
Orabug:
22607658
Signed-off-by: Dave Aldridge <david.j.aldridge@oracle.com>
(cherry picked from commit
6c89361408f964ad2c2c29200987aece3a7c222d)
Signed-off-by: Allen Pais <allen.pais@oracle.com>