diff options
author | Florian Mayer <fmayer@google.com> | 2021-01-29 15:57:56 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2021-01-29 15:57:56 +0000 |
commit | 44382b4a2ab2a5f6a0a0e055f84c119790126995 (patch) | |
tree | 34077a2eaa4f02284d6030b90814ddff1c1202a6 | |
parent | 2c34e7b1bd19a22f5c8d41925069d7e1a7851e3b (diff) | |
parent | 5b17cd48f9b70e65413be7444058ab84a5438e3a (diff) | |
download | perfetto-44382b4a2ab2a5f6a0a0e055f84c119790126995.tar.gz |
Merge "Add TP stat for adjusted sampling rate."
-rw-r--r-- | src/trace_processor/importers/proto/proto_trace_parser.cc | 6 | ||||
-rw-r--r-- | src/trace_processor/storage/stats.h | 4 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/trace_processor/importers/proto/proto_trace_parser.cc b/src/trace_processor/importers/proto/proto_trace_parser.cc index b93af9950..60e2badf5 100644 --- a/src/trace_processor/importers/proto/proto_trace_parser.cc +++ b/src/trace_processor/importers/proto/proto_trace_parser.cc @@ -320,6 +320,12 @@ void ProtoTraceParser::ParseProfilePacket( if (entry.hit_guardrail()) context_->storage->IncrementIndexedStats(stats::heapprofd_hit_guardrail, pid); + if (entry.orig_sampling_interval_bytes()) { + context_->storage->SetIndexedStats( + stats::heapprofd_sampling_interval_adjusted, pid, + static_cast<int64_t>(entry.sampling_interval_bytes()) - + static_cast<int64_t>(entry.orig_sampling_interval_bytes())); + } for (auto sample_it = entry.samples(); sample_it; ++sample_it) { protos::pbzero::ProfilePacket::HeapSample::Decoder sample(*sample_it); diff --git a/src/trace_processor/storage/stats.h b/src/trace_processor/storage/stats.h index 041f8b39d..0e7f3eb14 100644 --- a/src/trace_processor/storage/stats.h +++ b/src/trace_processor/storage/stats.h @@ -143,6 +143,10 @@ namespace stats { "The target was already profiled by another tracing session, so the " \ "profile was not taken. Indexed by target upid."), \ F(heapprofd_non_finalized_profile, kSingle, kError, kTrace, ""), \ + F(heapprofd_sampling_interval_adjusted, \ + kIndexed, kInfo, kTrace, \ + "By how many byes the interval for PID was increased " \ + "by adaptive sampling."), \ F(metatrace_overruns, kSingle, kError, kTrace, ""), \ F(packages_list_has_parse_errors, kSingle, kError, kTrace, ""), \ F(packages_list_has_read_errors, kSingle, kError, kTrace, ""), \ |