From 08a2203974f1079e90ae784ef3faff71f138f204 Mon Sep 17 00:00:00 2001 From: chenyuezhou Date: Mon, 21 Jun 2021 10:07:30 -0400 Subject: [PATCH] tools: funclatency use atomic_increment --- tools/funclatency.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tools/funclatency.py b/tools/funclatency.py index 6a067e0c..aad879d1 100755 --- a/tools/funclatency.py +++ b/tools/funclatency.py @@ -143,10 +143,8 @@ int trace_func_return(struct pt_regs *ctx) u32 lat = 0; u32 cnt = 1; - u64 *sum = avg.lookup(&lat); - if (sum) lock_xadd(sum, delta); - u64 *cnts = avg.lookup(&cnt); - if (cnts) lock_xadd(cnts, 1); + avg.atomic_increment(lat, delta); + avg.atomic_increment(cnt); FACTOR -- 2.34.1