Android系统中有哪些日志信息和工具

Android系统日志和工具

我们经常需要查看设备里面的各种日志信息。所以有必要了解android系统里面有哪些日志,以及用什么方式可以提取这些日志。以我手头的红米note4xplus为例,其基本配置为高通msm8953,android7.0。我们可以看一下根文件系统:

mido:/ # ls
acct              init.carrier.rc                      init.qcom.sh               root
bin               init.class_main.sh                   init.qcom.syspart_fixup.sh sbin
bt_firmware       init.environ.rc                      init.qcom.usb.rc           sdcard
cache             init.mdm.sh                          init.qcom.usb.sh           seapp_contexts
charger           init.miui.cust.rc                    init.rc                    selinux_version
config            init.miui.early_boot.sh              init.recovery.hardware.rc  sepolicy
cust              init.miui.google_revenue_share.rc    init.target.rc             service_contexts
d                 init.miui.google_revenue_share_v2.rc init.usb.configfs.rc       storage
data              init.miui.nativedebug.rc             init.usb.rc                sys
default.prop      init.miui.post_boot.sh               init.zygote32.rc           system
dev               init.miui.rc                         init.zygote64_32.rc        tombstones
dsp               init.msm.usb.configfs.rc             mnt                        ueventd.qcom.rc
etc               init.qcom.class_core.sh              oem                        ueventd.rc
file_contexts.bin init.qcom.early_boot.sh              persist                    unlock_key
firmware          init.qcom.factory.rc                 proc                       vendor
fstab.qcom        init.qcom.rc                         property_contexts          verity_key
init              init.qcom.sensors.sh                 res

以这个设备的文件系统为基础,我们来看一下一般的android设备中都有那些系统日志。

本文档只做日志相关的概要说明,不具体说明每个工具的使用方法。

android设备默认的命令一般都在/system/bin, /system/xbin和/sbin目录下。我们选择几个常用的命令来做个说明。

atrace

实际上就是systrace的代理。用来抓取用户空间服务日志信息。

一般用法:

adb shell atrace sched freq idle gfx view sync -b 96000 -f atrace.log

命令帮助:

adb shell atrace --help
usage: atrace [options] [categories...]
options include:
  -a appname      enable app-level tracing for a comma separated list of cmdlines
  -b N            use a trace buffer size of N KB
  -c              trace into a circular buffer
  -f filename     use the categories written in a file as space-separated
                    values in a line
  -k fname,...    trace the listed kernel functions
  -n              ignore signals
  -s N            sleep for N seconds before tracing [default 0]
  -t N            trace for N seconds [defualt 5]
  -z              compress the trace dump
  --async_start   start circular trace and return immediatly
  --async_dump    dump the current contents of circular trace buffer
  --async_stop    stop tracing and dump the current contents of circular
                    trace buffer
  --stream        stream trace to stdout as it enters the trace buffer
                    Note: this can take significant CPU time, and is best
                    used for measuring things that are not affected by
                    CPU performance, like pagecache usage.

  --list_categories
                  list the available tracing categories
 -o filename      write the trace to the specified file instead
                    of stdout.

所有的业务类型列表:

adb shell atrace --list_categories
         gfx - Graphics
       input - Input
        view - View System
     webview - WebView
          wm - Window Manager
          am - Activity Manager
          sm - Sync Manager
       audio - Audio
       video - Video
      camera - Camera
         hal - Hardware Modules
         app - Application
         res - Resource Loading
      dalvik - Dalvik VM
          rs - RenderScript
      bionic - Bionic C Library
       power - Power Management
          pm - Package Manager
          ss - System Server
    database - Database
       sched - CPU Scheduling
         irq - IRQ Events
        freq - CPU Frequency
        idle - CPU Idle
        disk - Disk I/O
         mmc - eMMC commands
        load - CPU Load
        sync - Synchronization
       workq - Kernel Workqueues
  memreclaim - Kernel Memory Reclaim
  regulators - Voltage and Current Regulators
  binder_driver - Binder Kernel driver
  binder_lock - Binder global lock trace
   pagecache - Page cache

bootstat

查看设备启动状态信息。

`
adb shell bootstat -p
Boot events:

Original: https://www.cnblogs.com/aosp/p/16411738.html
Author: 河东西望
Title: Android系统中有哪些日志信息和工具

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/582222/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

  • Git 命令

    创建仓库 git init 命令创建一个新的 Git 仓库。它用来将已存在但还没有版本控制的项目转换成一个 Git 仓库,或者创建一个空的新仓库。大多数Git命令在未初始化的仓库中…

    Linux 2023年6月8日
    0106
  • sublime text里面中文字体显示异常解决方案

    sublime text下载之后一开始转成中文之后,会出现中文显示异常的问题,比如下图中”门”字显示异常 通过如下的设置可以解决该问题: 首选项&#8211…

    Linux 2023年6月13日
    0201
  • [Git系列] 前言

    Git 简介 Git 是一个重视速度的分布式版本控制和代码管理系统,最初是由 Linus Torvalds 为开发 Linux 内核而设计并开发的,是一款遵循二代 GUN 协议的免…

    Linux 2023年6月14日
    0112
  • [云原生]Kubernetes-资源管理(第3章)

    一、资源管理介绍 二、YAML语言介绍 三、资源管理方式 3.1 命令式对象管理 3.2 命令式对象配置 3.3 声明式对象配置 参考: Kubernetes(K8S) 入门进阶实…

    Linux 2023年6月13日
    0123
  • 记录XorDDos木马清理步骤

    1.检查 查看定时任务文件发现有两个异常定时任务 [root@manage ~]# cat /etc/crontab user-name command to be execute…

    Linux 2023年6月7日
    0102
  • tomcat服务器和servlet的基本认识

    今天下午在知乎看见了一个老哥的文章,写的是servlet写的很好,以前我对Javaweb方面的理解比较混乱今天看了这位老哥的文章后受益匪浅,知乎名叫:bravo1988​ 里面也有…

    Linux 2023年6月6日
    0112
  • Linux用户和用户组

    Linux用户和用户组 1.添加新的用户 (用户ID从500开始,0-99系统管理级别、100-499系统预留) useradd 选项 用户名 参数说明 选项: -c commen…

    Linux 2023年6月11日
    0100
  • VScode乱码问题(2022/4/2)

    “terminal.integrated.profiles.windows”: {“Command Prompt”: {&#8220…

    Linux 2023年6月13日
    0113
  • CentOS 7安装jdk-mysql-nginx

    安装jdk 设置开机自启 重启systemctl Original: https://www.cnblogs.com/nianxue/p/16618805.htmlAuthor: …

    Linux 2023年6月6日
    080
  • Windows下 RabbitMQ的安装和配置

    简介 RabbitMQ是实现了高级消息队列协议(AMQP)的开源消息代理软件(亦称面向消息的中间件)。RabbitMQ服务器是用Erlang语言编写的,而集群和故障转移是构建在开放…

    Linux 2023年6月14日
    099
  • TCP/UDP 编程模型

    TCP编程模型 server创建socket套接字 socket套接字–可以理解为文件描述符(file descriptor),UNIX把网络看成文件 /** * @p…

    Linux 2023年6月6日
    0109
  • Django中自定义管理器Manager用法

    Django中Manager用法 第一种 class create_user(models.Manager): def create(self, name, sex, age): …

    Linux 2023年6月14日
    095
  • 输入输出函数

    IDLE name=input(‘输入’) print(name) print函数 print(1,2) print(1,2,sep=",") input函数 …

    Linux 2023年6月8日
    091
  • RPA SAP财务内部对账机器人

    bash;gutter:true;【简介】本机器人用于使用SAP软件的集团公司间往来对账前台登录SAP账户和密码,需退出PC微信,输入法切换为英文半角状态。【详细流程】1、清空Ex…

    Linux 2023年6月7日
    0126
  • 搭建部署Docker

    Docker安装准备: 首先看下服务器是否有旧版本,如果有需要卸载并且安装依赖 然后下载docker仓库repo源: 安装完成后查看docker仓库版本信息: yum安装docke…

    Linux 2023年6月8日
    0111
  • windows环境安装VNC及远程连接linux(centos7)

    基础环境: 客户端:windows 10 服务器:centos7 软件:windows客户端安装 VNC-Viewer-6.21.1109-Windows.exe 下载地址:htt…

    Linux 2023年5月27日
    095
亲爱的 Coder【最近整理,可免费获取】👉 最新必读书单  | 👏 面试题下载  | 🌎 免费的AI知识星球