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" 20 namespace OHOS { 21 namespace SmartPerf { 22 class Temperature : public SpProfiler { 23 public: 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::string("cluster0"), std::string("gpu-thermal"), 29 std::string("drmos_gpu_npu"), std::string("npu_thermal")}; 30 std::map<std::string, std::string> ItemData() override; GetInstance()31 static Temperature &GetInstance() 32 { 33 static Temperature instance; 34 return instance; 35 } 36 void GetTempInfos(std::map<std::string, std::string> &result, const std::string& type, const std::string& temp); 37 38 private: Temperature()39 Temperature() {}; 40 Temperature(const Temperature &); 41 Temperature &operator = (const Temperature &); 42 std::string thermalBasePath = "/sys/class/thermal"; 43 }; 44 } 45 } 46 #endif