dmabuf_dump: Remove per-device and attachment stats
Creating a separate sysfs directory for each dmabuf attachment
adds overhead that is quite significant in some fast paths.
Attachment stats are being removed from dmabuf sysfs stats
Remove the per-device and attachment stats from dmabuf_dump
Bug: 193226716
Bug: 193465681
Bug: 192621117
Test: dmabuf_dump -b
Change-Id: If3a67c07e8c013d76fe158f4a0260f1ec4153391
diff --git a/libdmabufinfo/tools/dmabuf_dump.cpp b/libdmabufinfo/tools/dmabuf_dump.cpp
index 2466e78..57204f6 100644
--- a/libdmabufinfo/tools/dmabuf_dump.cpp
+++ b/libdmabufinfo/tools/dmabuf_dump.cpp
@@ -228,7 +228,6 @@
auto buffer_stats = stats.buffer_stats();
auto exporter_stats = stats.exporter_info();
- auto importer_stats = stats.importer_info();
printf("\n\n----------------------- DMA-BUF per-buffer stats -----------------------\n");
printf(" Dmabuf Inode | Size(bytes) | Exporter Name |\n");
@@ -236,21 +235,6 @@
printf("%16u |%16u | %16s \n", buf.inode, buf.size, buf.exp_name.c_str());
}
- printf("\n\n----------------------- DMA-BUF attachment stats -----------------------\n");
- printf(" Dmabuf Inode | Attachment(Map Count)\n");
- for (const auto& buf : buffer_stats) {
- printf("%16u", buf.inode);
-
- if (buf.attachments.empty()) {
- printf(" None\n");
- continue;
- }
-
- for (const auto& attachment : buf.attachments)
- printf("%20s(%u) ", attachment.device.c_str(), attachment.map_count);
- printf("\n");
- }
-
printf("\n\n----------------------- DMA-BUF exporter stats -----------------------\n");
printf(" Exporter Name | Total Count | Total Size(bytes) |\n");
for (const auto& it : exporter_stats) {
@@ -258,15 +242,6 @@
it.second.size);
}
- if (!importer_stats.empty()) {
- printf("\n\n---------------------- DMA-BUF per-device stats ----------------------\n");
- printf(" Device | Total Count | Total Size(bytes) |\n");
- for (const auto& it : importer_stats) {
- printf("%32s | %12u| %" PRIu64 "\n", it.first.c_str(), it.second.buffer_count,
- it.second.size);
- }
- }
-
printf("\n\n----------------------- DMA-BUF total stats --------------------------\n");
printf("Total DMA-BUF count: %u, Total DMA-BUF size(bytes): %" PRIu64 "\n", stats.total_count(),
stats.total_size());