From d8259aa1e495f846aac419ca7fdf3ba7877f87d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20=C5=BBenczykowski?= Date: Mon, 27 Jun 2022 10:02:20 -0700 Subject: [PATCH] add missing logging for bpf_obj_pin operation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Test: TreeHugger Signed-off-by: Maciej Żenczykowski Change-Id: Ica8c15366c4db12fae1ac14c50fb46a5ab40acff --- libbpf_android/Loader.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libbpf_android/Loader.cpp b/libbpf_android/Loader.cpp index 57e5303..b66d9c6 100644 --- a/libbpf_android/Loader.cpp +++ b/libbpf_android/Loader.cpp @@ -871,7 +871,11 @@ static int createMaps(const char* elfPath, ifstream& elfFile, vector& } } else { ret = bpf_obj_pin(fd, mapPinLoc.c_str()); - if (ret) return -errno; + if (ret) { + int err = errno; + ALOGE("pin %s -> %d [%d:%s]", mapPinLoc.c_str(), ret, err, strerror(err)); + return -err; + } } ret = chown(mapPinLoc.c_str(), (uid_t)md[i].uid, (gid_t)md[i].gid); if (ret) {