Lines Matching refs:proto

44 static bool mergeProfileDataIntoProto(protos::GraphicsStatsProto* proto,
47 static void dumpAsTextToFd(protos::GraphicsStatsProto* proto, int outFd);
158 bool mergeProfileDataIntoProto(protos::GraphicsStatsProto* proto, const std::string& package, in mergeProfileDataIntoProto() argument
161 if (proto->stats_start() == 0 || proto->stats_start() > startTime) { in mergeProfileDataIntoProto()
162 proto->set_stats_start(startTime); in mergeProfileDataIntoProto()
164 if (proto->stats_end() == 0 || proto->stats_end() < endTime) { in mergeProfileDataIntoProto()
165 proto->set_stats_end(endTime); in mergeProfileDataIntoProto()
167 proto->set_package_name(package); in mergeProfileDataIntoProto()
168 proto->set_version_code(versionCode); in mergeProfileDataIntoProto()
169 auto summary = proto->mutable_summary(); in mergeProfileDataIntoProto()
185 if (proto->histogram_size() == 0) { in mergeProfileDataIntoProto()
186 proto->mutable_histogram()->Reserve(sHistogramSize); in mergeProfileDataIntoProto()
188 } else if (proto->histogram_size() != sHistogramSize) { in mergeProfileDataIntoProto()
189 ALOGE("Histogram size mismatch, proto is %d expected %d", proto->histogram_size(), in mergeProfileDataIntoProto()
200 bucket = proto->add_histogram(); in mergeProfileDataIntoProto()
203 bucket = proto->mutable_histogram(index); in mergeProfileDataIntoProto()
217 static int32_t findPercentile(protos::GraphicsStatsProto* proto, int percentile) { in findPercentile() argument
218 int32_t pos = percentile * proto->summary().total_frames() / 100; in findPercentile()
219 int32_t remaining = proto->summary().total_frames() - pos; in findPercentile()
220 for (auto it = proto->histogram().rbegin(); it != proto->histogram().rend(); ++it) { in findPercentile()
229 void dumpAsTextToFd(protos::GraphicsStatsProto* proto, int fd) { in dumpAsTextToFd() argument
231 if (proto->package_name().empty() || !proto->has_summary()) { in dumpAsTextToFd()
233 proto->package_name().c_str(), proto->has_summary()); in dumpAsTextToFd()
236 dprintf(fd, "\nPackage: %s", proto->package_name().c_str()); in dumpAsTextToFd()
237 dprintf(fd, "\nVersion: %" PRId64, proto->version_code()); in dumpAsTextToFd()
238 dprintf(fd, "\nStats since: %" PRId64 "ns", proto->stats_start()); in dumpAsTextToFd()
239 dprintf(fd, "\nStats end: %" PRId64 "ns", proto->stats_end()); in dumpAsTextToFd()
240 auto summary = proto->summary(); in dumpAsTextToFd()
244 dprintf(fd, "\n50th percentile: %dms", findPercentile(proto, 50)); in dumpAsTextToFd()
245 dprintf(fd, "\n90th percentile: %dms", findPercentile(proto, 90)); in dumpAsTextToFd()
246 dprintf(fd, "\n95th percentile: %dms", findPercentile(proto, 95)); in dumpAsTextToFd()
247 dprintf(fd, "\n99th percentile: %dms", findPercentile(proto, 99)); in dumpAsTextToFd()
255 for (const auto& it : proto->histogram()) { in dumpAsTextToFd()
315 protos::GraphicsStatsServiceDumpProto& proto() { return mProto; } in proto() function in android::uirenderer::GraphicsStatsService::Dump
345 dump->proto().add_stats()->CopyFrom(statsProto); in addToDump()
357 dump->proto().add_stats()->CopyFrom(statsProto); in addToDump()
366 dump->proto().SerializeToZeroCopyStream(&stream); in finishDump()