In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
The start-up time of the Android system mentioned here is not simply counted by stopwatch and naked eye, but by analyzing the log information output of the system, which makes it more professional and accurate.
First of all, understand two concepts:
(1) Android is a system based on Linux kernel, so the startup process of Android is divided into two stages, the first stage is the startup of Linux kernel, and the second stage is the startup of Android framework (including core services and programs).
(2) the log system of Android is independent of the log system of Linux kernel. The log information printed by the Linux kernel through printk, the log is written into the / dev/kmsg file, and the log information can be viewed through the dmesg command in the Shell terminal. The Android framework prints log information through the Logger driver. These log are not merged into the kmesg file, but are stored separately, located in the / dev/log directory, and can be viewed by the logcat command in the Shell terminal.
Let's find out how to count the startup time of the system from the two kinds of log information.
1. Count the startup time of the system through dmesg information
First, we grab the log information of the Linux kernel through the dmesg command (some systems may need to execute adb root first):
$adb shell dmesg > dmesg.txt
When the Linux kernel starts up, it generally has the following standard output information:
[3.838682] Freeing initrd memory: 1844K (ffffffc003600000-ffffffc0037cd000)
Therefore, as long as we find the line "Freeing initrd memory" in the dmesg.txt file, you can see from the log above that the Linux kernel only took 3.838682s to boot.
So, how do you find the sign that the Android system starts up?
Many Android devices print the following information in the kernel log after the system boots:
[29.913726] init: processing action 0x96bb8 (property:sys.boot_completed=1)
Therefore, finding the "boot_completed" line will get the startup time of the entire system, from which you can see that the entire system startup took 29.913726s.
Of course, not all Android devices print out this log, so we generally use the method described below to specifically count the startup time of the Android system.
two。 Count the start-up time of the system through logcat
As we have already introduced at the beginning of the article, Android's log system is independent of the Linux kernel log system. Enter the Android system by typing adb shell on the terminal, cd to the / dev/log directory, and you will find that there are four files in it, namely: events,main,radio,system.
The Android system divides Log into four categories, and different categories record different Log information:
Main-the main Log information, most of the application-level Log information is here
Events-Log information related to system events
Radio-Wireless / phone related Log information
System-low-level system debugging Log information
By default, main information is fetched through logcat. If you want to grab the specified category of log information, add the-b parameter after the logcat command, for example:
Adb logcat-d-v time-b "main" > main.txt adb logcat-d-v time-b "events" > events.txt adb logcat-d-v time-b "system" > system.txt adb logcat-d-v time-b "radio" > radio.txt
So, how to count the startup time of the Android system?
We can focus on the log information of the events category by using the following command:
$adb logcat-d-b events | grep "boot"
As shown in the figure, this is the log information I grabbed on Qualcomm's msm8953 development board:
"boot_progress_start" means that the Android screen lights up and starts to show the startup animation, that is, 15.492s starts flashing the word Android.
"boot_progress_enable_screen" represents the end of the startup of the whole system, that is, 29.986s. Subtract the startup time of the Linux Kernel from this total time to get the Android OS part of the time.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.