From 1aa18fe2c5cb126555c68b7ba3a3bdf28d6fab64 Mon Sep 17 00:00:00 2001 From: Adrian Szyndela Date: Tue, 12 Sep 2017 15:49:48 +0200 Subject: [PATCH] corrected snprintf format to match needed 64-bits Change-Id: Ied3890d6a25a814a48847f83b8e987b97436f042 --- src/cc/libbpf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cc/libbpf.c b/src/cc/libbpf.c index f0c372b..50d9d01 100644 --- a/src/cc/libbpf.c +++ b/src/cc/libbpf.c @@ -42,6 +42,7 @@ #include #include #include +#include #include "libbpf.h" #include "perf_reader.h" @@ -533,7 +534,7 @@ void * bpf_attach_uprobe(int progfd, enum bpf_probe_attach_type attach_type, con goto error; } - n = snprintf(buf, sizeof(buf), "%c:%ss/%s %s:0x%lx", attach_type==BPF_PROBE_ENTRY ? 'p' : 'r', + n = snprintf(buf, sizeof(buf), "%c:%ss/%s %s:0x%"PRIx64, attach_type==BPF_PROBE_ENTRY ? 'p' : 'r', event_type, new_name, binary_path, offset); if (n >= sizeof(buf)) { fprintf(stderr, "Name too long for uprobe; ev_name (%s) is probably too long\n", ev_name); -- 2.7.4