Skip to content

libbpf-tools: fix build error on ppc64el (#5330) #5331

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion libbpf-tools/bashreadline.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <time.h>
#include <unistd.h>
#include <ctype.h>
#include <inttypes.h>

#include <bpf/libbpf.h>
#include <bpf/bpf.h>
Expand Down Expand Up @@ -87,7 +88,7 @@ static void handle_event(void *ctx, int cpu, void *data, __u32 data_size)

static void handle_lost_events(void *ctx, int cpu, __u64 lost_cnt)
{
warn("lost %llu events on CPU #%d\n", lost_cnt, cpu);
warn("lost %" PRIu64" events on CPU #%d\n", (uint64_t)lost_cnt, cpu);
}

static char *find_readline_function_name(const char *bash_path)
Expand Down
3 changes: 2 additions & 1 deletion libbpf-tools/bindsnoop.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <argp.h>
#include <arpa/inet.h>
#include <errno.h>
#include <inttypes.h>
#include <signal.h>
#include <string.h>
#include <sys/socket.h>
Expand Down Expand Up @@ -178,7 +179,7 @@ static void handle_event(void *ctx, int cpu, void *data, __u32 data_sz)

static void handle_lost_events(void *ctx, int cpu, __u64 lost_cnt)
{
warn("lost %llu events on CPU #%d\n", lost_cnt, cpu);
warn("lost %" PRIu64" events on CPU #%d\n", (uint64_t)lost_cnt, cpu);
}

int main(int argc, char **argv)
Expand Down
3 changes: 2 additions & 1 deletion libbpf-tools/biosnoop.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// Based on biosnoop(8) from BCC by Brendan Gregg.
// 29-Jun-2020 Wenbo Zhang Created this.
#include <argp.h>
#include <inttypes.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
Expand Down Expand Up @@ -216,7 +217,7 @@ void handle_event(void *ctx, int cpu, void *data, __u32 data_sz)

void handle_lost_events(void *ctx, int cpu, __u64 lost_cnt)
{
fprintf(stderr, "lost %llu events on CPU #%d\n", lost_cnt, cpu);
fprintf(stderr, "lost %" PRIu64" events on CPU #%d\n", (uint64_t)lost_cnt, cpu);
}

static void blk_account_io_set_attach_target(struct biosnoop_bpf *obj)
Expand Down
3 changes: 2 additions & 1 deletion libbpf-tools/capable.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// Copyright 2022 Sony Group Corporation

#include <argp.h>
#include <inttypes.h>
#include <signal.h>
#include <unistd.h>
#include <fcntl.h>
Expand Down Expand Up @@ -300,7 +301,7 @@ static void handle_event(void *ctx, int cpu, void *data, __u32 data_sz)

static void handle_lost_events(void *ctx, int cpu, __u64 lost_cnt)
{
fprintf(stderr, "lost %llu events on CPU #%d\n", lost_cnt, cpu);
fprintf(stderr, "lost %" PRIu64" events on CPU #%d\n", (uint64_t)lost_cnt, cpu);
}

int main(int argc, char **argv)
Expand Down
3 changes: 2 additions & 1 deletion libbpf-tools/drsnoop.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// Based on drsnoop(8) from BCC by Wenbo Zhang.
// 28-Feb-2020 Wenbo Zhang Created this.
#include <argp.h>
#include <inttypes.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
Expand Down Expand Up @@ -143,7 +144,7 @@ void handle_event(void *ctx, int cpu, void *data, __u32 data_sz)

void handle_lost_events(void *ctx, int cpu, __u64 lost_cnt)
{
fprintf(stderr, "lost %llu events on CPU #%d\n", lost_cnt, cpu);
fprintf(stderr, "lost %" PRIu64" events on CPU #%d\n", (uint64_t)lost_cnt, cpu);
}

int main(int argc, char **argv)
Expand Down
3 changes: 2 additions & 1 deletion libbpf-tools/execsnoop.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Based on execsnoop(8) from BCC by Brendan Gregg and others.
//
#include <argp.h>
#include <inttypes.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
Expand Down Expand Up @@ -262,7 +263,7 @@ static void handle_event(void *ctx, int cpu, void *data, __u32 data_sz)

static void handle_lost_events(void *ctx, int cpu, __u64 lost_cnt)
{
fprintf(stderr, "Lost %llu events on CPU #%d!\n", lost_cnt, cpu);
fprintf(stderr, "Lost %" PRIu64" events on CPU #%d!\n", (uint64_t)lost_cnt, cpu);
}

int main(int argc, char **argv)
Expand Down
3 changes: 2 additions & 1 deletion libbpf-tools/exitsnoop.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
*/
#include <argp.h>
#include <errno.h>
#include <inttypes.h>
#include <signal.h>
#include <string.h>
#include <time.h>
Expand Down Expand Up @@ -163,7 +164,7 @@ static void handle_event(void *ctx, int cpu, void *data, __u32 data_sz)

static void handle_lost_events(void *ctx, int cpu, __u64 lost_cnt)
{
warn("lost %llu events on CPU #%d\n", lost_cnt, cpu);
warn("lost %" PRIu64" events on CPU #%d\n", (uint64_t)lost_cnt, cpu);
}

int main(int argc, char **argv)
Expand Down
3 changes: 2 additions & 1 deletion libbpf-tools/filelife.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
// 23-Aug-2023 Rong Tao Add vfs_* 'struct mnt_idmap' support.(CO-RE)
// 08-Nov-2023 Rong Tao Support unlink failed
#include <argp.h>
#include <inttypes.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
Expand Down Expand Up @@ -111,7 +112,7 @@ void handle_event(void *ctx, int cpu, void *data, __u32 data_sz)

void handle_lost_events(void *ctx, int cpu, __u64 lost_cnt)
{
fprintf(stderr, "lost %llu events on CPU #%d\n", lost_cnt, cpu);
fprintf(stderr, "lost %" PRIu64" events on CPU #%d\n", (uint64_t)lost_cnt, cpu);
}

int main(int argc, char **argv)
Expand Down
3 changes: 2 additions & 1 deletion libbpf-tools/fsslower.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* 27-Oct-2023 Pcheng Cui Add support for F2FS.
*/
#include <argp.h>
#include <inttypes.h>
#include <libgen.h>
#include <signal.h>
#include <stdio.h>
Expand Down Expand Up @@ -386,7 +387,7 @@ static void handle_event(void *ctx, int cpu, void *data, __u32 data_sz)

static void handle_lost_events(void *ctx, int cpu, __u64 lost_cnt)
{
warn("lost %llu events on CPU #%d\n", lost_cnt, cpu);
warn("lost %" PRIu64" events on CPU #%d\n", (uint64_t)lost_cnt, cpu);
}

int main(int argc, char **argv)
Expand Down
3 changes: 2 additions & 1 deletion libbpf-tools/gethostlatency.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
*/
#include <argp.h>
#include <errno.h>
#include <inttypes.h>
#include <signal.h>
#include <time.h>
#include <unistd.h>
Expand Down Expand Up @@ -119,7 +120,7 @@ static void handle_event(void *ctx, int cpu, void *data, __u32 data_sz)

static void handle_lost_events(void *ctx, int cpu, __u64 lost_cnt)
{
warn("lost %llu events on CPU #%d\n", lost_cnt, cpu);
warn("lost %" PRIu64" events on CPU #%d\n", (uint64_t)lost_cnt, cpu);
}

static int get_libc_path(char *path)
Expand Down
3 changes: 2 additions & 1 deletion libbpf-tools/ksnoop.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <ctype.h>
#include <errno.h>
#include <getopt.h>
#include <inttypes.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
Expand Down Expand Up @@ -772,7 +773,7 @@ static void trace_handler(void *ctx, int cpu, void *data, __u32 size)

static void lost_handler(void *ctx, int cpu, __u64 cnt)
{
p_err("\t/* lost %llu events */", cnt);
p_err("\t/* lost %" PRIu64" events */", cnt);
}

static void sig_int(int signo)
Expand Down
3 changes: 2 additions & 1 deletion libbpf-tools/mdflush.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
*/
#include <argp.h>
#include <errno.h>
#include <inttypes.h>
#include <signal.h>
#include <string.h>
#include <time.h>
Expand Down Expand Up @@ -84,7 +85,7 @@ static void handle_event(void *ctx, int cpu, void *data, __u32 data_sz)

static void handle_lost_events(void *ctx, int cpu, __u64 lost_cnt)
{
warn("lost %llu events on CPU #%d\n", lost_cnt, cpu);
warn("lost %" PRIu64" events on CPU #%d\n", (uint64_t)lost_cnt, cpu);
}

int main(int argc, char **argv)
Expand Down
3 changes: 2 additions & 1 deletion libbpf-tools/mountsnoop.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <argp.h>
#include <errno.h>
#include <fcntl.h>
#include <inttypes.h>
#include <signal.h>
#include <string.h>
#include <time.h>
Expand Down Expand Up @@ -454,7 +455,7 @@ static int handle_event(void *ctx, void *data, size_t len)

static void handle_lost_events(void *ctx, int cpu, __u64 lost_cnt)
{
warn("lost %llu events on CPU #%d\n", lost_cnt, cpu);
warn("lost %" PRIu64" events on CPU #%d\n", (uint64_t)lost_cnt, cpu);
}

int main(int argc, char **argv)
Expand Down
3 changes: 2 additions & 1 deletion libbpf-tools/oomkill.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
// 17-Oct-2022 Krisztian Fekete Edited this.
#include <argp.h>
#include <errno.h>
#include <inttypes.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
Expand Down Expand Up @@ -90,7 +91,7 @@ static int handle_event(void *ctx, void *data, size_t len)

static void handle_lost_events(void *ctx, int cpu, __u64 lost_cnt)
{
printf("Lost %llu events on CPU #%d!\n", lost_cnt, cpu);
printf("Lost %" PRIu64" events on CPU #%d!\n", (uint64_t)lost_cnt, cpu);
}

static void sig_int(int signo)
Expand Down
3 changes: 2 additions & 1 deletion libbpf-tools/opensnoop.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#define _GNU_SOURCE
#endif
#include <argp.h>
#include <inttypes.h>
#include <fcntl.h>
#include <signal.h>
#include <stdio.h>
Expand Down Expand Up @@ -307,7 +308,7 @@ int handle_event(void *ctx, void *data, size_t data_sz)

void handle_lost_events(void *ctx, int cpu, __u64 lost_cnt)
{
fprintf(stderr, "Lost %llu events on CPU #%d!\n", lost_cnt, cpu);
fprintf(stderr, "Lost %" PRIu64" events on CPU #%d!\n", (uint64_t)lost_cnt, cpu);
}

int main(int argc, char **argv)
Expand Down
3 changes: 2 additions & 1 deletion libbpf-tools/runqslower.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// Based on runqslower(8) from BCC by Ivan Babrou.
// 11-Feb-2020 Andrii Nakryiko Created this.
#include <argp.h>
#include <inttypes.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
Expand Down Expand Up @@ -142,7 +143,7 @@ void handle_event(void *ctx, int cpu, void *data, __u32 data_sz)

void handle_lost_events(void *ctx, int cpu, __u64 lost_cnt)
{
printf("Lost %llu events on CPU #%d!\n", lost_cnt, cpu);
printf("Lost %" PRIu64" events on CPU #%d!\n", (uint64_t)lost_cnt, cpu);
}

int main(int argc, char **argv)
Expand Down
3 changes: 2 additions & 1 deletion libbpf-tools/sigsnoop.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* 08-Aug-2021 Hengqi Chen Created this.
*/
#include <argp.h>
#include <inttypes.h>
#include <libgen.h>
#include <signal.h>
#include <time.h>
Expand Down Expand Up @@ -232,7 +233,7 @@ static void handle_event(void *ctx, int cpu, void *data, __u32 data_sz)

static void handle_lost_events(void *ctx, int cpu, __u64 lost_cnt)
{
warn("lost %llu events on CPU #%d\n", lost_cnt, cpu);
warn("lost %" PRIu64" events on CPU #%d\n", (uint64_t)lost_cnt, cpu);
}

int main(int argc, char **argv)
Expand Down
3 changes: 2 additions & 1 deletion libbpf-tools/solisten.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <argp.h>
#include <arpa/inet.h>
#include <errno.h>
#include <inttypes.h>
#include <signal.h>
#include <sys/socket.h>
#include <time.h>
Expand Down Expand Up @@ -129,7 +130,7 @@ static void handle_event(void *ctx, int cpu, void *data, __u32 data_sz)

static void handle_lost_events(void *ctx, int cpu, __u64 lost_cnt)
{
warn("lost %llu events on CPU #%d\n", lost_cnt, cpu);
warn("lost %" PRIu64" events on CPU #%d\n", (uint64_t)lost_cnt, cpu);
}

int main(int argc, char **argv)
Expand Down
3 changes: 2 additions & 1 deletion libbpf-tools/statsnoop.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <argp.h>
#include <errno.h>
#include <fcntl.h>
#include <inttypes.h>
#include <signal.h>
#include <time.h>
#include <unistd.h>
Expand Down Expand Up @@ -183,7 +184,7 @@ static void handle_event(void *ctx, int cpu, void *data, __u32 data_sz)

static void handle_lost_events(void *ctx, int cpu, __u64 lost_cnt)
{
warn("lost %llu events on CPU #%d\n", lost_cnt, cpu);
warn("lost %" PRIu64" events on CPU #%d\n", (uint64_t)lost_cnt, cpu);
}

int main(int argc, char **argv)
Expand Down
3 changes: 2 additions & 1 deletion libbpf-tools/syncsnoop.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// 08-Feb-2024 Tiago Ilieve Created this.
// 19-Jul-2024 Rong Tao Support more sync syscalls
#include <argp.h>
#include <inttypes.h>
#include <signal.h>
#include <stdio.h>
#include <bpf/libbpf.h>
Expand Down Expand Up @@ -76,7 +77,7 @@ void handle_event(void *ctx, int cpu, void *data, __u32 data_sz)

void handle_lost_events(void *ctx, int cpu, __u64 lost_cnt)
{
printf("Lost %llu events on CPU #%d!\n", lost_cnt, cpu);
printf("Lost %" PRIu64" events on CPU #%d!\n", (uint64_t)lost_cnt, cpu);
}

static void sig_int(int signo)
Expand Down
3 changes: 2 additions & 1 deletion libbpf-tools/tcpconnect.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <sys/resource.h>
#include <arpa/inet.h>
#include <argp.h>
#include <inttypes.h>
#include <signal.h>
#include <limits.h>
#include <unistd.h>
Expand Down Expand Up @@ -357,7 +358,7 @@ static void handle_event(void *ctx, int cpu, void *data, __u32 data_sz)

static void handle_lost_events(void *ctx, int cpu, __u64 lost_cnt)
{
warn("Lost %llu events on CPU #%d!\n", lost_cnt, cpu);
warn("Lost %" PRIu64" events on CPU #%d!\n", (uint64_t)lost_cnt, cpu);
}

static void print_events(int perf_map_fd)
Expand Down
3 changes: 2 additions & 1 deletion libbpf-tools/tcpconnlat.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// 11-Jul-2020 Wenbo Zhang Created this.
#include <argp.h>
#include <arpa/inet.h>
#include <inttypes.h>
#include <signal.h>
#include <stdio.h>
#include <unistd.h>
Expand Down Expand Up @@ -151,7 +152,7 @@ void handle_event(void *ctx, int cpu, void *data, __u32 data_sz)

void handle_lost_events(void *ctx, int cpu, __u64 lost_cnt)
{
fprintf(stderr, "lost %llu events on CPU #%d\n", lost_cnt, cpu);
fprintf(stderr, "lost %" PRIu64" events on CPU #%d\n", (uint64_t)lost_cnt, cpu);
}

int main(int argc, char **argv)
Expand Down
3 changes: 2 additions & 1 deletion libbpf-tools/tcplife.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* 02-Jun-2022 Hengqi Chen Created this.
*/
#include <argp.h>
#include <inttypes.h>
#include <errno.h>
#include <signal.h>
#include <time.h>
Expand Down Expand Up @@ -144,7 +145,7 @@ static void handle_event(void *ctx, int cpu, void *data, __u32 data_sz)

static void handle_lost_events(void *ctx, int cpu, __u64 lost_cnt)
{
fprintf(stderr, "lost %llu events on CPU #%d\n", lost_cnt, cpu);
fprintf(stderr, "lost %" PRIu64" events on CPU #%d\n", (uint64_t)lost_cnt, cpu);
}

int main(int argc, char **argv)
Expand Down
Loading
Loading