132a6e48fSopenharmony_ci/* 232a6e48fSopenharmony_ci * Copyright (c) 2024 Huawei Device Co., Ltd. 332a6e48fSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 432a6e48fSopenharmony_ci * you may not use this file except in compliance with the License. 532a6e48fSopenharmony_ci * You may obtain a copy of the License at 632a6e48fSopenharmony_ci * 732a6e48fSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 832a6e48fSopenharmony_ci * 932a6e48fSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 1032a6e48fSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 1132a6e48fSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1232a6e48fSopenharmony_ci * See the License for the specific language governing permissions and 1332a6e48fSopenharmony_ci * limitations under the License. 1432a6e48fSopenharmony_ci */ 1532a6e48fSopenharmony_ci 1632a6e48fSopenharmony_ci#ifndef GRAPHIC_SURFACE_TRACE_H 1732a6e48fSopenharmony_ci#define GRAPHIC_SURFACE_TRACE_H 1832a6e48fSopenharmony_ci 1932a6e48fSopenharmony_ci#include "hitrace_meter.h" 2032a6e48fSopenharmony_ci#define SURFACE_ROSEN_TRACE_BEGIN(tag, name) StartTrace(tag, name) 2132a6e48fSopenharmony_ci#define SURFACE_TRACE_BEGIN(name) \ 2232a6e48fSopenharmony_ci SURFACE_ROSEN_TRACE_BEGIN(HITRACE_TAG_GRAPHIC_AGP | HITRACE_TAG_COMMERCIAL, name) 2332a6e48fSopenharmony_ci#define ROSEN_TRACE_END(tag) FinishTrace(tag) 2432a6e48fSopenharmony_ci#define SURFACE_TRACE_END() \ 2532a6e48fSopenharmony_ci ROSEN_TRACE_END(HITRACE_TAG_GRAPHIC_AGP | HITRACE_TAG_COMMERCIAL) 2632a6e48fSopenharmony_ci#define SURFACE_TRACE_NAME(name) \ 2732a6e48fSopenharmony_ci HITRACE_METER_NAME(HITRACE_TAG_GRAPHIC_AGP | HITRACE_TAG_COMMERCIAL, name) 2832a6e48fSopenharmony_ci#define SURFACE_TRACE_NAME_FMT(fmt, ...) \ 2932a6e48fSopenharmony_ci HITRACE_METER_FMT(HITRACE_TAG_GRAPHIC_AGP | HITRACE_TAG_COMMERCIAL, fmt, ##__VA_ARGS__) 3032a6e48fSopenharmony_ci#define SURFACE_ASYNC_TRACE_BEGIN(name, value) \ 3132a6e48fSopenharmony_ci StartAsyncTrace(HITRACE_TAG_GRAPHIC_AGP | HITRACE_TAG_COMMERCIAL, name, value) 3232a6e48fSopenharmony_ci#define SURFACE_ASYNC_TRACE_END(name, value) \ 3332a6e48fSopenharmony_ci FinishAsyncTrace(HITRACE_TAG_GRAPHIC_AGP | HITRACE_TAG_COMMERCIAL, name, value) 3432a6e48fSopenharmony_ci#define SURFACE_TRACE_INT(name, value) \ 3532a6e48fSopenharmony_ci CountTrace(HITRACE_TAG_GRAPHIC_AGP | HITRACE_TAG_COMMERCIAL, name, value) 3632a6e48fSopenharmony_ci#define SURFACE_TRACE_FUNC() SURFACE_TRACE_NAME(__func__) 3732a6e48fSopenharmony_ci#endif // GRAPHIC_SURFACE_TRACE_H 38