Add dump function for trafficController
Add a dumpsys helper function in trafficController to dump out the
information of the trafficController that is running on device. If
trafficController is running bpf programs, dump out all the program
location status and all the map content to dumpsys.
Test: dumpsys netd should trafficController information.
bug: 74411823
Change-Id: Ica83c11b6d1debb59f9c3a703d5b5cfc264844c4
diff --git a/server/NetdNativeService.cpp b/server/NetdNativeService.cpp
index 5bc93c2..06c9346 100644
--- a/server/NetdNativeService.cpp
+++ b/server/NetdNativeService.cpp
@@ -132,10 +132,20 @@
return NO_ERROR;
}
+ if (!args.isEmpty() && args[0] == TrafficController::DUMP_KEYWORD) {
+ dw.blankline();
+ gCtls->trafficCtrl.dump(dw, true);
+ dw.blankline();
+ return NO_ERROR;
+ }
+
dw.blankline();
gCtls->netCtrl.dump(dw);
dw.blankline();
+ gCtls->trafficCtrl.dump(dw, false);
+ dw.blankline();
+
return NO_ERROR;
}