diff options
author | Ricardo Cerqueira <cyanogenmod@cerqueira.org> | 2016-03-16 19:51:18 +0000 |
---|---|---|
committer | Ricardo Cerqueira <ricardo@cyngn.com> | 2016-04-08 12:51:48 +0100 |
commit | 02ee37333288a2d628b358f22aea6e330e7cb8b8 (patch) | |
tree | 6b91466eea35bbdb28e2d98a8ad215eb720e43db | |
parent | b952b460a7f7a738edf37a5998071dbc7a0bc0a8 (diff) | |
download | system_core-02ee37333288a2d628b358f22aea6e330e7cb8b8.zip system_core-02ee37333288a2d628b358f22aea6e330e7cb8b8.tar.gz system_core-02ee37333288a2d628b358f22aea6e330e7cb8b8.tar.bz2 |
liblog: Add xlog symbols on MTK hardware
Change-Id: I1c4bfb228ee261ae4d15e223b4605e39205b5b54
-rw-r--r-- | liblog/logd_write.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/liblog/logd_write.c b/liblog/logd_write.c index bdee28f..7f772af 100644 --- a/liblog/logd_write.c +++ b/liblog/logd_write.c @@ -513,3 +513,42 @@ int __android_log_bswrite(int32_t tag, const char *payload) return write_to_log(LOG_ID_EVENTS, vec, 4); } + +#ifdef MTK_HARDWARE +struct xlog_record { + const char *tag_str; + const char *fmt_str; + int prio; +}; + +void __attribute__((weak)) __xlog_buf_printf(__unused int bufid, const struct xlog_record *xlog_record, ...) { + va_list args; + va_start(args, xlog_record); +#if HAVE_LIBC_SYSTEM_PROPERTIES + int len = 0; + int do_xlog = 0; + char results[PROP_VALUE_MAX]; + + + // MobileLog + len = __system_property_get ("debug.MB.running", results); + if (len && atoi(results)) + do_xlog = 1; + + // ModemLog + len = __system_property_get ("debug.mdlogger.Running", results); + if (len && atoi(results)) + do_xlog = 1; + + // Manual + len = __system_property_get ("persist.debug.xlog.enable", results); + if (len && atoi(results)) + do_xlog = 1; + + if (do_xlog > 0) +#endif + __android_log_vprint(xlog_record->prio, xlog_record->tag_str, xlog_record->fmt_str, args); + + return; +} +#endif |