2013-03-01 43 views
3

我對Android的netstats及其報告方式有一個疑問。解讀Android xt_qtaguid /統計信息

通過運行該代碼在CMD:adb shell cat proc/net/xt_qtaguid/stats > C:\netstats.txt"

我得到那個看起來或多或少像這樣的文件(我把片段的問題的緣故):

idx iface acct_tag_hex uid_tag_int cnt_set rx_bytes rx_packets tx_bytes tx_packets rx_tcp_bytes rx_tcp_packets rx_udp_bytes rx_udp_packets rx_other_bytes rx_other_packets tx_tcp_bytes tx_tcp_packets tx_udp_bytes tx_udp_packets tx_other_bytes tx_other_packets 
44 wlan0 0x0 1
45 wlan0 0x0 1
46 wlan0 0x0 10138 0 19775 84 13625 129 19775 84 0 0 0 0 13625 129 0 0 0 0 
47 wlan0 0x0 10138 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
48 wlan0 0x0 10142 0 36422 67 43115 105 36070 64 352 3 0 0 42467 96 648 9 0 0 
49 wlan0 0x0 10142 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
50 wlan0 0x300000000 1
51 wlan0 0x300000000 1
52 wlan0 0x3f500000000 10096 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
53 wlan0 0x3f500000000 10096 1 2937868 2025 32034 747 2937868 2025 0 0 0 0 32034 747 0 0 0 
54 wlan0 0xdc4e7700000000 10022 0 31623 75 18611 106 31623 75 0 0 0 0 18611 106 0 0 0 0 
55 wlan0 0xdc4e7700000000 10022 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
56 wlan0 0x1000000100000000 1
57 wlan0 0x1000000100000000 1
61 wlan0 0x1010000000000000 10045 1 33010 109 27695 113 33010 109 0 0 0 0 27695 113 0 0 0 0 
62 wlan0 0x1100000000000000 10046 0 6804 14 2064 19 6804 14 0 0 0 0 2064 19 0 0 0 0 
63 wlan0 0x1100000000000000 10046 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
64 wlan0 0x1144000400000000 10022 0 2532 5 1860 6 2532 5 0 0 0 0 1860 6 0 0 0 0 
65 wlan0 0x1144000400000000 10022 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
66 wlan0 0x1244000400000000 10022 0 8197 14 3134 20 8197 14 0 0 0 0 3134 20 0 0 0 0 
67 wlan0 0x1244000400000000 10022 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
68 wlan0 0xffffff0100000000 10045 0 8566814 6535 159315 2688 8566814 6535 0 0 0 0 159315 2688 0 0 0 0 
69 wlan0 0xffffff0100000000 10045 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 

我知道它被打破下跌UID's(10123,10138,10142等),但我無法弄清楚是什麼cnt_set(爲什麼每個UID分解爲0或1)和acct_tag_hex是(我唯一的猜測是,它意味着不同的線程或套接字)?

如果有人可以給我一些關於這兩件事情意味着什麼的基本知識,我將不勝感激。

感謝-Z

回答

10

acct_tag_hex是一個套接字標籤

線,cnt_set==0是後臺數據

線,cnt_set==1是前景數據

總流量既是

的總和
+0

爲什麼在同一個UID上有幾個cnt_set = 1而不是cnt_set = 0的數據記錄。例如:
12 wlan0 0x0 10008 0 0 0 52 1 0 0 0 0 0 0 52 1 0 0 0 0
13 wlan0 0x0 10008 1 25425 30 3073 39 25425 30 0 0 0 0 3073 39 0 0 0 0

In這個例子,因爲Im忽略cnt = 1是否意味着這個應用程序不使用數據? – Nefariis 2013-03-01 22:15:31

+0

這只是區分2組不同的數據。無論是調用com.android.server.NetworkManagementSocketTagger.setKernelCounterSet來切換計數器集,都應該有這樣做的目的。總流量將是兩者的總和。 – 2013-03-01 22:29:19

+0

因此可以在cnt = 1上顯示數據?那麼將0和1的數據加在一起以獲得更精確的整個UID數據流量結果會更好嗎?如果你看一下原始問題的第52行和第53行的例子,似乎在這種情況下,我將不得不使用cnt = 1,雖然我沒有顯示它,但我有幾個應用程序在0& 1. – Nefariis 2013-03-01 22:34:56