1/* 2 * Copyright (c) 2024 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 OHOS_HDI_DISPLAY_BUFFER_DFX_H 17#define OHOS_HDI_DISPLAY_BUFFER_DFX_H 18#include <string> 19#include <sys/time.h> 20#ifdef DISPLAY_HICOLLIE_ENABLE 21#include "xcollie/xcollie.h" 22#include "xcollie/xcollie_define.h" 23#endif 24namespace OHOS { 25namespace HDI { 26namespace Display { 27namespace Buffer { 28namespace V1_0 { 29class DisplayBufferDfx { 30public: 31 explicit DisplayBufferDfx(const std::string& name); 32 ~DisplayBufferDfx(); 33 void SetTimer(); 34 void CancelTimer(); 35 void StartTimeStamp(); 36 void StopTimeStamp(); 37private: 38 std::string dfxName_; 39 int32_t timeId_; 40 bool flag_; 41 struct timeval startTimeStamp; 42 struct timeval stopTimeStamp; 43}; 44} // namespace V1_0 45} // namespace Buffer 46} // namespace Display 47} // namespace HDI 48} // namespace OHOS 49#endif // OHOS_HDI_DISPLAY_BUFFER_DFX_H