Ion
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
trace.h File Reference
#include <errno.h>
#include <fcntl.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <android/log.h>
Include dependency graph for trace.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  ion::port::android::Tracer
 
class  ion::port::android::ScopedTrace
 

Namespaces

 ion
 Copyright 2016 Google Inc.
 
 ion::port
 
 ion::port::android
 

Macros

#define ION_ATRACE_TAG_NEVER   0
 Copyright 2016 Google Inc. More...
 
#define ION_ATRACE_TAG_ALWAYS   (1<<0)
 enabled. More...
 
#define ION_ATRACE_TAG_GRAPHICS   (1<<1)
 enabled. More...
 
#define ION_ATRACE_TAG_INPUT   (1<<2)
 
#define ION_ATRACE_TAG_VIEW   (1<<3)
 
#define ION_ATRACE_TAG_WEBVIEW   (1<<4)
 
#define ION_ATRACE_TAG_WINDOW_MANAGER   (1<<5)
 
#define ION_ATRACE_TAG_ACTIVITY_MANAGER   (1<<6)
 
#define ION_ATRACE_TAG_SYNC_MANAGER   (1<<7)
 
#define ION_ATRACE_TAG_AUDIO   (1<<8)
 
#define ION_ATRACE_TAG_VIDEO   (1<<9)
 
#define ION_ATRACE_TAG_CAMERA   (1<<10)
 
#define ION_ATRACE_TAG_HAL   (1<<11)
 
#define ION_ATRACE_TAG_APP   (1<<12)
 
#define ION_ATRACE_TAG_RESOURCES   (1<<13)
 
#define ION_ATRACE_TAG_DALVIK   (1<<14)
 
#define ION_ATRACE_TAG_RS   (1<<15)
 
#define ION_ATRACE_TAG_BIONIC   (1<<16)
 
#define ION_ATRACE_TAG_POWER   (1<<17)
 
#define ION_ATRACE_TAG_PACKAGE_MANAGER   (1<<18)
 
#define ION_ATRACE_TAG_SYSTEM_SERVER   (1<<19)
 
#define ION_ATRACE_TAG_LAST   ION_ATRACE_TAG_SYSTEM_SERVER
 
#define ION_ATRACE_TAG_NOT_READY   (1LL << 63)
 
#define ION_ATRACE_TAG_VALID_MASK   ((ION_ATRACE_TAG_LAST - 1) | ION_ATRACE_TAG_LAST)
 init More...
 
#define ION_ATRACE_TAG   ION_ATRACE_TAG_NEVER
 
#define ION_ATRACE_CALL()   ion::port::android::ScopedTrace ___tracer(ION_ATRACE_TAG, __FUNCTION__)
 ION_ATRACE_CALL traces the beginning and end of the current function. More...
 
#define ION_ATRACE_NAME(name)   ion::port::android::ScopedTrace ___tracer(ION_ATRACE_TAG, name)
 ION_ATRACE_NAME traces the beginning and end of the current function. More...
 
#define ION_ATRACE_INT(name, value)   ion::port::android::Tracer::traceCounter(ION_ATRACE_TAG, name, value)
 ION_ATRACE_INT traces a named integer value. More...
 
#define ION_ATRACE_ENABLED()   ion::port::android::Tracer::isTagEnabled(ION_ATRACE_TAG)
 ION_ATRACE_ENABLED returns true if the trace tag is enabled. More...
 

Macro Definition Documentation

#define ION_ATRACE_CALL ( )    ion::port::android::ScopedTrace ___tracer(ION_ATRACE_TAG, __FUNCTION__)

ION_ATRACE_CALL traces the beginning and end of the current function.

To trace the correct start and end times this macro should be the first line of the function body.

Definition at line 89 of file trace.h.

#define ION_ATRACE_ENABLED ( )    ion::port::android::Tracer::isTagEnabled(ION_ATRACE_TAG)

ION_ATRACE_ENABLED returns true if the trace tag is enabled.

It can be used as a guard condition around more expensive trace calculations.

Definition at line 105 of file trace.h.

#define ION_ATRACE_INT (   name,
  value 
)    ion::port::android::Tracer::traceCounter(ION_ATRACE_TAG, name, value)

ION_ATRACE_INT traces a named integer value.

This can be used to track how the value changes over time in a trace.

Definition at line 100 of file trace.h.

#define ION_ATRACE_NAME (   name)    ion::port::android::ScopedTrace ___tracer(ION_ATRACE_TAG, name)

ION_ATRACE_NAME traces the beginning and end of the current function.

To trace the correct start and end times this macro should be the first line of the function body.

Definition at line 95 of file trace.h.

#define ION_ATRACE_TAG   ION_ATRACE_TAG_NEVER

Definition at line 80 of file trace.h.

#define ION_ATRACE_TAG_ACTIVITY_MANAGER   (1<<6)

Definition at line 57 of file trace.h.

#define ION_ATRACE_TAG_ALWAYS   (1<<0)

enabled.

Definition at line 50 of file trace.h.

#define ION_ATRACE_TAG_APP   (1<<12)

Definition at line 63 of file trace.h.

#define ION_ATRACE_TAG_AUDIO   (1<<8)

Definition at line 59 of file trace.h.

#define ION_ATRACE_TAG_BIONIC   (1<<16)

Definition at line 67 of file trace.h.

#define ION_ATRACE_TAG_CAMERA   (1<<10)

Definition at line 61 of file trace.h.

#define ION_ATRACE_TAG_DALVIK   (1<<14)

Definition at line 65 of file trace.h.

#define ION_ATRACE_TAG_GRAPHICS   (1<<1)

enabled.

Definition at line 52 of file trace.h.

#define ION_ATRACE_TAG_HAL   (1<<11)

Definition at line 62 of file trace.h.

#define ION_ATRACE_TAG_INPUT   (1<<2)

Definition at line 53 of file trace.h.

#define ION_ATRACE_TAG_LAST   ION_ATRACE_TAG_SYSTEM_SERVER

Definition at line 71 of file trace.h.

#define ION_ATRACE_TAG_NEVER   0

Copyright 2016 Google Inc.

All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.This file originates from /platform/frameworks/native/include/utils/Trace.h

The ION_ATRACE_TAG macro can be defined before including this header to trace using one of the tags defined below. It must be defined to one of the following ION_ATRACE_TAG_* macros. The trace tag is used to filter tracing in userland to avoid some of the runtime cost of tracing when it is not desired.

Defining ION_ATRACE_TAG to be ION_ATRACE_TAG_ALWAYS will result in the tracing always being enabled - this should ONLY be done for debug code, as userland tracing has a performance cost even when the trace is not being recorded. Defining ION_ATRACE_TAG to be ION_ATRACE_TAG_NEVER or leaving ION_ATRACE_TAG undefined will result in the tracing always being disabled.

These tags must be kept in sync with frameworks/base/core/java/android/os/Trace.java.

Definition at line 48 of file trace.h.

#define ION_ATRACE_TAG_NOT_READY   (1LL << 63)

Definition at line 73 of file trace.h.

#define ION_ATRACE_TAG_PACKAGE_MANAGER   (1<<18)

Definition at line 69 of file trace.h.

#define ION_ATRACE_TAG_POWER   (1<<17)

Definition at line 68 of file trace.h.

#define ION_ATRACE_TAG_RESOURCES   (1<<13)

Definition at line 64 of file trace.h.

#define ION_ATRACE_TAG_RS   (1<<15)

Definition at line 66 of file trace.h.

#define ION_ATRACE_TAG_SYNC_MANAGER   (1<<7)

Definition at line 58 of file trace.h.

#define ION_ATRACE_TAG_SYSTEM_SERVER   (1<<19)

Definition at line 70 of file trace.h.

#define ION_ATRACE_TAG_VALID_MASK   ((ION_ATRACE_TAG_LAST - 1) | ION_ATRACE_TAG_LAST)

init

Definition at line 76 of file trace.h.

#define ION_ATRACE_TAG_VIDEO   (1<<9)

Definition at line 60 of file trace.h.

#define ION_ATRACE_TAG_VIEW   (1<<3)

Definition at line 54 of file trace.h.

#define ION_ATRACE_TAG_WEBVIEW   (1<<4)

Definition at line 55 of file trace.h.

#define ION_ATRACE_TAG_WINDOW_MANAGER   (1<<5)

Definition at line 56 of file trace.h.