System Abnormal burying Point

Source: Internet
Author: User

Dropbox will crawl the relevant information at the following time:
A, out of the abnormal before the shutdown Systemserver will collect the following types of errors:watchdog, ANR, WTF, Lowmem, Native_crash, CrashTAG = watchdog, ANR, WTF, Lowmem, Native_crash, crash

at this point, the information is collected via the Activitymanagerservice.adderrortodropbox () interface and added to Dropbox, which intercepts more logs in Adderrortodropbox ():
12883 public    void Adderrortodropbox (String eventtype,
12884 Processrecord Process, String processName, Activityrecord activity,12885 activityrecord Parent, string subject,12886 Final String report, final File logfile,12887 final applicationerrorreport.crashinfo CrashInfo) {12888 //NOTE--This must never acquire the Activitymanagerservice lock,12889 //Otherwise the watchdog could be p Revented from resetting the system.12890
Recommended: Can be addedLowmem
B, the native system registers an observer with the/data/tombstones directory TAG = system_tombstone
If the system throws atombstone does not cause the shutdown, the error will be added to Dropbox, which adds information via the Dropboxmanager.addtext () interface to Dropbox.

Stombstoneobserver = new Fileobserver (Tombstone_dir.getpath (), fileobserver.close_write) { @Override public void OnEvent (int event, String path) { try { file File = new file (tombstone_dir, path); if (File.isfile ()) { Addfiletodropbox (db, Prefs, headers, File.getpath (), Log_size, "System_tombstone"); } } catch (IOException e) { slog.e (TAG, "Can ' t log tombstone", E);}} ;
This logic isFrameworks/Base/Core/Java/com/Android/Server/the Bootreceiver.java file.
Recommended: You can add a point here that intercepts more logs.
C, Frameworks/base/core/java/com/android/server/bootreceiver.java the logic of fetching abnormal information after bootingMachineafter reboot (kernel and FlyMe):TAG =System_bootflyme Restart:TAG = System_restartbooting from recovery:TAG =System_recovery_logBoot Scan/data/tombstones Directory:TAG =System_tombstone
After booting the native logic has crawled some information, but not enough and thin.

Recommended: In the System_boot, do not catch any log, because the machine restarts, all the information is flushed out, in System_restart, you can try to crawl Android and kernel logs, this may fetch useful information, but because the boot has been for some time, The Exception log may have been flushed out, and when System_recovery_log, this is done as it was originally born; [Email protected]

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

System Abnormal burying Point

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.