Skip to content

Commit

Permalink
libbpf-tools/futexctn: Fix compliation warning due to improper format…
Browse files Browse the repository at this point in the history
… specifier

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'.
  • Loading branch information
ekyooo authored and chenhengqi committed Jan 1, 2024
1 parent f98774d commit 53dbad5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libbpf-tools/futexctn.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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)
Expand Down

0 comments on commit 53dbad5

Please sign in to comment.