Commit fb47e731 authored by Eric Karl's avatar Eric Karl Committed by Commit Bot

Remove unused ProgramCache UMAs

These were all expired after M77, adding <obsolete> tag and cleaning up
code.

Bug: 691863
Change-Id: Ibf654b78aad2b6bbbf85b2527f55dfe1d51c9f35
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2029289Reviewed-by: default avatarIlya Sherman <isherman@chromium.org>
Commit-Queue: Eric Karl <ericrk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#736961}
parent 17680858
......@@ -26,16 +26,6 @@
#include "third_party/zlib/zlib.h"
#include "ui/gl/gl_bindings.h"
// Macro to help with logging times under 10ms.
#define UMA_HISTOGRAM_VERY_SHORT_TIMES(name, time_delta) \
UMA_HISTOGRAM_CUSTOM_COUNTS( \
name, \
static_cast<base::HistogramBase::Sample>((time_delta).InMicroseconds()), \
1, \
static_cast<base::HistogramBase::Sample>( \
base::TimeDelta::FromMilliseconds(10).InMicroseconds()), \
50);
namespace gpu {
namespace gles2 {
......@@ -224,7 +214,6 @@ bool ProgramBinaryExtensionsAvailable() {
// Returns an empty vector if compression fails.
std::vector<uint8_t> CompressData(const std::vector<uint8_t>& data) {
auto start_time = base::TimeTicks::Now();
uLongf compressed_size = compressBound(data.size());
std::vector<uint8_t> compressed_data(compressed_size);
// Level indicates a trade-off between compression and speed. Level 1
......@@ -234,18 +223,12 @@ std::vector<uint8_t> CompressData(const std::vector<uint8_t>& data) {
// It should be impossible for compression to fail with the provided
// parameters.
bool success = Z_OK == result;
UMA_HISTOGRAM_BOOLEAN("GPU.ProgramCache.CompressDataSuccess", success);
if (!success)
return std::vector<uint8_t>();
compressed_data.resize(compressed_size);
compressed_data.shrink_to_fit();
UMA_HISTOGRAM_VERY_SHORT_TIMES("GPU.ProgramCache.CompressDataTime",
base::TimeTicks::Now() - start_time);
UMA_HISTOGRAM_PERCENTAGE("GPU.ProgramCache.CompressionPercentage",
(100 * compressed_size) / data.size());
return compressed_data;
}
......@@ -253,7 +236,6 @@ std::vector<uint8_t> CompressData(const std::vector<uint8_t>& data) {
std::vector<uint8_t> DecompressData(const std::vector<uint8_t>& data,
size_t decompressed_size,
size_t max_size_bytes) {
auto start_time = base::TimeTicks::Now();
std::vector<uint8_t> decompressed_data(decompressed_size);
uLongf decompressed_size_out =
static_cast<uLongf>(decompressed_size);
......@@ -262,13 +244,9 @@ std::vector<uint8_t> DecompressData(const std::vector<uint8_t>& data,
bool success =
result == Z_OK && decompressed_data.size() == decompressed_size_out;
UMA_HISTOGRAM_BOOLEAN("GPU.ProgramCache.DecompressDataSuccess", success);
if (!success)
return std::vector<uint8_t>();
UMA_HISTOGRAM_VERY_SHORT_TIMES("GPU.ProgramCache.DecompressDataTime",
base::TimeTicks::Now() - start_time);
return decompressed_data;
}
......@@ -428,9 +406,6 @@ void MemoryProgramCache::SaveLinkedProgram(
if (binary.size() > max_size_bytes())
return;
UMA_HISTOGRAM_COUNTS_1M("GPU.ProgramCache.ProgramBinarySizeBytes",
binary.size());
char a_sha[kHashLength];
char b_sha[kHashLength];
DCHECK(shader_a && !shader_a->last_compiled_source().empty() &&
......@@ -449,9 +424,6 @@ void MemoryProgramCache::SaveLinkedProgram(
sha);
const std::string sha_string(sha, sizeof(sha));
UMA_HISTOGRAM_COUNTS_1M("GPU.ProgramCache.MemorySizeBeforeKb",
curr_size_bytes_ / 1024);
// Evict any cached program with the same key in favor of the least recently
// accessed.
ProgramMRUCache::iterator existing = store_.Peek(sha_string);
......@@ -486,9 +458,6 @@ void MemoryProgramCache::SaveLinkedProgram(
shader_b->uniform_map(), shader_b->varying_map(),
shader_b->output_variable_list(), shader_b->interface_block_map(),
this));
UMA_HISTOGRAM_COUNTS_1M("GPU.ProgramCache.MemorySizeAfterKb",
curr_size_bytes_ / 1024);
}
void MemoryProgramCache::LoadProgram(const std::string& key,
......@@ -565,9 +534,6 @@ void MemoryProgramCache::LoadProgram(const std::string& key,
vertex_interface_blocks, proto->fragment_shader().sha().c_str(),
fragment_attribs, fragment_uniforms, fragment_varyings,
fragment_output_variables, fragment_interface_blocks, this));
UMA_HISTOGRAM_COUNTS_1M("GPU.ProgramCache.MemorySizeAfterKb",
curr_size_bytes_ / 1024);
} else {
DVLOG(2) << "Failed to parse proto file.";
}
......
......@@ -212,12 +212,7 @@ void ProgramCache::HandleMemoryPressure(
limit = 0;
}
size_t bytes_freed = Trim(limit);
if (bytes_freed > 0) {
UMA_HISTOGRAM_COUNTS_100000(
"GPU.ProgramCache.MemoryReleasedOnPressure",
static_cast<base::HistogramBase::Sample>(bytes_freed) / 1024);
}
Trim(limit);
}
} // namespace gles2
......
......@@ -1398,7 +1398,6 @@ bool Program::Link(ShaderManager* manager,
&bind_attrib_location_map_, transform_feedback_varyings_,
transform_feedback_buffer_mode_, client);
link = success != ProgramCache::PROGRAM_LOAD_SUCCESS;
UMA_HISTOGRAM_BOOLEAN("GPU.ProgramCache.LoadBinarySuccess", !link);
}
}
......
......@@ -58259,6 +58259,9 @@ uploading your change for review.
<histogram name="GPU.ProgramCache.CompressDataSuccess" units="BooleanSuccess"
expires_after="M77">
<obsolete>
Not used after M77. ProgramCache not actively being tuned.
</obsolete>
<owner>ericrk@chromium.org</owner>
<summary>
Whether we succeeded in compressing program data. Expected to always be
......@@ -58268,6 +58271,9 @@ uploading your change for review.
<histogram name="GPU.ProgramCache.CompressDataTime" units="microseconds"
expires_after="M77">
<obsolete>
Not used after M77. ProgramCache not actively being tuned.
</obsolete>
<owner>ericrk@chromium.org</owner>
<summary>
The time to compress a program's binary data during insertion into the
......@@ -58283,6 +58289,9 @@ uploading your change for review.
<histogram name="GPU.ProgramCache.CompressionPercentage" units="%"
expires_after="M77">
<obsolete>
Not used after M77. ProgramCache not actively being tuned.
</obsolete>
<owner>ericrk@chromium.org</owner>
<summary>
The percentage of raw size that a program binary takes after compression.
......@@ -58291,6 +58300,9 @@ uploading your change for review.
<histogram name="GPU.ProgramCache.DecompressDataSuccess" units="BooleanSuccess"
expires_after="M77">
<obsolete>
Not used after M77. ProgramCache not actively being tuned.
</obsolete>
<owner>ericrk@chromium.org</owner>
<summary>
Whether we succeeded in decompressing program data. Failure indicates disk
......@@ -58300,6 +58312,9 @@ uploading your change for review.
<histogram name="GPU.ProgramCache.DecompressDataTime" units="microseconds"
expires_after="M77">
<obsolete>
Not used after M77. ProgramCache not actively being tuned.
</obsolete>
<owner>ericrk@chromium.org</owner>
<summary>
The time to decompress a program's binary data during retrieval from the
......@@ -58315,6 +58330,9 @@ uploading your change for review.
<histogram name="GPU.ProgramCache.LoadBinarySuccess" enum="BooleanSuccess"
expires_after="M77">
<obsolete>
Not used after M77. ProgramCache not actively being tuned.
</obsolete>
<owner>vmiura@chromium.org</owner>
<summary>
Records if the call to glProgramBinary was successful. This can legitimately
......@@ -58324,6 +58342,9 @@ uploading your change for review.
<histogram name="GPU.ProgramCache.MemoryReleasedOnPressure" units="KB"
expires_after="M77">
<obsolete>
Not used after M77. ProgramCache not actively being tuned.
</obsolete>
<owner>ssid@chromium.org</owner>
<summary>
Amount of memory released from the program cache on memory pressure.
......@@ -58332,6 +58353,9 @@ uploading your change for review.
<histogram name="GPU.ProgramCache.MemorySizeAfterKb" units="KB"
expires_after="M77">
<obsolete>
Not used after M77. ProgramCache not actively being tuned.
</obsolete>
<owner>vmiura@chromium.org</owner>
<summary>
Records the total in-memory cache size, before a program is cached. Can be
......@@ -58342,6 +58366,9 @@ uploading your change for review.
<histogram name="GPU.ProgramCache.MemorySizeBeforeKb" units="KB"
expires_after="M77">
<obsolete>
Not used after M77. ProgramCache not actively being tuned.
</obsolete>
<owner>vmiura@chromium.org</owner>
<summary>
Records the total in-memory cache size, after a program is cached. Can be
......@@ -58352,6 +58379,9 @@ uploading your change for review.
<histogram name="GPU.ProgramCache.ProgramBinarySizeBytes" units="bytes"
expires_after="M77">
<obsolete>
Not used after M77. ProgramCache not actively being tuned.
</obsolete>
<owner>vmiura@chromium.org</owner>
<summary>
The size of program binaries loaded into the gpu program cache.
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