1 /* 2 * Copyright (c) 2021 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef GRAPHIC_RS_TRACE_H 17 #define GRAPHIC_RS_TRACE_H 18 19 #ifndef ROSEN_TRACE_DISABLE 20 #include "hitrace_meter.h" 21 #define ROSEN_TRACE_BEGIN(tag, name) StartTrace(tag, name) 22 #define RS_TRACE_BEGIN(name) ROSEN_TRACE_BEGIN(HITRACE_TAG_GRAPHIC_AGP, name) 23 #define ROSEN_TRACE_END(tag) FinishTrace(tag) 24 #define RS_TRACE_END() ROSEN_TRACE_END(HITRACE_TAG_GRAPHIC_AGP) 25 #define RS_TRACE_NAME(name) HITRACE_METER_NAME(HITRACE_TAG_GRAPHIC_AGP, name) 26 #define RS_TRACE_NAME_FMT(fmt, ...) HITRACE_METER_FMT(HITRACE_TAG_GRAPHIC_AGP, fmt, ##__VA_ARGS__) 27 #define RS_ASYNC_TRACE_BEGIN(name, value) StartAsyncTrace(HITRACE_TAG_GRAPHIC_AGP, name, value) 28 #define RS_ASYNC_TRACE_END(name, value) FinishAsyncTrace(HITRACE_TAG_GRAPHIC_AGP, name, value) 29 #define RS_TRACE_INT(name, value) CountTrace(HITRACE_TAG_GRAPHIC_AGP, name, value) 30 #define RS_TRACE_FUNC() RS_TRACE_NAME(__func__) 31 32 #elif defined ROSEN_ANDROID 33 #include "rs_trace_crossplatform.h" 34 #else 35 36 #define ROSEN_TRACE_BEGIN(tag, name) 37 #define RS_TRACE_BEGIN(name) 38 #define ROSEN_TRACE_END(tag) 39 #define RS_TRACE_END() 40 #define RS_TRACE_NAME_FMT(fmt, ...) 41 #define RS_ASYNC_TRACE_BEGIN(name, value) 42 #define RS_ASYNC_TRACE_END(name, value) 43 #define RS_TRACE_INT(name, value) 44 #define RS_TRACE_NAME(name) 45 #define RS_TRACE_FUNC() 46 #endif //ROSEN_TRACE_DISABLE 47 48 #endif // GRAPHIC_RS_TRACE_H 49