Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c65685b7 authored by Rahul Banerjee's avatar Rahul Banerjee
Browse files

Fix field widths in dump, so as to make columns line up.

Flag: EXEMPT log only update
Test: Manual (test cases listed in https://paste.googleplex.com/4796169164423168)
Change-Id: Ia4e9823522dc06b14d27d762fa23a79477408509
parent 6f47f5f7
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -89,14 +89,14 @@ void GraphicBufferAllocator::dump(std::string& result, bool less) const {
    uint64_t total = 0;
    result.append("GraphicBufferAllocator buffers:\n");
    const size_t count = list.size();
    StringAppendF(&result, "%14s | %11s | %18s | %s | %8s | %10s | %s\n", "Handle", "Size",
    StringAppendF(&result, "%18s | %12s | %18s | %s | %8s | %10s | %s\n", "Handle", "Size",
                  "W (Stride) x H", "Layers", "Format", "Usage", "Requestor");
    for (size_t i = 0; i < count; i++) {
        const alloc_rec_t& rec(list.valueAt(i));
        std::string sizeStr = (rec.size)
                ? base::StringPrintf("%7.2f KiB", static_cast<double>(rec.size) / 1024.0)
                : "unknown";
        StringAppendF(&result, "%14p | %11s | %4u (%4u) x %4u | %6u | %8X | 0x%8" PRIx64 " | %s\n",
        StringAppendF(&result, "%18p | %12s | %4u (%4u) x %4u | %6u | %8X | 0x%8" PRIx64 " | %s\n",
                      list.keyAt(i), sizeStr.c_str(), rec.width, rec.stride, rec.height,
                      rec.layerCount, rec.format, rec.usage, rec.requestorName.c_str());
        total += rec.size;