libdmabufinfo: distinguish fdrefs from maprefs in dmabuf_dump report am: 55ddfc53e1 am: 30fa2b3a39
Change-Id: I365162d9f7b51475ba95a55ba975a3442e556c41
diff --git a/libdmabufinfo/tools/dmabuf_dump.cpp b/libdmabufinfo/tools/dmabuf_dump.cpp
index 48901b1..fb009dd 100644
--- a/libdmabufinfo/tools/dmabuf_dump.cpp
+++ b/libdmabufinfo/tools/dmabuf_dump.cpp
@@ -69,7 +69,7 @@
}
// Format the header string spaced and separated with '|'
- printf(" Dmabuf Inode | Size | Ref Counts |");
+ printf(" Dmabuf Inode | Size | Fd Ref Counts | Map Ref Counts |");
for (auto pid : pid_set) {
printf("%16s:%-5d |", GetProcessComm(pid).c_str(), pid);
}
@@ -81,8 +81,9 @@
// Iterate through all dmabufs and collect per-process sizes, refs
for (auto& buf : bufs) {
- printf("%16ju |%13" PRIu64 " kB |%16" PRIu64 " |", static_cast<uintmax_t>(buf.inode()),
- buf.size() / 1024, buf.total_refs());
+ printf("%16ju |%13" PRIu64 " kB |%16zu |%16zu |",
+ static_cast<uintmax_t>(buf.inode()), buf.size() / 1024, buf.fdrefs().size(),
+ buf.maprefs().size());
// Iterate through each process to find out per-process references for each buffer,
// gather total size used by each process etc.
for (pid_t pid : pid_set) {