As the complexity of mobile applications grows exponentially and the fragmentation of user device environments intensifies, ensuring online application stability faces unprecedented challenges. Traditional methods, such as static logging and post-crash analysis, lack real-time contextual information, rendering them ineffective against "ghost bugs" that only manifest in specific scenarios. This highlights an urgent need for dynamic runtime observability: intercepting and tracing arbitrary methods in production without requiring an app release. We propose XTrace, a novel dynamic tracing framework. XTrace introduces a new paradigm of non-invasive proxying, which avoids direct modification of the virtual machine's underlying data structures. It achieves high-performance method interception by leveraging and optimizing the highly stable, built-in instrumentation mechanism of the Android ART virtual machine. Evaluated in a ByteDance application with hundreds of millions of daily active users, XTrace demonstrated production-grade stability and performance. Large-scale online A/B experiments confirmed its stability, showing no statistically significant impact (p > 0.05) on Crash User Rate or ANR rate, while maintaining minimal overhead (<7 ms startup latency, <0.01 ms per-method call) and broad compatibility (Android 5.0-15+). Critically, XTrace diagnosed over 11 severe online crashes and multiple performance bottlenecks, improving root-cause localization efficiency by over 90%. This confirms XTrace provides a production-grade solution that reconciles the long-standing conflict between stability and comprehensive coverage in Android dynamic tracing.


翻译:随着移动应用程序复杂度呈指数级增长以及用户设备环境碎片化加剧,确保线上应用稳定性面临前所未有的挑战。传统方法(如静态日志记录和崩溃后分析)缺乏实时上下文信息,导致其无法有效应对仅在特定场景下显现的"幽灵故障"。这凸显了对动态运行时可观测性的迫切需求:即在无需发布新版本的情况下,在生产环境中拦截和追踪任意方法。本文提出XTrace,一种新型动态追踪框架。XTrace引入了一种非侵入式代理的新范式,避免直接修改虚拟机底层数据结构。该框架通过利用并优化Android ART虚拟机高度稳定的内置插桩机制,实现了高性能方法拦截。在日活跃用户数亿级的字节跳动应用中进行评估,XTrace展现出生产级稳定性和性能表现。大规模线上A/B实验证实了其稳定性,对崩溃用户率与ANR率均未产生统计学显著影响(p > 0.05),同时保持极低开销(启动延迟<7毫秒,单方法调用耗时<0.01毫秒)和广泛兼容性(Android 5.0-15+)。关键的是,XTrace成功诊断了11个以上严重线上崩溃及多个性能瓶颈,将根因定位效率提升超过90%。这证明XTrace提供了一种生产级解决方案,有效调和了Android动态追踪中长期存在的稳定性与全面覆盖之间的矛盾。

0
下载
关闭预览

相关内容

Python图像处理,366页pdf,Image Operators Image Processing in Python
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
VIP会员
相关基金
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员