Lines Matching refs:proto

49 static bool mergeProfileDataIntoProto(protos::GraphicsStatsProto* proto, const std::string& package,
52 static void dumpAsTextToFd(protos::GraphicsStatsProto* proto, int outFd);
163 bool mergeProfileDataIntoProto(protos::GraphicsStatsProto* proto, const std::string& package, in mergeProfileDataIntoProto() argument
166 if (proto->stats_start() == 0 || proto->stats_start() > startTime) { in mergeProfileDataIntoProto()
167 proto->set_stats_start(startTime); in mergeProfileDataIntoProto()
169 if (proto->stats_end() == 0 || proto->stats_end() < endTime) { in mergeProfileDataIntoProto()
170 proto->set_stats_end(endTime); in mergeProfileDataIntoProto()
172 proto->set_package_name(package); in mergeProfileDataIntoProto()
173 proto->set_version_code(versionCode); in mergeProfileDataIntoProto()
174 proto->set_pipeline(data->pipelineType() == RenderPipelineType::SkiaGL ? in mergeProfileDataIntoProto()
176 auto summary = proto->mutable_summary(); in mergeProfileDataIntoProto()
192 if (proto->histogram_size() == 0) { in mergeProfileDataIntoProto()
193 proto->mutable_histogram()->Reserve(sHistogramSize); in mergeProfileDataIntoProto()
195 } else if (proto->histogram_size() != sHistogramSize) { in mergeProfileDataIntoProto()
196 ALOGE("Histogram size mismatch, proto is %d expected %d", proto->histogram_size(), in mergeProfileDataIntoProto()
207 bucket = proto->add_histogram(); in mergeProfileDataIntoProto()
210 bucket = proto->mutable_histogram(index); in mergeProfileDataIntoProto()
224 if (proto->gpu_histogram_size() == 0) { in mergeProfileDataIntoProto()
225 proto->mutable_gpu_histogram()->Reserve(sGPUHistogramSize); in mergeProfileDataIntoProto()
227 } else if (proto->gpu_histogram_size() != sGPUHistogramSize) { in mergeProfileDataIntoProto()
228 ALOGE("GPU histogram size mismatch, proto is %d expected %d", proto->gpu_histogram_size(), in mergeProfileDataIntoProto()
238 bucket = proto->add_gpu_histogram(); in mergeProfileDataIntoProto()
241 bucket = proto->mutable_gpu_histogram(index); in mergeProfileDataIntoProto()
255 static int32_t findPercentile(protos::GraphicsStatsProto* proto, int percentile) { in findPercentile() argument
256 int32_t pos = percentile * proto->summary().total_frames() / 100; in findPercentile()
257 int32_t remaining = proto->summary().total_frames() - pos; in findPercentile()
258 for (auto it = proto->histogram().rbegin(); it != proto->histogram().rend(); ++it) { in findPercentile()
267 static int32_t findGPUPercentile(protos::GraphicsStatsProto* proto, int percentile) { in findGPUPercentile() argument
269 for (auto it = proto->gpu_histogram().rbegin(); it != proto->gpu_histogram().rend(); ++it) { in findGPUPercentile()
274 for (auto it = proto->gpu_histogram().rbegin(); it != proto->gpu_histogram().rend(); ++it) { in findGPUPercentile()
283 void dumpAsTextToFd(protos::GraphicsStatsProto* proto, int fd) { in dumpAsTextToFd() argument
285 if (proto->package_name().empty() || !proto->has_summary()) { in dumpAsTextToFd()
287 proto->package_name().c_str(), proto->has_summary()); in dumpAsTextToFd()
290 dprintf(fd, "\nPackage: %s", proto->package_name().c_str()); in dumpAsTextToFd()
291 dprintf(fd, "\nVersion: %" PRId64, proto->version_code()); in dumpAsTextToFd()
292 dprintf(fd, "\nStats since: %" PRId64 "ns", proto->stats_start()); in dumpAsTextToFd()
293 dprintf(fd, "\nStats end: %" PRId64 "ns", proto->stats_end()); in dumpAsTextToFd()
294 auto summary = proto->summary(); in dumpAsTextToFd()
298 dprintf(fd, "\n50th percentile: %dms", findPercentile(proto, 50)); in dumpAsTextToFd()
299 dprintf(fd, "\n90th percentile: %dms", findPercentile(proto, 90)); in dumpAsTextToFd()
300 dprintf(fd, "\n95th percentile: %dms", findPercentile(proto, 95)); in dumpAsTextToFd()
301 dprintf(fd, "\n99th percentile: %dms", findPercentile(proto, 99)); in dumpAsTextToFd()
309 for (const auto& it : proto->histogram()) { in dumpAsTextToFd()
312 dprintf(fd, "\n50th gpu percentile: %dms", findGPUPercentile(proto, 50)); in dumpAsTextToFd()
313 dprintf(fd, "\n90th gpu percentile: %dms", findGPUPercentile(proto, 90)); in dumpAsTextToFd()
314 dprintf(fd, "\n95th gpu percentile: %dms", findGPUPercentile(proto, 95)); in dumpAsTextToFd()
315 dprintf(fd, "\n99th gpu percentile: %dms", findGPUPercentile(proto, 99)); in dumpAsTextToFd()
317 for (const auto& it : proto->gpu_histogram()) { in dumpAsTextToFd()
381 protos::GraphicsStatsServiceDumpProto& proto() { return mProto; } in proto() function in android::uirenderer::GraphicsStatsService::Dump
460 dump->proto().add_stats()->CopyFrom(statsProto); in addToDump()
474 dump->proto().add_stats()->CopyFrom(statsProto); in addToDump()
483 dump->proto().SerializeToZeroCopyStream(&stream); in finishDump()
496 util::ProtoOutputStream proto; in writeCpuHistogram() local
499 proto.write(android::util::FIELD_TYPE_INT32 | android::util::FIELD_COUNT_REPEATED | in writeCpuHistogram()
505 proto.write(android::util::FIELD_TYPE_INT64 | android::util::FIELD_COUNT_REPEATED | in writeCpuHistogram()
510 proto.serializeToVector(&outVector); in writeCpuHistogram()
516 util::ProtoOutputStream proto; in writeGpuHistogram() local
519 proto.write(android::util::FIELD_TYPE_INT32 | android::util::FIELD_COUNT_REPEATED | in writeGpuHistogram()
525 proto.write(android::util::FIELD_TYPE_INT64 | android::util::FIELD_COUNT_REPEATED | in writeGpuHistogram()
530 proto.serializeToVector(&outVector); in writeGpuHistogram()
538 auto& serviceDump = dump->proto(); in finishDumpInMemory()