• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #include "dfx_hisys_event.h"
17 
18 namespace Commonlibrary::Concurrent::TaskPoolModule {
19 
WriteFfrtAndUv(HisyseventParams * hisyseventParams)20 int32_t DfxHisysEvent::WriteFfrtAndUv(HisyseventParams* hisyseventParams)
21 {
22     int32_t ret = -1;
23 #if defined(ENABLE_TASKPOOL_HISYSEVENT)
24     ret = HiSysEventWrite(OHOS::HiviewDFX::HiSysEvent::Domain::ARKTS_TASKPOOL,
25         "ARK_FFRT_UV",
26         OHOS::HiviewDFX::HiSysEvent::EventType::FAULT,
27         "PID", hisyseventParams->pid,
28         "TID", hisyseventParams->tid,
29         "METHOD", hisyseventParams->methodName,
30         "FUNCTION_NAME", hisyseventParams->funName,
31         "TYPE", hisyseventParams->logType,
32         "MESSAGE", hisyseventParams->message,
33         "CODE", hisyseventParams->code,
34         "WAIT_TIME", std::to_string(hisyseventParams->waitTime));
35     delete hisyseventParams;
36     hisyseventParams = nullptr;
37 #endif
38     return ret;
39 }
40 } // namespace Commonlibrary::Concurrent::TaskPoolModule