AsciiDoc文章模板
生活随笔
收集整理的這篇文章主要介紹了
AsciiDoc文章模板
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
文檔模板
= Android性能分析工具--Perfetto :keywords: adoc, example :author: Jack :email: weijaky@gmail.com :revnumber: v1.0 :revdate: 2022-12-20 :stem: latexmath :icons: font :source-highlighter: coderay :sectnums: :sectlinks: :sectnumlevels: 4 :toc: :toc-title: 目錄 :toclevels: 3 :doctype: article //圖片默認目錄 :imagesdir: ./images // 圖標默認目錄 :iconsdir: ./icons // CSS樣式默認目錄 :stylesdir: ./styles== 序言 本文將從啟動速度、內存、卡頓、電量、流量、瘦身等多個維度進行原理剖析及解決實戰。[plantuml, hello] ---- A --> B : call B --> A : replay ----== 什么是Perfetto Perfetto 是 Android 10 中引入的全新平臺級跟蹤工具。這是適用于 Android、Linux 和 Chrome 的更加通用和復雜的開源跟蹤項目。=== 和Systrace的關系 與 Systrace 不同,它提供數據源超集,可以用 protobuf 編碼的二進制流形式記錄任意長度的跟蹤記錄。總而言之,可以將Perfetto理解為sysyrace的升級版, 用在更新的平臺、新圖表展示更多的信息。同時在android系統中,“系統跟蹤”應用是一款用于將設備活動保存到跟蹤文件的 Android 工具。 在搭載 Android 10(API 級別 29)或更高版本的設備上,跟蹤文件會以 Perfetto 格式保存。 在搭載較低版本 Android 系統的設備上,跟蹤文件會以 systrace 格式保存。在兼容性上,考慮到一些歷史原因,Perfetto工具抓取的trace文件也可以轉換成sysytrace視圖, 習慣用systrace的也可以用Perfetto的Open with legacy UI來完成轉換功能。=== 相比Systrace的優勢 * *UI:* perfetto的操作和systrace的操作類似,界面UI更加美觀,進程相關信息顯示更全。 * *流暢性:* 打開較大的trace文件比systrace更流暢一些。 * *線程:* 如果你對某些線程感興趣,可以置頂放在一起分析。看線程被誰喚醒很方便。 * *Binder:* Binder跨進程點擊跳轉的跟蹤更加?便。== 如何使用Perfetto === 常規操作 要想使用perfetto,主要執行命令:[source, bash] ---- #1 設置屬性 adb shell setprop persist.traced.enable 1 #2 信息收集perfetto命令 adb shell perfetto -o /data/misc/perfetto-traces/trace_file.perfetto-trace -t 20s sched freq idle am wm gfx view binder_driver hal dalvik camera input res memory #3 pull出 trace文件 adb pull /data/misc/perfetto-traces/trace_file.perfetto-trace . ---- 生成的trace文件可以用網頁版的Perfetto UI直接查看。Perfetto可以在瀏覽器中可以直接打開,網址為: http://ui.perfetto.dev[Perfetto UI],點進后是這樣:image::image-2022-12-20-22-46-17-647.jpg[Perfetto界面] 打開trace文件后效果如下所示:image::image-2022-12-20-23-50-14-845.jpg[] 基本操作和sysytrace幾乎全部通用。== perfetto關于內存調試文檔整理 . 調試內存可參照文檔:Android 上調試內存使用情況 Perfetto Tracing文檔(Chrome/中文翻譯) . 內存事件和計數器相關:counters and events-Perfetto Tracing文檔(Chrome/中文翻譯) . native heap調試相關:Native heap profiler-Perfetto Tracing文檔(Chrome/中文翻譯) . java heap調試相關:java heap profiler-Perfetto Tracing文檔(Chrome/中文翻譯)== 總結perfotto功能主要涉及 數據源、應用檢測、痕跡分析、追蹤可視化等功能。---- Perfetto provides also a brand new trace visualizer for opening and querying hours-long traces, available at ui.perfetto.dev. The new visualizer takes advantage of modern web platform technologies. Its multi-threading design based WebWorkers keeps the UI always responsive; the analytical power of Trace Processor and SQLite is fully available in-browser through WebAssembly.The Perfetto UI works fully offline after it has been opened once. Traces opened with the UI are processed locally by the browser and do not require any server-side interaction. ----總結
以上是生活随笔為你收集整理的AsciiDoc文章模板的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 如何去除PDF文档的加密
- 下一篇: Three开发笔记(二)