Android-cuttlefish cvd tool
adb_trace.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2014 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#ifndef __ADB_TRACE_H
18#define __ADB_TRACE_H
19
20#include <string>
21
24
25/* IMPORTANT: if you change the following list, don't
26 * forget to update the corresponding 'tags' table in
27 * the setup_trace_mask() function implemented in adb_trace.cpp.
28 */
30 ADB = 0, /* 0x001 */
34 RWX, /* 0x010 */
38 JDWP, /* 0x100 */
47};
48
49#define VLOG_IS_ON(TAG) \
50 ((adb_trace_mask & (1 << (TAG))) != 0)
51
52#define VLOG(TAG) \
53 if (LIKELY(!VLOG_IS_ON(TAG))) \
54 ; \
55 else \
56 LOG(DEBUG)
57
58// You must define TRACE_TAG before using this macro.
59#define D(...) \
60 VLOG(TRACE_TAG) << android::base::StringPrintf(__VA_ARGS__)
61
62
63extern int adb_trace_mask;
64void adb_trace_init(char**);
65void adb_trace_enable(AdbTrace trace_tag);
66std::string get_trace_setting();
67
68#endif /* __ADB_TRACE_H */
AdbTrace
Definition: adb_trace.h:29
@ ADB
Definition: adb_trace.h:30
@ MDNS_STACK
Definition: adb_trace.h:45
@ PACKETS
Definition: adb_trace.h:32
@ TRANSPORT
Definition: adb_trace.h:33
@ MDNS
Definition: adb_trace.h:44
@ SYNC
Definition: adb_trace.h:36
@ NUM_TRACES
Definition: adb_trace.h:46
@ SYSDEPS
Definition: adb_trace.h:37
@ USB
Definition: adb_trace.h:35
@ FDEVENT
Definition: adb_trace.h:41
@ AUTH
Definition: adb_trace.h:40
@ JDWP
Definition: adb_trace.h:38
@ SOCKETS
Definition: adb_trace.h:31
@ INCREMENTAL
Definition: adb_trace.h:43
@ SHELL
Definition: adb_trace.h:42
@ RWX
Definition: adb_trace.h:34
@ SERVICES
Definition: adb_trace.h:39
void adb_trace_enable(AdbTrace trace_tag)
Definition: adb_trace.cpp:202
void adb_trace_init(char **)
Definition: adb_trace.cpp:168
std::string get_trace_setting()
Definition: adb_trace.cpp:92
int adb_trace_mask
Definition: adb_trace.cpp:90