#ifdefined(__BIONIC__) staticvoid PrintLogStats(uint64_t& last_time) {
logger_list* logger =
android_logger_list_open(android_name_to_log_id("main"), ANDROID_LOG_NONBLOCK, 0, getpid()); if (logger == nullptr) {
printf("Failed to open log for main\n"); return;
}
uint64_t last_message_time = last_time; while (true) {
log_msg entry;
ssize_t retval = android_logger_list_read(logger, &entry); if (retval == 0) { break;
} if (retval < 0) { if (retval == -EINTR) { continue;
} // EAGAIN means there is nothing left to read when ANDROID_LOG_NONBLOCK is set. if (retval != -EAGAIN) {
printf("Failed to read log entry: %m");
} break;
} if (entry.msg() == nullptr) { continue;
} // Only print allocator tagged log entries.
std::string_view tag(entry.msg() + 1); if (tag != "scudo" && tag != "jemalloc") { continue;
} if (entry.nsec() > last_time) {
printf(" %s\n", &tag.back() + 2); // Only update the last time outside this loop just in case two or more // messages have the same timestamp.
last_message_time = entry.nsec();
}
}
android_logger_list_close(logger);
last_time = last_message_time;
} #endif
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.