Add custom counts histogram option for Skia
In the companion Skia CL: https://skia-review.googlesource.com/c/skia/+/969816 I add uses of the histogram call to log Precompilation UMA stats. Low-Coverage-Reason: EXPERIMENTAL_CODE Precompilation is not yet enabled Bug: 358074434 Change-Id: Iae364466637a4c242d4ed7395874f81fcff3eff8 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6394060 Reviewed-by: Michael Ludwig <michaelludwig@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com> Cr-Commit-Position: refs/heads/main@{#1438884}
This commit is contained in:
parent
5aee8a16a1
commit
1220d02e9a
@ -55,21 +55,36 @@ void HistogramMemoryKB(std::atomic_uintptr_t* atomic_histogram_pointer,
|
||||
base::HistogramBase::kUmaTargetedHistogramFlag));
|
||||
}
|
||||
|
||||
// Wrapper around HISTOGRAM_POINTER_USE - mimics
|
||||
// UMA_HISTOGRAM_CUSTOM_COUNTS but allows for an external
|
||||
// atomic_histogram_pointer.
|
||||
void HistogramCustomCounts(std::atomic_uintptr_t* atomic_histogram_pointer,
|
||||
const char* name,
|
||||
int sample,
|
||||
int min_count,
|
||||
int max_count,
|
||||
size_t bucket_count) {
|
||||
HISTOGRAM_POINTER_USE(atomic_histogram_pointer, name, Add(sample),
|
||||
base::Histogram::FactoryGet(
|
||||
name, min_count, max_count, bucket_count,
|
||||
base::HistogramBase::kUmaTargetedHistogramFlag));
|
||||
}
|
||||
|
||||
// Wrapper around HISTOGRAM_POINTER_USE - mimics
|
||||
// UMA_HISTOGRAM_CUSTOM_MICROSECONDS_TIMES but allows for an external
|
||||
// atomic_histogram_pointer.
|
||||
void HistogramCustomMicrosecondsTimes(
|
||||
std::atomic_uintptr_t* atomic_histogram_pointer,
|
||||
const char* name,
|
||||
int64_t sampleUSec,
|
||||
unsigned minUSec,
|
||||
unsigned maxUSec,
|
||||
size_t bucketCount) {
|
||||
int64_t sample_usec,
|
||||
unsigned min_usec,
|
||||
unsigned max_usec,
|
||||
size_t bucket_count) {
|
||||
HISTOGRAM_POINTER_USE(
|
||||
atomic_histogram_pointer, name, Add(sampleUSec),
|
||||
atomic_histogram_pointer, name, Add(sample_usec),
|
||||
base::Histogram::FactoryMicrosecondsTimeGet(
|
||||
name, base::Microseconds(minUSec), base::Microseconds(maxUSec),
|
||||
bucketCount, base::HistogramBase::kUmaTargetedHistogramFlag));
|
||||
name, base::Microseconds(min_usec), base::Microseconds(max_usec),
|
||||
bucket_count, base::HistogramBase::kUmaTargetedHistogramFlag));
|
||||
}
|
||||
|
||||
} // namespace skia
|
||||
|
@ -36,11 +36,16 @@
|
||||
#define SK_HISTOGRAM_MEMORY_KB(name, sample) \
|
||||
SK_HISTOGRAM_POINTER_HELPER(skia::HistogramMemoryKB, "Skia." name, sample)
|
||||
|
||||
#define SK_HISTOGRAM_CUSTOM_MICROSECONDS_TIMES(name, sampleUSec, minUSec, \
|
||||
maxUSec, bucketCount) \
|
||||
SK_HISTOGRAM_POINTER_HELPER(skia::HistogramCustomMicrosecondsTimes, \
|
||||
"Skia." name, sampleUSec, minUSec, maxUSec, \
|
||||
bucketCount);
|
||||
#define SK_HISTOGRAM_CUSTOM_COUNTS(name, sample, min_count, max_count, \
|
||||
bucket_count) \
|
||||
SK_HISTOGRAM_POINTER_HELPER(skia::HistogramCustomCounts, "Skia." name, \
|
||||
sample, min_count, max_count, bucket_count);
|
||||
|
||||
#define SK_HISTOGRAM_CUSTOM_MICROSECONDS_TIMES(name, sample_usec, min_usec, \
|
||||
max_usec, bucket_count) \
|
||||
SK_HISTOGRAM_POINTER_HELPER(skia::HistogramCustomMicrosecondsTimes, \
|
||||
"Skia." name, sample_usec, min_usec, max_usec, \
|
||||
bucket_count);
|
||||
|
||||
namespace skia {
|
||||
|
||||
@ -58,13 +63,19 @@ void HistogramExactLinear(std::atomic_uintptr_t* atomic_histogram_pointer,
|
||||
void HistogramMemoryKB(std::atomic_uintptr_t* atomic_histogram_pointer,
|
||||
const char* name,
|
||||
int sample);
|
||||
void HistogramCustomCounts(std::atomic_uintptr_t* atomic_histogram_pointer,
|
||||
const char* name,
|
||||
int sample,
|
||||
int min_count,
|
||||
int max_count,
|
||||
size_t bucket_count);
|
||||
void HistogramCustomMicrosecondsTimes(
|
||||
std::atomic_uintptr_t* atomic_histogram_pointer,
|
||||
const char* name,
|
||||
int64_t sampleUSec,
|
||||
unsigned minUSec,
|
||||
unsigned maxUSec,
|
||||
size_t bucketCount);
|
||||
int64_t sample_usec,
|
||||
unsigned min_usec,
|
||||
unsigned max_usec,
|
||||
size_t bucket_count);
|
||||
|
||||
} // namespace skia
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user