]>
Commit | Line | Data |
---|---|---|
db0463bf | 1 | /* SPDX-License-Identifier: LGPL-2.1+ */ |
1f5596dd CB |
2 | |
3 | #ifndef __LXCFS_PROC_CPUVIEW_FUSE_H | |
4 | #define __LXCFS_PROC_CPUVIEW_FUSE_H | |
5 | ||
6 | #ifndef _GNU_SOURCE | |
7 | #define _GNU_SOURCE | |
8 | #endif | |
9 | ||
10 | #ifndef FUSE_USE_VERSION | |
11 | #define FUSE_USE_VERSION 26 | |
12 | #endif | |
13 | ||
14 | #define _FILE_OFFSET_BITS 64 | |
15 | ||
16 | #include <stdio.h> | |
17 | #include <stdlib.h> | |
18 | #include <sys/types.h> | |
19 | #include <unistd.h> | |
20 | ||
21 | #include "config.h" | |
22 | #include "macro.h" | |
23 | ||
4ec5c9da CB |
24 | struct cpuacct_usage { |
25 | uint64_t user; | |
26 | uint64_t system; | |
27 | uint64_t idle; | |
28 | bool online; | |
29 | }; | |
1f5596dd CB |
30 | |
31 | extern int cpuview_proc_stat(const char *cg, const char *cpuset, | |
32 | struct cpuacct_usage *cg_cpu_usage, | |
33 | int cg_cpu_usage_size, FILE *f, char *buf, | |
34 | size_t buf_size); | |
35 | extern int proc_cpuinfo_read(char *buf, size_t size, off_t offset, | |
36 | struct fuse_file_info *fi); | |
37 | extern int read_cpuacct_usage_all(char *cg, char *cpuset, | |
38 | struct cpuacct_usage **return_usage, int *size); | |
4ec5c9da CB |
39 | extern bool init_cpuview(void); |
40 | extern void free_cpuview(void); | |
41 | extern int max_cpu_count(const char *cg); | |
1f5596dd CB |
42 | |
43 | #endif /* __LXCFS_PROC_CPUVIEW_FUSE_H */ | |
44 |