1 /* 2 * Copyright (c) 2025 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 JS_CONCURRENT_MODULE_TASKPOOL_DFX_HISYS_EVENT_H 17 #define JS_CONCURRENT_MODULE_TASKPOOL_DFX_HISYS_EVENT_H 18 19 #if defined(ENABLE_TASKPOOL_HISYSEVENT) 20 #include "hisysevent.h" 21 #endif 22 #include <string> 23 24 namespace Commonlibrary::Concurrent::TaskPoolModule { 25 26 struct HisyseventParams { 27 std::string methodName; 28 std::string funName; 29 std::string logType; 30 std::string message; 31 int32_t code; 32 uint64_t waitTime; 33 int32_t pid; 34 int32_t tid; 35 }; 36 37 class DfxHisysEvent { 38 public: 39 DfxHisysEvent() = default; 40 ~DfxHisysEvent() = default; 41 42 static int32_t WriteFfrtAndUv(HisyseventParams* hisyseventParams); 43 44 static constexpr int32_t TASK_TIMEOUT = 10001; // execute task timeout 45 static constexpr int32_t WORKER_ALIVE = 10002; // worker uv alive 46 }; 47 } // namespace Commonlibrary::Concurrent::TaskPoolModule 48 #endif // JS_CONCURRENT_MODULE_TASKPOOL_DFX_HISYS_EVENT_H