Commit 9ca32e94 authored by Khushal's avatar Khushal Committed by Commit Bot

gpu: Fix collisions in ServiceTransferCache memory dumps.

R=ericrk@chromium.org

Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: I6871e01e0e531a13682c69ddde78de19db665d8b
Reviewed-on: https://chromium-review.googlesource.com/1144603Reviewed-by: default avatarEric Karl <ericrk@chromium.org>
Commit-Queue: Khushal <khushalsagar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#577390}
parent 02de272c
...@@ -212,7 +212,6 @@ bool ServiceTransferCache::OnMemoryDump( ...@@ -212,7 +212,6 @@ bool ServiceTransferCache::OnMemoryDump(
} }
for (auto it = entries_.begin(); it != entries_.end(); it++) { for (auto it = entries_.begin(); it != entries_.end(); it++) {
uint32_t entry_id = it->first.entry_id;
auto entry_type = it->first.entry_type; auto entry_type = it->first.entry_type;
const auto* entry = it->second.entry.get(); const auto* entry = it->second.entry.get();
const cc::ServiceImageTransferCacheEntry* image_entry = nullptr; const cc::ServiceImageTransferCacheEntry* image_entry = nullptr;
...@@ -224,13 +223,15 @@ bool ServiceTransferCache::OnMemoryDump( ...@@ -224,13 +223,15 @@ bool ServiceTransferCache::OnMemoryDump(
if (image_entry && image_entry->fits_on_gpu()) { if (image_entry && image_entry->fits_on_gpu()) {
std::string dump_name = base::StringPrintf( std::string dump_name = base::StringPrintf(
"gpu/transfer_cache/cache_0x%" PRIXPTR "/gpu/entry_%d", "gpu/transfer_cache/cache_0x%" PRIXPTR "/gpu/entry_0x%" PRIXPTR,
reinterpret_cast<uintptr_t>(this), entry_id); reinterpret_cast<uintptr_t>(this),
reinterpret_cast<uintptr_t>(entry));
DumpMemoryForImageTransferCacheEntry(pmd, dump_name, image_entry); DumpMemoryForImageTransferCacheEntry(pmd, dump_name, image_entry);
} else { } else {
std::string dump_name = base::StringPrintf( std::string dump_name = base::StringPrintf(
"gpu/transfer_cache/cache_0x%" PRIXPTR "/cpu/entry_%d", "gpu/transfer_cache/cache_0x%" PRIXPTR "/cpu/entry_0x%" PRIXPTR,
reinterpret_cast<uintptr_t>(this), entry_id); reinterpret_cast<uintptr_t>(this),
reinterpret_cast<uintptr_t>(entry));
MemoryAllocatorDump* dump = pmd->CreateAllocatorDump(dump_name); MemoryAllocatorDump* dump = pmd->CreateAllocatorDump(dump_name);
dump->AddScalar(MemoryAllocatorDump::kNameSize, dump->AddScalar(MemoryAllocatorDump::kNameSize,
MemoryAllocatorDump::kUnitsBytes, entry->CachedSize()); MemoryAllocatorDump::kUnitsBytes, entry->CachedSize());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment