From c6aad62c6d7858d7419863e38383ef80be5bdcfd Mon Sep 17 00:00:00 2001 From: syxl-time <953879556@qq.com> Date: Fri, 14 Jun 2024 17:27:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=A1=A8=E5=A4=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- eBPF_Supermarket/Memory_Subsystem/mem_watcher/mem_watcher.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eBPF_Supermarket/Memory_Subsystem/mem_watcher/mem_watcher.c b/eBPF_Supermarket/Memory_Subsystem/mem_watcher/mem_watcher.c index 33d65f514..91735d5ea 100644 --- a/eBPF_Supermarket/Memory_Subsystem/mem_watcher/mem_watcher.c +++ b/eBPF_Supermarket/Memory_Subsystem/mem_watcher/mem_watcher.c @@ -590,7 +590,7 @@ static int update_addr_times(struct memleak_bpf *skel) { int print_time(struct memleak_bpf *skel) { const size_t addr_times_key_size = bpf_map__key_size(skel->maps.addr_times); - printf("%-16s %9s\n", "AL_ADDR", "AL_Time"); + printf("%-16s %12s\n", "AL_ADDR", "AL_Time(s)"); // Iterate over the addr_times map to print address and time for (__u64 prev_key = 0, curr_key = 0;; prev_key = curr_key) { @@ -605,7 +605,7 @@ int print_time(struct memleak_bpf *skel) { // Read the timestamp for the current address __u64 timestamp; if (bpf_map__lookup_elem(skel->maps.addr_times, &curr_key, addr_times_key_size, ×tamp, sizeof(timestamp), 0) == 0) { - printf("0x%-16llx %llds\n", curr_key, timestamp); // 添加时间单位"s" + printf("0x%-16llx %lld\n", curr_key, timestamp); } else { perror("map lookup failed!");