没有合适的资源?快使用搜索试试~ 我知道了~
首页Trace Event Format - Google Docs.pdf
Trace Event Format - Google Docs.pdf
需积分: 50 12 下载量 13 浏览量
更新于2023-03-16
评论
收藏 273KB PDF 举报
Trace-Viewer is the javascript frontend for Chrome about:tracing and Android systrace. https://github.com/catapult-project/catapult/tree/master/tracing
资源详情
资源评论
资源推荐
Trace Event Format
Last updated: October 2016
nduca@, dsinclair@
Introduction
JSON Format
JSON Array Format
JSON Object Format
Event Descriptions
Phases
Duration Events
Stack Traces on Duration Events
Complete Events
Instant Events
Counter Events
Async Events
Flow Events
Sample Events (deprecated)
Object Events
Snapshots
Snapshot category override
Snapshot base_type override
References
Metadata Events
Memory Dump Events
Mark Events
Clock Sync Event
Context Events
Linking IDs
More about IDs
StackFrames Dictionary
Global Samples
Linux Debug Format
Introduction
The Trace Event Format is the trace data representation that is processed by the Trace Viewer
1
application. Trace Viewer recognizes four input variations.
● Two are representations of the JSON format:
a. A string dump of a JSON array.
b. A JSON object.
● Two are representations of the Linux ftrace data:
1
https://github.com/catapult-project/catapult/tree/master/tracing
1
a. Text dump starting with # tracer: .
b. An Android systrace HTML dump.
This document describes the JSON input format and provides links for more information on the Linux
ftrace functionality.
JSON Format
The JSON events can be provided in two slightly different structures.
JSON Array Format
The simplest format accepted by the trace viewer is the JSON array format. Essentially, an array of event
objects. The events do not have to be in timestamp-sorted order.
[ { "name" : "Asub" , "cat" : "PERF" , "ph" : "B" , "pid" : 22630 , "tid" : 22630 , "ts" : 829 },
{ "name" : "Asub" , "cat" : "PERF" , "ph" : "E" , "pid" : 22630 , "tid" : 22630 , "ts" : 833 }
]
JSON Array Format
When provided as a string to the importer the ] at the end of the JSON Array Format is optional. The
Trace Viewer importer will automatically add a ] if needed to turn the string into valid JSON.. This is to
support tracing systems that can not cleanly finish writing the trace. For example, when tracing the exit of
a program.
JSON Object Format
The JSON Object Format allows for more flexibility in the data passed to Trace Viewer. There is one
required property, traceEvents , and some optional properties. The events do not have to be in
timestamp-sorted order.
{
"traceEvents" : [
{ "name" : "Asub" , "cat" : "PERF" , "ph" : "B" , "pid" : 22630 , "tid" : 22630 , "ts" :
829 },
{ "name" : "Asub" , "cat" : "PERF" , "ph" : "E" , "pid" : 22630 , "tid" : 22630 , "ts" :
833 }
],
"displayTimeUnit" : "ns" ,
"systemTraceEvents" : "SystemTraceData" ,
"otherData" : {
"version" : "My Application v1.0 "
},
"stackFrames": {...}
"samples": [...],
}
2
JSON Object Format
If provided displayTimeUnit is a string that specifies in which unit timestamps should be displayed. This
supports values of “ms” or “ns” . By default this is value is “ms” .
If provided systemTraceEvents is a string of Linux ftrace data or Windows ETW trace data. This data
must start with # tracer: and adhere to the Linux ftrace format or adhere to Windows ETW format.
If provided, powerTraceAsString is a string of BattOr power data.
If provided, the stackFrames field is a dictionary of stack frames, their ids, and their parents that allows
compact representation of stack traces throughout the rest of the trace file. It is optional but sometimes
very useful in shrinking file sizes.
The samples array is used to store sampling profiler data from a OS level profiler. It stores samples that
are different from trace event samples, and is meant to augment the traceEvent data with lower level
information. It is OK to have a trace event file with just sample data, but in that case traceEvents must
still be provided and set to []. For more information on sample data, refer to the global samples section .
If provided, controllerTraceDataKey is a string that specifies which trace data comes from tracing
controller. Its value should be the key for that specific trace data. For example, {...,
"controllerTraceDataKey": "traceEvents"} means the data for traceEvents comes from the tracing
controller. This is mainly for the purpose of clock synchronization.
Any other properties seen in the object, in this case otherData are assumed to be metadata for the trace.
They will be collected and stored in an array in the trace model. This metadata is accessible through the
Metadata button in Trace Viewer.
Event Descriptions
There are a common set of fields for each of the events.
{
"name" : "myName" ,
"cat" : "category,list" ,
"ph" : "B" ,
"ts" : 12345 ,
"pid" : 123 ,
"tid" : 456 ,
"args" : {
"someArg" : 1 ,
"anotherArg" : {
"value" : "my value"
}
}
3
}
General Event Structure
● name: The name of the event, as displayed in Trace Viewer
● cat : The event categories. This is a comma separated list of categories for the event. The
categories can be used to hide events in the Trace Viewer UI.
● ph: The event type. This is a single character which changes depending on the type of event
being output. The valid values are listed in the table below . We will discuss each phase type
below.
● ts: The tracing clock timestamp of the event. The timestamps are provided at microsecond
granularity.
● tts: Optional. The thread clock timestamp of the event. The timestamps are provided at
microsecond granularity.
● pid : The process ID for the process that output this event.
● tid : The thread ID for the thread that output this event.
● args: Any arguments provided for the event. Some of the event types have required argument
fields, otherwise, you can put any information you wish in here. The arguments are displayed in
Trace Viewer when you view an event in the analysis section.
Optional
● cname: A fixed color name to associate with the event. If provided, cname must be one of the
names listed in trace-viewer's base color scheme's reserved color names list
Phases
The following table lists all event types and their associated phases:
Event type
Event phases
Duration Events
B (begin), E (end)
Complete Events
X
Instant Events
i
Deprecated
I
Counter Events
C
Async Events
b (nestable start), n (nestable instant), e (nestable end)
Deprecated
S (start), T (step into), p (step past), F (end)
Flow Events
s (start), t (step), f (end)
Sample Events
P
4
剩余18页未读,继续阅读
wang.wenchao
- 粉丝: 36
- 资源: 30
上传资源 快速赚钱
- 我的内容管理 收起
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
会员权益专享
最新资源
- RTL8188FU-Linux-v5.7.4.2-36687.20200602.tar(20765).gz
- c++校园超市商品信息管理系统课程设计说明书(含源代码) (2).pdf
- 建筑供配电系统相关课件.pptx
- 企业管理规章制度及管理模式.doc
- vb打开摄像头.doc
- 云计算-可信计算中认证协议改进方案.pdf
- [详细完整版]单片机编程4.ppt
- c语言常用算法.pdf
- c++经典程序代码大全.pdf
- 单片机数字时钟资料.doc
- 11项目管理前沿1.0.pptx
- 基于ssm的“魅力”繁峙宣传网站的设计与实现论文.doc
- 智慧交通综合解决方案.pptx
- 建筑防潮设计-PowerPointPresentati.pptx
- SPC统计过程控制程序.pptx
- SPC统计方法基础知识.pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0