1 /*
2  * Copyright (C) 2008 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 /*
18  * Android's method call profiling goodies.
19  */
20 #ifndef ART_TOOLS_DMTRACEDUMP_PROFILE_H_
21 #define ART_TOOLS_DMTRACEDUMP_PROFILE_H_
22 
23 /*
24  * Enumeration for the two "action" bits.
25  */
26 enum {
27   METHOD_TRACE_ENTER = 0x00,   // method entry
28   METHOD_TRACE_EXIT = 0x01,    // method exit
29   METHOD_TRACE_UNROLL = 0x02,  // method exited by exception unrolling
30   // 0x03 currently unused
31 };
32 
33 #define TOKEN_CHAR '*'
34 
35 /*
36  * Common definitions, shared with the dump tool.
37  */
38 #define METHOD_ACTION_MASK 0x03 /* two bits */
39 #define METHOD_ID(_method) ((_method) & (~METHOD_ACTION_MASK))
40 #define METHOD_ACTION(_method) (((unsigned int)(_method)) & METHOD_ACTION_MASK)
41 #define METHOD_COMBINE(_method, _action) ((_method) | (_action))
42 
43 #endif  // ART_TOOLS_DMTRACEDUMP_PROFILE_H_
44