From 53dbad5decea6760f5d129f50761fbc84aee34ea Mon Sep 17 00:00:00 2001
From: Eunseon Lee <es.lee@lge.com>
Date: Fri, 29 Dec 2023 12:43:04 +0900
Subject: [PATCH] libbpf-tools/futexctn: Fix compliation warning due to
improper format specifier
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
futexctn.c:235:31: warning: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘uint64_t {aka long unsigned int}’ [-Wformat=]
printf(" #%-2d 0x%016llx [unknown]\n", idx++, ip[i]);
~~~~~~^ ~~~~~
%016lx
futexctn.c:247:30: warning: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘uint64_t {aka long unsigned int}’ [-Wformat=]
printf(" #%-2d 0x%016llx", idx++, ip[i]);
~~~~~~^ ~~~~~
%016lx
Update the format specifier according to the data type of 'ip'.
libbpf-tools/futexctn.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
@@ -233,7 +233,7 @@ static int print_stack(struct futexctn_bpf *obj, struct hist_key *info)
fprintf(stderr, "failed to get syms\n");
} else {
for (i = 0; i < env.perf_max_stack_depth && ip[i]; i++)
- printf(" #%-2d 0x%016llx [unknown]\n", idx++, ip[i]);
+ printf(" #%-2d 0x%016lx [unknown]\n", idx++, ip[i]);
}
goto cleanup;
}
@@ -246,7 +246,7 @@ static int print_stack(struct futexctn_bpf *obj, struct hist_key *info)
printf(" [unknown]\n");
} else {
sym = syms__map_addr_dso(syms, ip[i], &dso_name, &dso_offset);
- printf(" #%-2d 0x%016llx", idx++, ip[i]);
+ printf(" #%-2d 0x%016lx", idx++, ip[i]);
if (sym)
printf(" %s+0x%lx", sym->name, sym->offset);
if (dso_name)