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#ifndef TEMPERATURE_H 16#define TEMPERATURE_H 17 18#include <vector> 19#include "sp_profiler.h" 20namespace OHOS { 21namespace SmartPerf { 22class Temperature : public SpProfiler { 23public: 24 std::vector<std::string> collectNodes = { std::string("soc_thermal"), std::string("system_h"), 25 std::string("soc-thermal"), std::string("gpu"), 26 std::string("shell_frame"), std::string("shell_front"), 27 std::string("shell_back"), std::string("Battery") }; 28 std::map<std::string, std::string> ItemData() override; 29 static Temperature &GetInstance() 30 { 31 static Temperature instance; 32 return instance; 33 } 34 35private: 36 Temperature() {}; 37 Temperature(const Temperature &); 38 Temperature &operator = (const Temperature &); 39 std::string thermalBasePath = "/sys/class/thermal"; 40}; 41} 42} 43#endif