From 0a1557e318c34b3ae287c0ea5b32e526c9c6a191 Mon Sep 17 00:00:00 2001 From: Pragyansh Chaturvedi Date: Tue, 14 Oct 2025 23:33:54 +0530 Subject: [PATCH] Add sync_count BCC example to use tuple-like assignment --- BCC-Examples/sync_count.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/BCC-Examples/sync_count.py b/BCC-Examples/sync_count.py index bbea022..51790b9 100644 --- a/BCC-Examples/sync_count.py +++ b/BCC-Examples/sync_count.py @@ -14,10 +14,8 @@ def last() -> HashMap: @bpf @section("tracepoint/syscalls/sys_enter_sync") def do_trace(ctx: c_void_p) -> c_int64: - ts_key = 0 - cnt_key = 1 - tsp = last.lookup(ts_key) - cntp = last.lookup(cnt_key) + ts_key, cnt_key = 0, 1 + tsp, cntp = last.lookup(ts_key), last.lookup(cnt_key) if not cntp: last.update(cnt_key, 0) cntp = last.lookup(cnt_key)