From 5076a021c80e47a88010e6897f18629e18978f1c Mon Sep 17 00:00:00 2001 From: Nick Wille Date: Thu, 1 Jun 2023 18:39:25 +0000 Subject: [PATCH] Added additional logging to bpf handler Bug: b/278923463 Test: Treehugger Change-Id: I5b46b488723ebcde223b758c03c70fa8b1f14c25 --- netd/BpfHandler.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/netd/BpfHandler.cpp b/netd/BpfHandler.cpp index 8081d12947..6c25d1bb0e 100644 --- a/netd/BpfHandler.cpp +++ b/netd/BpfHandler.cpp @@ -19,6 +19,7 @@ #include "BpfHandler.h" #include +#include #include #include @@ -243,6 +244,8 @@ int BpfHandler::tagSocket(int sockFd, uint32_t tag, uid_t chargeUid, uid_t realU mCookieTagMap.getMap().get()); return -res.error().code(); } + ALOGD("Socket with cookie %" PRIu64 " tagged successfully with tag %" PRIu32 " uid %u " + "and real uid %u", sock_cookie, tag, chargeUid, realUid); return 0; } @@ -256,6 +259,7 @@ int BpfHandler::untagSocket(int sockFd) { ALOGE("Failed to untag socket: %s", strerror(res.error().code())); return -res.error().code(); } + ALOGD("Socket with cookie %" PRIu64 " untagged successfully.", sock_cookie); return 0; }