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 std::string fileName; 28 std::string processName; 29 std::string performance_filename; 30 bool mallocDisable; 31 bool mmapDisable; 32 bool freemsgstack; 33 bool munmapmsgstack; 34 bool fpUnwind; 35 }; 36 37 namespace OHOS { 38 namespace Developtools { 39 namespace Profiler { 40 namespace Hook { 41 bool StartHook(HookData& hookData); 42 } // namespace Hook 43 } // namespace Profiler 44 } // namespace Developtools 45 } // namespace OHOS 46 47 #endif // HOOK_STANDALONE_H