日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

One Click软件简介

發布時間:2023/12/18 编程问答 47 豆豆
生活随笔 收集整理的這篇文章主要介紹了 One Click软件简介 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

One Click軟件

文章目錄

  • One Click軟件
    • 軟件功能
    • 開發工具
    • 支持平臺
    • 軟件實現原理
    • CommonCommand
        • 命令輸入欄
        • 功能按鈕區
        • 輸出欄
    • simpleperf
      • list
      • stat
      • record
      • report
      • FlameGraph
    • XTS

軟件功能

  • adb常用命令一鍵執行,如獲取android設備號(adb devices)、拍照、截屏等
  • Linux常用命令一鍵執行(待開發)
  • Git常用命令一鍵執行(待開發)
  • simpleperf(Android性能分析工具)一鍵執行,并生成火焰圖
  • XTS測試一鍵執行,測試結果解析,并針對fail項給出歷史解決方案供參考

開發工具

  • Qt5.12

支持平臺

  • Linux

軟件實現原理

運用QThread啟動多線程,實現主線程(界面)和子線程(processor)分離,運用QProcess (The QProcess class is used to start external programs and to communicate with them)啟動/bin/bash腳本,在UI界面輸入命令或點擊按鈕將命令通過發送信號(emit signal)的形式傳遞至processor,然后由processor啟動bash執行命令,并將執行結果、狀態、output同樣已信號的方式返回至UI,顯示在textEdit。

CommonCommand

CommonCommand模塊界面包含3個部分

  • 命令輸入欄
  • 功能按鈕區
  • 輸出欄

命令輸入欄

手動輸入執行命令,通常用于自定義帶參命令的執行。
輸入欄自動補全功能如下:

save command:保存當前輸入的命令,以將該命令更新至補全詞庫(native_cmd_list.txt)
complete regular:補全模式選擇

功能按鈕區

目前已實現的功能有:adb device,root,remount,手機截屏,拍照等
示例:截屏
通過下面輸出欄可以看到,這個按鈕點擊事件其實是在執行:adb shell screencap -p /storage/img_20220420171252.png;adb pull /storage/img_20220420171252.png capture(將圖片pull到./capture),另外可以看到在執行命令時,最下方狀態欄可以看到有綠燈閃爍,表示命令正在執行過程中,執行結束,燈滅。

輸出欄

執行命令實時回顯,如上圖。類似shell終端,將輸出結果實時顯示在textEdit控件。

simpleperf

simpleperf = simple + perf
simple:不是簡單的意思,而是采樣
perf:performance–性能

list

list 命令列出設備上所有可用的事件。不同的設備可能支持不同的事件,因為它們具有不同的硬件和內核

可以看到輸出欄可以拖拽出來方便查看,可雙擊也可直接拖拽

stat

獲取一段時間內,要分析的進程中發生了多少事件。通過傳入不同參數,我們可以選擇要使用哪些事件、要監聽哪些進程/線程,監聽多長時間以及打印間隔,當前可支持客制化的參數如圖所示,更詳細的參數參見‘simpleperf stat -h’,當然你也可以直接在Command中的命令行執行自己客制化的參數

$ simpleperf stat -h Usage: simpleperf stat [options] [command [command-args]]Gather performance counter information of running [command]. Options: -p pid1,pid2,... Stat events on existing processes. #分析進程 -t tid1,tid2,... Stat events on existing threads. #分析線程 -a Collect system-wide information. #收集系統范圍的信息 --cpu cpu_item1,cpu_item2,... Collect information only on the selected cpus. #收集選擇的cup信息 -e event1[:modifier1],event2[:modifier2],... Select a list of events to count. #選擇要統計的事件表 --duration time_in_sec Monitor for time_in_sec seconds. #選擇記監聽時長(s)$ simpleperf stat -e cache-references,cache-misses -a --duration 1 Performance counter statistics: # count event_name # count / runtime, runtime / enabled_time774,728,087 cache-references # 96.513 M/sec (100%)31,985,983 cache-misses # 4.128672% miss rate (100%) Total test time: 1.001893 seconds.

默認分析命令: adb shell system/bin/simpleperf stat -e cache-references,cache-misses -a --duration 10

record

以采樣方式生成profile data,當前可支持客制化的參數如圖所示,更詳細的參數參見‘simpleperf stat -h’,當然你也可以直接在Command中的命令行執行自己客制化的參數

默認執行命令:adb shell rm /data/local/tmp/perf.data;adb shell system/bin/simpleperf record -o /data/local/tmp/perf.data -e task-clock:u -f 1000 -g --duration 10 --log info --app com.tcl.camera;adb pull /data/local/tmp/perf.data
記錄相機app10s內的性能數據,并pull到本地

$ simpleperf record -h Usage: simpleperf record [options] [--] [command [command-args]]Gather sampling information of running [command]. Options: -p pid1,pid2,... Record events on existing processes. #記錄進程事件 -t tid1,tid2,... Record events on existing threads. #記錄線程事件 -a System-wide collection. #系統范圍收集 --cpu cpu_item1,cpu_item2,... Collect information only on the selected cpus. #同stat -e event1[:modifier1],event2[:modifier2],... Select a list of events to count. #同stat -f freq Set event sample frequency. It means recording at most [freq] samples every second. #設置事件采樣頻率,意味著每秒最多采樣[freq]次 --duration time_in_sec Monitor for time_in_sec seconds #同stat -o record_file_name Set record file name, default is perf.data. #設置profile data文件名,默認perf.data --call-graph fp | dwarf[,<dump_stack_size>] Enable call graph recording. #啟用調用圖記錄 -g Same as '--call-graph dwarf'.

report

生成數據報告

默認執行命令:python scripts/report_sample.py > out.perf

$ simpleperf report Cmdline: /system/bin/simpleperf record -g sleep 1 Arch: arm64 Event: cpu-cycles (type 0, config 0) Samples: 56 Event count: 13885436 Overhead Command Pid Tid Shared Object Symbol 9.61% sleep 14852 14852 [kernel.kallsyms] vma_link 8.97% sleep 14852 14852 linker64 soinfo_do_lookup_impl 6.42% sleep 14852 14852 linker64 BionicAllocator::alloc_impl 6.11% sleep 14852 14852 [kernel.kallsyms] __follow_mount_rcu 5.83% sleep 14852 14852 [kernel.kallsyms] clear_page ...

FlameGraph

將數據報告繪制程火焰圖

FlameGraph/stackcollapse-perf.pl out.perf > out.folded;FlameGraph/flamegraph.pl out.folded > graph.svg

XTS

  • 選擇本地xts套件
  • 選擇要執行的命令
  • 選擇執行模塊(目前只支持camera模塊)
  • 輸入要執行的test(輸入為空,則運行整個模塊)
  • run cts

    cts 運行結束之后會自動解析results/latest/result.xml,將結果顯示在tableView中,并且會檢索fail項的歷史解決方案

  • 加載results文件

如果某一個fail項有歷史解決方案,可以點擊Resulotion欄中的連接直接轉跳至相應網頁

總結

以上是生活随笔為你收集整理的One Click软件简介的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。