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 HOOK_STANDALONE_H 17 #define HOOK_STANDALONE_H 18 19 #include <string> 20 21 using HookData = struct { 22 int pid; 23 uint32_t smbSize; 24 uint64_t duration; 25 uint32_t filterSize; 26 uint32_t maxStackDepth; 27 uint32_t statisticsInterval; 28 std::string fileName; 29 std::string processName; 30 std::string performance_filename; 31 bool mallocDisable; 32 bool mmapDisable; 33 bool freemsgstack; 34 bool munmapmsgstack; 35 bool fpUnwind; 36 bool offlineSymbolization; 37 bool callframeCompress; 38 bool stringCompressed; 39 bool rawString; 40 }; 41 42 namespace OHOS { 43 namespace Developtools { 44 namespace Profiler { 45 namespace Hook { 46 bool StartHook(HookData& hookData); 47 } // namespace Hook 48 } // namespace Profiler 49 } // namespace Developtools 50 } // namespace OHOS 51 52 #endif // HOOK_STANDALONE_H