summaryrefstree
path: root/kernel/include/linux/perf_mgr/perf_mgr.h
blob: 3911c587f57f5c2da64d923cbb43ae0a3a05dfc6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include <linux/ioctl.h>
#include <linux/types.h>

#define PERF_MGR_MAGIC 'p'
#define FP_SCALE 1024

#define BOOST_OFF 0
#define BOOST_LOW 1
#define BOOST_MID 2
#define BOOST_HIGH 3

enum {
	TASK_ADD =1,
	FRAME_END,
	FPS_NUM,
	PROCESS_KILL,
};

struct fps_info {
	pid_t tid;
	int group_id;
	int boosting_lvl;
	int64_t duration;
};

struct task_fps_util_info{
	struct fps_info orig_fps_info;
	unsigned long updated_fps_util;
	int running_cpu;
	int last_update_frame;
	struct list_head list;
};

#define PERF_MGR_FPS_CHANGE				_IOWR(PERF_MGR_MAGIC, FPS_NUM, int*)
#define PERF_MGR_PROCESS_KILL			_IOWR(PERF_MGR_MAGIC, PROCESS_KILL, int*)
#define PERF_MGR_TASK_ADD				_IOWR(PERF_MGR_MAGIC, TASK_ADD, int*)
#define PERF_MGR_FRAME_END				_IOWR(PERF_MGR_MAGIC, FRAME_END, struct fps_info)

#define perf_attr(_name) \
static struct kobj_attribute _name##_attr = {	\
	.attr	= {									\
			.name = __stringify(_name),			\
			.mode = 0664,						\
	},											\
	.show	= _name##_show,						\
	.store	= _name##_store,					\
}