summaryrefslogtreecommitdiff
path: root/arch/s390/kernel/perf_pai_ext.c
diff options
context:
space:
mode:
authorThomas Richter <tmricht@linux.ibm.com>2024-01-26 15:32:03 +0300
committerHeiko Carstens <hca@linux.ibm.com>2024-02-20 16:37:32 +0300
commit82cb9b618531109824eb8e25b6a3da28d33178ac (patch)
treecc695ff65ef627df733195c6e2ba5de0a4388dac /arch/s390/kernel/perf_pai_ext.c
parentfe861b0c8d0693cb65fd45b7e8c756937b5182ae (diff)
downloadlinux-82cb9b618531109824eb8e25b6a3da28d33178ac.tar.xz
s390/pai: simplify event start function for perf stat
When an event is started, read the current value of the PAI counter. This value is saved in event::hw.prev_count. When an event is stopped, this value is subtracted from the current value read out at event stop time. The difference is the delta of this counter. Simplify the logic and read the event value every time the event is started. This scheme is identical to other device drivers. Signed-off-by: Thomas Richter <tmricht@linux.ibm.com> Acked-by: Sumanth Korikkar <sumanthk@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Diffstat (limited to 'arch/s390/kernel/perf_pai_ext.c')
-rw-r--r--arch/s390/kernel/perf_pai_ext.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/arch/s390/kernel/perf_pai_ext.c b/arch/s390/kernel/perf_pai_ext.c
index 21a18eafb576..dd84c4d6fbe9 100644
--- a/arch/s390/kernel/perf_pai_ext.c
+++ b/arch/s390/kernel/perf_pai_ext.c
@@ -331,11 +331,8 @@ static void paiext_start(struct perf_event *event, int flags)
u64 sum;
if (!event->attr.sample_period) { /* Counting */
- if (!event->hw.last_tag) {
- event->hw.last_tag = 1;
- sum = paiext_getall(event); /* Get current value */
- local64_set(&event->hw.prev_count, sum);
- }
+ sum = paiext_getall(event); /* Get current value */
+ local64_set(&event->hw.prev_count, sum);
} else { /* Sampling */
perf_sched_cb_inc(event->pmu);
}