]> git.proxmox.com Git - mirror_lxcfs.git/blob - src/proc_cpuview.h
tree-wide: use a single fuse header
[mirror_lxcfs.git] / src / proc_cpuview.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
2
3 #ifndef __LXCFS_PROC_CPUVIEW_FUSE_H
4 #define __LXCFS_PROC_CPUVIEW_FUSE_H
5
6 #include "config.h"
7
8 #include <stdio.h>
9 #include <stdlib.h>
10 #include <sys/types.h>
11 #include <unistd.h>
12
13 #include "lxcfs_fuse.h"
14
15 #include "macro.h"
16
17 struct cpuacct_usage {
18 uint64_t user;
19 uint64_t system;
20 uint64_t idle;
21 bool online;
22 };
23
24 extern int cpuview_proc_stat(const char *cg, const char *cpuset,
25 struct cpuacct_usage *cg_cpu_usage,
26 int cg_cpu_usage_size, FILE *f, char *buf,
27 size_t buf_size);
28 extern int proc_cpuinfo_read(char *buf, size_t size, off_t offset,
29 struct fuse_file_info *fi);
30 extern int read_cpuacct_usage_all(char *cg, char *cpuset,
31 struct cpuacct_usage **return_usage, int *size);
32 extern bool init_cpuview(void);
33 extern void free_cpuview(void);
34 extern int max_cpu_count(const char *cg);
35
36 #endif /* __LXCFS_PROC_CPUVIEW_FUSE_H */
37