Mtklog Structure and analysis

Source: Internet
Author: User
Tags system log zip cpu usage high cpu usage

1.mtklog Introduction: Mtklog is a series of problem tracking files generated by the log generation tool Mtklogger, whose main function is to quickly locate the anomalies generated by the system or application to solve the problem.

Categories of Mtklog: Mdlog, Mobile log, Network log, aee_exp log that may appear

MD log:medom-related bottom log

Mobile log: Mainly Android log and kernel log

Network log: NET-related log

Aee_exp log:crash ANR Restart related log output

2.mtklog turn on and off:

(1) Enter * #9646633 # on the Dial screen:

(2) Enter Engineermode's first telephony interface:

(3) Swipe left into the log and debugging interface:

(4) Click on the Mtklogger menu:

Click the Log Settings icon to go to the Log Settings screen, if I just print mobilelog can turn Modemlog,networklog,gpslog off, click on the blue background 1:

(5) Click Start (Red play button) button:

(6) Log open:

(7) When we have found the anomaly, when the log is closed and the screenshot is recorded at a point in time, drop-down into the drop-down bar interface, click Mtklogger is running:

(8) Click the Stop button:

If the diagram closes successfully:

3.mtklog Export and Analysis:

(1) After Mtklogger stop, phone USB, drop down dropdown, click on USB for charging, switch to MTP mode:

Transfer files (MTP);

(2) Double-click: Portable Device:

(3) Locate the Mtklog folder in the internal storage copy and paste it locally:

(4) Open the Mtklog folder:

(4) For analysis log, we mainly analyze the corresponding Android log and kernel log in the Mobilelog folder:

The corresponding log file name is called:

Crash_log: Crash log, main output program crashes due to crash log

Events_log: Event log, main output record each activity cycle and event

Kernel_log: Bottom drive, key, low memory related log

Sys_log: System log, exception locator point

Radio_log: Output call, network status change

Main_log: Verbose output log for each step

Analyze kernel log installation to see the point in time for the corresponding Kernal_log:

After the installation is successful, open the Kernal_log.localtime file as follows to view the Kernal log with a point in time:

(5) Common anomaly Analysis:

1. Compile error :

Search for the unfinished keyword in build.log, find the reason why the error can be quickly located above, or search error: keyword can directly locate the relevant error file (note that the search error and colon)

2. Program crashes (System prompt has stopped running):

(1) Startup crash: Normal for third-party presets missing library files, or compatibility issues

(2) Inter-application interaction crashes: StartActivity cannot find many corresponding package names or class names, or no permissions to initiate activity

(3) Application internal logic NULL pointer exception causes program crash (NullPointerException)

The above three cases can be searched in the Mtklog\mobilelog\aplog_2016_0505_115433\events_log file crash keyword Quick location problem point, Crash_log can see the corresponding problem cause:

Line 4201:03-29 11:25:32.894092 939 949 I Am_crash:[9337,0,com.bbm,954744388,java.lang.unsatisfiedlinkerror, Dalvik.system.pathclassloader[dexpathlist[[zip file "/system/framework/com.google.android.maps.jar", zip file "/ data/app/com.bbm-1/base.apk "],nativelibrarydirectories=[/data/app-lib/com.bbm-1,/data/app/com.bbm-1/base.apk!/ lib/armeabi-v7a,/vendor/lib,/system/lib]]]couldn ' t find "libgnustl_shared.so", runtime.java,367]
Line 4202:03-29 11:25:32.910190 939 949 iam_finish_activity: [0,198242511,14,com.bbm/.ui.activities.startupactivity, Force-crash]

3. Program Flash Back:

(1) External reasons: Insufficient physical memory, was Kill,events_log search low_memory keyword, to determine the low memory kill program, Kernal_log there is a corresponding point in time is lower than the following:

05-10 11:36:22.588540 923 1439 iam_low_memory:19
05-10 11:36:22.594222 923 938 I am_destroy_activity:[0,205784777,125,com.mediatek.filemanager/. Mainfilemanageractivity,finish-idle]
05-10 11:36:22.599262 923 923 I Notification_cancel_all:[1000,923,com.mediatek.filemanager,0,0,0,5,null]
05-10 11:36:22.601661 923 923 I Notification_cancel_all:[1000,923,com.android.providers.downloads,0,0,0,5,null]
05-10 11:36:22.650000 2036 2036 I auditd:type=1400 Audit (0.0:347): avc:denied

{Read} for comm= "Gpuappspectator" name= "CmdLine" dev= "proc" ino=10905 Scontext=u:r:gas_srv:s0tcontext=u:r:system_app : S0 tclass=file permissive=0
05-10 11:36:22.869048 923 1910 iam_proc_bound: [0,3769,com.cyin.himgr]
05-10 11:36:23.403472 1532 1532 Iam_on_resume_called:[0,com.android.hios.launcher3.launcher]
05-10 11:36:23.650000 2036 2036 I auditd:type=1400 Audit (0.0:348): avc:denied {Read}

Forcomm= "Gpuappspectator" name= "CmdLine" dev= "proc" ino=10905 Scontext=u:r:gas_srv:s0 tcontext=u:r:system_app:s0 Tclass=filepermissive=0
05-10 11:36:23.965602 923 938 I am_destroy_activity:[0,102727749,125, com.android.packageinstaller/. INSTALLAPPPROGRESS,FINISH-IMM]
05-10 11:36:23.972491 241 241 I sf_frame_dur:[com.android.packageinstaller/ com.android.packageinstaller.installappprogress,2375,9,1,0,1,0,0]
05-10 11:36:24.126262 923 1520 I netstats_ Mobile_sample: [0,0,0,0,0,0,0,0,0,0,0,0,-1]
05-10 11:36:24.126560 923 1520 I netstats_wifi_sample:[ 64660,844,36398,408,33328,147,33388,197,32228,126,33388,197,-1]
05-10 11:36:24.244910 923 934 I am_proc_died:  [0,3665,com.android.packageinstaller]
05-10 11:36:24.245968 923 934 I wm_task_removed: [125, Removeapptoken:last token]
05-10 11:36:24.246168 923 934 I Wm_task_removed: [125,removetask]

05-10 11:36:24.248168 923 934 I am_low_memory:19
05-10 11:36:24.255912 923 923 I Notification_cancel_all:[1000,923,com.android.packageinstaller,0,0,0,5,null]
05-10 11:36:24.318915 923 933 inetstats_mobile_sample: [0,0,0,0,0,0,0,0,0,0,0,0,-1]

(2) Internal reason: Main_log/sys_log search exception or died keyword to locate the corresponding package name, and then locate the problem

4.ANR Problem:

The ANR should provide the Traces.txt file, search directly in the file for the CMD keyword, locate the problem point. Lock three directions: Memoryleak (low memory), CPU block (high CPU usage), iowait (too frequent for IO stream)

(1) Memoryleak: First search for low memory-related Low_memory keywords based on Android log to determine if there is a low memory phenomenon

(2) CPU block: Search for the corresponding packet before the total keyword before and after the percentage, if the percentage of nearly 100% indicates that the CPU starvation caused by the ANR:

(3) iowait: Search iowait keyword to see the percentage before ANR, if the percentage is too high, indicating that the I/O stream is used too frequently to cause ANR, this item needs to modify the loading process of the relevant database, as follows:

4-0113:12:15.872 E/activitymanager: 5.5%21404/com.android.email:1.3% user + 4.1% Kernel/faults:10 minor

04-0113:12:15.872 E/activitymanager: 4.3%220/system_server:2.7% user + 1.5% Kernel/faults:11 minor 2 major

04-0113:12:15.872 E/activitymanager: 0.9%52/spi_qsd.0:0% user + 0.9% kernel

04-0113:12:15.872 E/activitymanager: 0.5%65/irq/170-cyttsp-: 0% user + 0.5% kernel

04-0113:12:15.872 E/activitymanager: 0.5%296/com.android.systemui:0.5% user + 0% kernel

04-0113:12:15.872 E/activitymanager: 100%total:4.8% user + 7.6% kernel + 87% iowait

04-0113:12:15.872 E/activitymanager:cpuusagefrom 3697ms to 4223ms later:--The amount of CPU used after ANR

04-0113:12:15.872 E/activitymanager: 25%21404/com.android.email:25% user + 0% kernel/faults:191 minor

04-0113:12:15.872 E/activitymanager: 16% 21603/__eas (par.hakan:16% user + 0% kernel

04-0113:12:15.872 E/activitymanager: 7.2% 21406/gc:7.2% user + 0% kernel

04-0113:12:15.872 E/activitymanager: 1.8% 21409/compiler:1.8% user + 0% kernel

04-0113:12:15.872 E/activitymanager: 5.5%220/system_server:0% user + 5.5% kernel/faults:1 minor

04-0113:12:15.872 E/activitymanager: 5.5% 263/inputdispatcher:0% user + 5.5% kernel

04-0113:12:15.872 E/activitymanager: 32%total:28% user + 3.7% kernel

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.