【framework】EventLog分析

在frameworks/base的源码中看到几个很奇怪的EventLogTags.logtags文件,丫竟然还能作为src参与编译,百思不得其解之下只好埋头看源码,记录如下。

system/core/logcat/event.logtags文件是说明每个tag的格式的以及部分测试用的log tag,说明如下:
1 # The entries in this file map a sparse set of log tag numbers to tag names.
  2 # This is installed on the device, in /system/etc, and parsed by logcat.
  3 #
  4 # Tag numbers are decimal integers, from 0 to 2^31.  (Let's leave the
  5 # negative values alone for now.)
  6 # Tag numbers是十进制的整数,取值从0到2^31
  7 # Tag names are one or more ASCII letters and numbers or underscores, i.e.
  8 # "[A-Z][a-z][0-9]_".  Do not include spaces or punctuation (the former
  9 # impacts log readability, the latter makes regex searches more annoying).
10 # Tag names由1到多个ASCII码的字母和下划线组成,为了方便在log中搜索,name中避免使用空格和标点
11 # Tag numbers and names are separated by whitespace.  Blank lines and lines
12 # starting with '#' are ignored.
13 # Tag numbers和names之间用空格隔开,空白和#开头的行会被忽略
14 # Optionally, after the tag names can be put a description for the value(s)
15 # of the tag. Description are in the format
16 #    (<name>|data type[|data unit]) 
    #  根据需要,tag names后面可以加上这个tag的values来描述这个tag的打印格式。
17 # Multiple values are separated by commas.
18 # values之间用逗号隔开,每个value的格式如下
19 # The data type is a number from the following values:
20 # 1: int
21 # 2: long
22 # 3: string
23 # 4: list
24 # "data unit"表示数据格式,相当于data的单位:
25 # The data unit is a number taken from the following list:
26 # 1: Number of objects
27 # 2: Number of bytes
28 # 3: Number of milliseconds
29 # 4: Number of allocations
30 # 5: Id
31 # 6: Percent
32 # Default value for data of type int/long is 2 (bytes).
33 #
34 # TODO: generate ".java" and ".h" files with integer constants from this file.
         ... ...
137 # NOTE - the range 1000000-2000000 is reserved for partners and others who
138 # want to define their own log tags without conflic
  • 2
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值