From 82605518588fbdecdc8a8876a4033e7e06fa789e Mon Sep 17 00:00:00 2001 From: zhangzihengya <117833688+zhangzihengya@users.noreply.github.com> Date: Tue, 26 Sep 2023 17:24:20 +0800 Subject: [PATCH] Update libbpf_sar.c --- .../CPU_Subsystem/libbpf_sar/libbpf_sar.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/eBPF_Supermarket/CPU_Subsystem/libbpf_sar/libbpf_sar.c b/eBPF_Supermarket/CPU_Subsystem/libbpf_sar/libbpf_sar.c index 807010d7d..7bf8c2adb 100644 --- a/eBPF_Supermarket/CPU_Subsystem/libbpf_sar/libbpf_sar.c +++ b/eBPF_Supermarket/CPU_Subsystem/libbpf_sar/libbpf_sar.c @@ -182,13 +182,13 @@ int main(int argc, char **argv) } addr = find_ksym(symbol_name); - if (addr) { - // 将地址转换为长整数,并存储在BPF程序的symAddr数组中 - skel->rodata->forks_addr = (u64)strtoull(addr, NULL, 16); - } else { - printf("Symbol not found\n"); - return 0; - } + if (addr) { + // 将地址转换为长整数,并存储在BPF程序的symAddr数组中 + skel->rodata->forks_addr = (u64)strtoull(addr, NULL, 16); + } else { + printf("Symbol not found\n"); + return 0; + } /* 加载并验证BPF程序 */ err = libbpf_sar_bpf__load(skel);