Debug.StartMethodTracing 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
| 名称 | 说明 |
|---|---|
| StartMethodTracing() |
使用默认日志名称和缓冲区大小启动方法跟踪。 |
| StartMethodTracing(String) |
Start 方法跟踪,指定跟踪日志文件路径。 |
| StartMethodTracing(String, Int32) |
Start 方法跟踪,指定跟踪日志文件名称和缓冲区大小。 |
| StartMethodTracing(String, Int32, DebugTraceOptions) |
Start 方法跟踪,指定跟踪日志文件名称、缓冲区大小和标志。 |
StartMethodTracing()
使用默认日志名称和缓冲区大小启动方法跟踪。
[Android.Runtime.Register("startMethodTracing", "()V", "")]
public static void StartMethodTracing();
[<Android.Runtime.Register("startMethodTracing", "()V", "")>]
static member StartMethodTracing : unit -> unit
- 属性
注解
使用默认日志名称和缓冲区大小启动方法跟踪。
默认情况下,跟踪文件称为“dmtrace.trace”,它放置在主共享/外部存储上特定于包的目录下,由 Context#getExternalFilesDir(String)该目录返回。
有关读取跟踪文件的信息,请参阅 使用 Traceview 检查跟踪日志 。
启用方法跟踪时,VM 的运行速度将比平常慢,因此,跟踪文件中的计时应仅以相对术语(例如运行速度 #1 比运行 #2 更快)考虑。 本机方法的时间不会更改,因此不要尝试使用它来比较同一方法的已解释实现和本机实现的性能。 作为替代方法,请考虑通过#startMethodTracingSampling(String, int, int)仿真器中使用基于采样的方法跟踪#startNativeTracing()或“本机”跟踪。
Java文档android.os.Debug.startMethodTracing()。
本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。
适用于
StartMethodTracing(String)
Start 方法跟踪,指定跟踪日志文件路径。
[Android.Runtime.Register("startMethodTracing", "(Ljava/lang/String;)V", "")]
public static void StartMethodTracing(string? tracePath);
[<Android.Runtime.Register("startMethodTracing", "(Ljava/lang/String;)V", "")>]
static member StartMethodTracing : string -> unit
参数
- tracePath
- String
要创建的跟踪日志文件的路径。 如果 null,则默认为“dmtrace.trace”。 如果文件已存在,将截断该文件。 如果给定的路径未以“.trace”结尾,则会为你追加该路径。
- 属性
注解
Start 方法跟踪,指定跟踪日志文件路径。
给定相对文件路径时,跟踪文件将放置在主共享/外部存储上特定于包的目录下,由该 Context#getExternalFilesDir(String)目录返回。
有关读取跟踪文件的信息,请参阅 使用 Traceview 检查跟踪日志 。
启用方法跟踪时,VM 的运行速度将比平常慢,因此,跟踪文件中的计时应仅以相对术语(例如运行速度 #1 比运行 #2 更快)考虑。 本机方法的时间不会更改,因此不要尝试使用它来比较同一方法的已解释实现和本机实现的性能。 作为替代方法,请考虑通过#startMethodTracingSampling(String, int, int)仿真器中使用基于采样的方法跟踪#startNativeTracing()或“本机”跟踪。
Java文档android.os.Debug.startMethodTracing(java.lang.String)。
本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。
适用于
StartMethodTracing(String, Int32)
Start 方法跟踪,指定跟踪日志文件名称和缓冲区大小。
[Android.Runtime.Register("startMethodTracing", "(Ljava/lang/String;I)V", "")]
public static void StartMethodTracing(string? tracePath, int bufferSize);
[<Android.Runtime.Register("startMethodTracing", "(Ljava/lang/String;I)V", "")>]
static member StartMethodTracing : string * int -> unit
参数
- tracePath
- String
要创建的跟踪日志文件的路径。 如果 null,则默认为“dmtrace.trace”。 如果文件已存在,将截断该文件。 如果给定的路径未以“.trace”结尾,则会为你追加该路径。
- bufferSize
- Int32
我们收集的最大跟踪数据量。 如果未指定,则默认为 8MB。
- 属性
注解
Start 方法跟踪,指定跟踪日志文件名称和缓冲区大小。
给定相对文件路径时,跟踪文件将放置在主共享/外部存储上特定于包的目录下,由该 Context#getExternalFilesDir(String)目录返回。
有关读取跟踪文件的信息,请参阅 使用 Traceview 检查跟踪日志 。
启用方法跟踪时,VM 的运行速度将比平常慢,因此,跟踪文件中的计时应仅以相对术语(例如运行速度 #1 比运行 #2 更快)考虑。 本机方法的时间不会更改,因此不要尝试使用它来比较同一方法的已解释实现和本机实现的性能。 作为替代方法,请考虑通过#startMethodTracingSampling(String, int, int)仿真器中使用基于采样的方法跟踪#startNativeTracing()或“本机”跟踪。
Java文档android.os.Debug.startMethodTracing(java.lang.String, int)。
本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。
适用于
StartMethodTracing(String, Int32, DebugTraceOptions)
Start 方法跟踪,指定跟踪日志文件名称、缓冲区大小和标志。
[Android.Runtime.Register("startMethodTracing", "(Ljava/lang/String;II)V", "")]
public static void StartMethodTracing(string? tracePath, int bufferSize, Android.OS.DebugTraceOptions flags);
[<Android.Runtime.Register("startMethodTracing", "(Ljava/lang/String;II)V", "")>]
static member StartMethodTracing : string * int * Android.OS.DebugTraceOptions -> unit
参数
- tracePath
- String
要创建的跟踪日志文件的路径。 如果 null,则默认为“dmtrace.trace”。 如果文件已存在,将截断该文件。 如果给定的路径未以“.trace”结尾,则会为你追加该路径。
- bufferSize
- Int32
我们收集的最大跟踪数据量。 如果未指定,则默认为 8MB。
- flags
- DebugTraceOptions
用于控制方法跟踪的标志。 支持以下标志:0x0001 #TRACE_COUNT_ALLOCS
Flags to control time source: These are available with API #34 and higher.
0x0010 Report the elapsed time since the start of the trace.
0x0100 Report the time the thread has spent on the CPU since the start of the
trace. Please note that the thread cpu incurs a significant (typically
2-3x) performance penalty. Use this flag only when necessary.
If neither of these flags are set, both the elapsed time and the thread cpu time
are reported.
- 属性
注解
Start 方法跟踪,指定跟踪日志文件名称、缓冲区大小和标志。
给定相对文件路径时,跟踪文件将放置在主共享/外部存储上特定于包的目录下,由该 Context#getExternalFilesDir(String)目录返回。
有关读取跟踪文件的信息,请参阅 使用 Traceview 检查跟踪日志 。
启用方法跟踪时,VM 的运行速度将比平常慢,因此,跟踪文件中的计时应仅以相对术语(例如运行速度 #1 比运行 #2 更快)考虑。 本机方法的时间不会更改,因此不要尝试使用它来比较同一方法的已解释实现和本机实现的性能。 作为替代方法,请考虑通过#startMethodTracingSampling(String, int, int)仿真器中使用基于采样的方法跟踪#startNativeTracing()或“本机”跟踪。
Java文档android.os.Debug.startMethodTracing(java.lang.String, int, int)。
本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。