• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2025-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 #ifndef MOCK_FFRT_API_C_FFRT_DUMP_H
16 #define MOCK_FFRT_API_C_FFRT_DUMP_H
17 #include <stdint.h>
18 #include "type_def_ext.h"
19 
20 #define MAX_TASK_NAME_LENGTH (64)
21 #define TASK_STAT_LENGTH (88)
22 
23 typedef enum { DUMP_INFO_ALL = 0, DUMP_TASK_STATISTIC_INFO, DUMP_START_STAT, DUMP_STOP_STAT } ffrt_dump_cmd_t;
24 
25 typedef struct ffrt_stat {
26     char taskName[MAX_TASK_NAME_LENGTH];
27     uint64_t funcPtr;
28     uint64_t startTime;
29     uint64_t endTime;
30 } ffrt_stat;
31 
32 typedef void (*ffrt_task_timeout_cb)(uint64_t gid, const char *msg, uint32_t size);
33 
ffrt_dump(ffrt_dump_cmd_t cmd,char * buf,uint32_t len)34 inline FFRT_C_API int ffrt_dump(ffrt_dump_cmd_t cmd, char *buf, uint32_t len)
35 {
36     return 0;
37 }
38 
ffrt_task_timeout_get_cb(void)39 inline FFRT_C_API ffrt_task_timeout_cb ffrt_task_timeout_get_cb(void)
40 {
41     return {};
42 }
43 
ffrt_task_timeout_set_cb(ffrt_task_timeout_cb cb)44 inline FFRT_C_API void ffrt_task_timeout_set_cb(ffrt_task_timeout_cb cb)
45 {}
46 
ffrt_task_timeout_get_threshold(void)47 inline FFRT_C_API uint32_t ffrt_task_timeout_get_threshold(void)
48 {
49     return 0;
50 }
51 
ffrt_task_timeout_set_threshold(uint32_t threshold_ms)52 inline FFRT_C_API void ffrt_task_timeout_set_threshold(uint32_t threshold_ms)
53 {}
54 #endif