harmony 鸿蒙trace.h

  • 2023-10-30
  • 浏览 (216)

trace.h

Overview

Defines APIs of the HiTraceMeter module for performance trace.

Example

Synchronous time slice trace event:

OH_HiTrace_StartTrace("hitraceTest");
OH_HiTrace_FinishTrace();

Output:

<...>-1668 (----—) [003] .... 135.059377: tracing_mark_write: B|1668|H:hitraceTest
<...>-1668 (----—) [003] .... 135.059415: tracing_mark_write: E|1668|

Asynchronous time slice trace event:

OH_HiTrace_StartAsyncTrace("hitraceTest", 123);
OH_HiTrace_FinishAsyncTrace("hitraceTest", 123);

Output:

<...>-2477 (----—) [001] .... 396.427165: tracing_mark_write: S|2477|H:hitraceTest 123
<...>-2477 (----—) [001] .... 396.427196: tracing_mark_write: F|2477|H:hitraceTest 123

Integer value trace event:

OH_HiTrace_CountTrace("hitraceTest", 500);

Output:

<...>-2638 (----—) [002] .... 458.904382: tracing_mark_write: C|2638|H:hitraceTest 500

Since

10

Related Modules

Hitrace

Summary

Functions

Name Description
OH_HiTrace_StartTrace (const char *name) Marks the start of a synchronous trace.
OH_HiTrace_FinishTrace (void) Marks the end of a synchronous trace.
OH_HiTrace_StartAsyncTrace (const char *name, int32_t taskId) Marks the start of an asynchronous trace.
OH_HiTrace_FinishAsyncTrace (const char *name, int32_t taskId) Marks the end of an asynchronous trace.
OH_HiTrace_CountTrace (const char *name, int64_t count) Traces the value change of an integer variable based on its name.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Native APIs

harmony 鸿蒙AVCapability

harmony 鸿蒙AVDemuxer

harmony 鸿蒙AVMuxer

harmony 鸿蒙AVScreenCapture

harmony 鸿蒙AVSource

harmony 鸿蒙AudioDecoder

harmony 鸿蒙AudioEncoder

harmony 鸿蒙CodecBase

harmony 鸿蒙Core

0  赞