4 * Copyright (c) 2022 Samsung Electronics Co., Ltd.
6 * Licensed under the Apache License, Version 2.0 (the License);
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
23 #include <linux/taskstats.h>
38 struct proc_map_info {
47 PROCESS_STAT_FIELD_PID,
48 PROCESS_STAT_FIELD_COMM,
49 PROCESS_STAT_FIELD_STATE,
50 PROCESS_STAT_FIELD_PPID,
51 PROCESS_STAT_FIELD_PGID,
52 PROCESS_STAT_FIELD_MAX,
55 int kernel_get_online_cpu_num(void);
56 int kernel_get_possible_cpu_num(void);
58 int kernel_get_total_cpu_stat(struct cpu_stat *total);
59 int kernel_get_per_cpu_stat(struct cpu_stat *cpus, int num_possible_cpus,
60 int *num_online_cpus);
62 int kernel_get_memory_info(const char *key, u_int64_t *val);
63 int kernel_get_memory_total(u_int64_t *val);
65 int kernel_get_process_stat_fields(pid_t pid, char *buffer, int buf_len,
66 char *stat_fields[PROCESS_STAT_FIELD_MAX]);
67 int kernel_get_process_taskstats(struct taskstats *stats, int cmd_type, pid_t pid);
68 int kernel_get_thread_group_taskstats(struct taskstats *stats, pid_t tgid, bool get_proc_info);
70 kernel_get_thread_group_map_info(struct proc_map_info *map_info, pid_t tgid, bool include_gpu_mem);
71 bool kernel_check_gpu_support(void);
72 bool kernel_check_taskstat_support(void);