Lines Matching refs:proto
48 static bool mergeProfileDataIntoProto(protos::GraphicsStatsProto* proto, const std::string& package,
51 static void dumpAsTextToFd(protos::GraphicsStatsProto* proto, int outFd);
162 bool mergeProfileDataIntoProto(protos::GraphicsStatsProto* proto, const std::string& package, in mergeProfileDataIntoProto() argument
165 if (proto->stats_start() == 0 || proto->stats_start() > startTime) { in mergeProfileDataIntoProto()
166 proto->set_stats_start(startTime); in mergeProfileDataIntoProto()
168 if (proto->stats_end() == 0 || proto->stats_end() < endTime) { in mergeProfileDataIntoProto()
169 proto->set_stats_end(endTime); in mergeProfileDataIntoProto()
171 proto->set_package_name(package); in mergeProfileDataIntoProto()
172 proto->set_version_code(versionCode); in mergeProfileDataIntoProto()
173 proto->set_pipeline(data->pipelineType() == RenderPipelineType::SkiaGL ? in mergeProfileDataIntoProto()
175 auto summary = proto->mutable_summary(); in mergeProfileDataIntoProto()
191 if (proto->histogram_size() == 0) { in mergeProfileDataIntoProto()
192 proto->mutable_histogram()->Reserve(sHistogramSize); in mergeProfileDataIntoProto()
194 } else if (proto->histogram_size() != sHistogramSize) { in mergeProfileDataIntoProto()
195 ALOGE("Histogram size mismatch, proto is %d expected %d", proto->histogram_size(), in mergeProfileDataIntoProto()
206 bucket = proto->add_histogram(); in mergeProfileDataIntoProto()
209 bucket = proto->mutable_histogram(index); in mergeProfileDataIntoProto()
223 if (proto->gpu_histogram_size() == 0) { in mergeProfileDataIntoProto()
224 proto->mutable_gpu_histogram()->Reserve(sGPUHistogramSize); in mergeProfileDataIntoProto()
226 } else if (proto->gpu_histogram_size() != sGPUHistogramSize) { in mergeProfileDataIntoProto()
227 ALOGE("GPU histogram size mismatch, proto is %d expected %d", proto->gpu_histogram_size(), in mergeProfileDataIntoProto()
237 bucket = proto->add_gpu_histogram(); in mergeProfileDataIntoProto()
240 bucket = proto->mutable_gpu_histogram(index); in mergeProfileDataIntoProto()
254 static int32_t findPercentile(protos::GraphicsStatsProto* proto, int percentile) { in findPercentile() argument
255 int32_t pos = percentile * proto->summary().total_frames() / 100; in findPercentile()
256 int32_t remaining = proto->summary().total_frames() - pos; in findPercentile()
257 for (auto it = proto->histogram().rbegin(); it != proto->histogram().rend(); ++it) { in findPercentile()
266 static int32_t findGPUPercentile(protos::GraphicsStatsProto* proto, int percentile) { in findGPUPercentile() argument
268 for (auto it = proto->gpu_histogram().rbegin(); it != proto->gpu_histogram().rend(); ++it) { in findGPUPercentile()
273 for (auto it = proto->gpu_histogram().rbegin(); it != proto->gpu_histogram().rend(); ++it) { in findGPUPercentile()
282 void dumpAsTextToFd(protos::GraphicsStatsProto* proto, int fd) { in dumpAsTextToFd() argument
284 if (proto->package_name().empty() || !proto->has_summary()) { in dumpAsTextToFd()
286 proto->package_name().c_str(), proto->has_summary()); in dumpAsTextToFd()
289 dprintf(fd, "\nPackage: %s", proto->package_name().c_str()); in dumpAsTextToFd()
290 dprintf(fd, "\nVersion: %" PRId64, proto->version_code()); in dumpAsTextToFd()
291 dprintf(fd, "\nStats since: %" PRId64 "ns", proto->stats_start()); in dumpAsTextToFd()
292 dprintf(fd, "\nStats end: %" PRId64 "ns", proto->stats_end()); in dumpAsTextToFd()
293 auto summary = proto->summary(); in dumpAsTextToFd()
297 dprintf(fd, "\n50th percentile: %dms", findPercentile(proto, 50)); in dumpAsTextToFd()
298 dprintf(fd, "\n90th percentile: %dms", findPercentile(proto, 90)); in dumpAsTextToFd()
299 dprintf(fd, "\n95th percentile: %dms", findPercentile(proto, 95)); in dumpAsTextToFd()
300 dprintf(fd, "\n99th percentile: %dms", findPercentile(proto, 99)); in dumpAsTextToFd()
308 for (const auto& it : proto->histogram()) { in dumpAsTextToFd()
311 dprintf(fd, "\n50th gpu percentile: %dms", findGPUPercentile(proto, 50)); in dumpAsTextToFd()
312 dprintf(fd, "\n90th gpu percentile: %dms", findGPUPercentile(proto, 90)); in dumpAsTextToFd()
313 dprintf(fd, "\n95th gpu percentile: %dms", findGPUPercentile(proto, 95)); in dumpAsTextToFd()
314 dprintf(fd, "\n99th gpu percentile: %dms", findGPUPercentile(proto, 99)); in dumpAsTextToFd()
316 for (const auto& it : proto->gpu_histogram()) { in dumpAsTextToFd()
380 protos::GraphicsStatsServiceDumpProto& proto() { return mProto; } in proto() function in android::uirenderer::GraphicsStatsService::Dump
459 dump->proto().add_stats()->CopyFrom(statsProto); in addToDump()
473 dump->proto().add_stats()->CopyFrom(statsProto); in addToDump()
482 dump->proto().SerializeToZeroCopyStream(&stream); in finishDump()
495 util::ProtoOutputStream proto; in writeCpuHistogram() local
498 proto.write(android::util::FIELD_TYPE_INT32 | android::util::FIELD_COUNT_REPEATED | in writeCpuHistogram()
504 proto.write(android::util::FIELD_TYPE_INT64 | android::util::FIELD_COUNT_REPEATED | in writeCpuHistogram()
509 proto.serializeToVector(&outVector); in writeCpuHistogram()
515 util::ProtoOutputStream proto; in writeGpuHistogram() local
518 proto.write(android::util::FIELD_TYPE_INT32 | android::util::FIELD_COUNT_REPEATED | in writeGpuHistogram()
524 proto.write(android::util::FIELD_TYPE_INT64 | android::util::FIELD_COUNT_REPEATED | in writeGpuHistogram()
529 proto.serializeToVector(&outVector); in writeGpuHistogram()
537 auto& serviceDump = dump->proto(); in finishDumpInMemory()