Skip to content

Most visited

Recently visited

navigation

trace.h File Reference

trace.h File Reference

Writes trace events to the system trace buffer. More...

Functions

bool ATrace_isEnabled ()
 
void ATrace_beginSection (const char *sectionName)
 
void ATrace_endSection ()
 

Detailed Description

Writes trace events to the system trace buffer.

These trace events can be collected and visualized using the Systrace tool. For information about using the Systrace tool, read Analyzing UI Performance with Systrace.

Function Documentation

§ ATrace_beginSection()

void ATrace_beginSection ( const char *  sectionName)

Writes a tracing message to indicate that the given section of code has begun. This call must be followed by a corresponding call to endSection() on the same thread.

Note: At this time the vertical bar character '|' and newline character '
' are used internally by the tracing mechanism. If sectionName contains these characters they will be replaced with a space character in the trace.

§ ATrace_endSection()

void ATrace_endSection ( )

Writes a tracing message to indicate that a given section of code has ended. This call must be preceeded by a corresponding call to beginSection(char*) on the same thread. Calling this method will mark the end of the most recently begun section of code, so care must be taken to ensure that beginSection / endSection pairs are properly nested and called from the same thread.

§ ATrace_isEnabled()

bool ATrace_isEnabled ( )

Returns true if tracing is enabled. Use this signal to avoid expensive computation only necessary when tracing is enabled.

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience. (Dec 2017 Android Platform & Tools Survey)