#ifndef __INTF_H
#define __INTF_H
#include <limits.h>
#ifndef __VMLINUX_H__
typedef unsigned char u8;
typedef unsigned short u16;
typedef unsigned int u32;
typedef unsigned long u64;
typedef signed char s8;
typedef signed short s16;
typedef signed int s32;
typedef signed long s64;
typedef int pid_t;
enum {
TASK_COMM_LEN = 16,
};
#endif
enum {
LAVD_CPU_ID_MAX = 512,
LAVD_CPDOM_MAX_NR = 128,
LAVD_CPDOM_MAX_DIST = 3,
LAVD_PCO_STATE_MAX = 11,
LAVD_STATUS_STR_LEN = 4,
};
struct sys_stat {
u64 last_update_clk;
u64 avg_util;
u64 avg_sc_util;
u64 avg_svc_time;
u64 nr_queued_task;
u64 slice;
u32 avg_lat_cri;
u32 max_lat_cri;
u32 thr_lat_cri;
u32 min_perf_cri;
u32 avg_perf_cri;
u32 max_perf_cri;
u32 thr_perf_cri;
u32 nr_stealee;
u32 nr_active;
u32 nr_active_cpdoms;
u64 nr_sched;
u64 nr_preempt;
u64 nr_perf_cri;
u64 nr_lat_cri;
u64 nr_x_migration;
u64 nr_big;
u64 nr_pc_on_big;
u64 nr_lc_on_big;
};
struct task_ctx_x {
pid_t pid;
char comm[TASK_COMM_LEN + 1];
char stat[LAVD_STATUS_STR_LEN + 1];
u32 cpu_id;
u32 prev_cpu_id;
u32 suggested_cpu_id;
pid_t waker_pid;
char waker_comm[TASK_COMM_LEN + 1];
u64 slice;
u32 lat_cri;
u32 avg_lat_cri;
u16 static_prio;
u64 rerunnable_interval;
u64 resched_interval;
u64 run_freq;
u64 avg_runtime;
u64 wait_freq;
u64 wake_freq;
u32 perf_cri;
u32 thr_perf_cri;
u32 cpuperf_cur;
u64 cpu_util;
u64 cpu_sutil;
u32 nr_active;
u64 dsq_id;
u64 dsq_consume_lat;
u64 last_slice_used;
};
enum {
LAVD_CMD_NOP = 0x0,
LAVD_CMD_SCHED_N = 0x1,
};
enum {
LAVD_MSG_TASKC = 0x1
};
struct introspec {
volatile u64 arg;
volatile u32 cmd;
};
struct msg_hdr {
u32 kind;
};
struct msg_task_ctx {
struct msg_hdr hdr;
struct task_ctx_x taskc_x;
};
enum {
LAVD_PM_PERFORMANCE = 0,
LAVD_PM_BALANCED = 1,
LAVD_PM_POWERSAVE = 2,
LAVD_PM_MAX = 3
};
struct power_arg {
s32 power_mode;
};
#endif