-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathparse_argp.h
60 lines (56 loc) · 1.28 KB
/
parse_argp.h
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
48
49
50
51
52
53
54
55
56
57
58
59
60
/* SPDX-License-Identifier: GPL-2.0 */
/* Copyright (C) 2023 Qais Yousef */
#ifndef __PARSE_ARGS_H__
#define __PARSE_ARGS_H__
#ifndef __SA_BPF_BUILD
#include <argp.h>
#include <stdbool.h>
#endif
#define TASK_COMM_LEN 16
#define MAX_FILTERS_NUM 128
struct sa_opts {
/* perfetto opts */
bool system;
bool app;
/* controls */
char *output;
const char *output_path;
long max_size;
unsigned int num_ftrace_event;
unsigned int num_atrace_cat;
unsigned int num_function_graph;
unsigned int num_function_filter;
char *ftrace_event[MAX_FILTERS_NUM];
char *atrace_cat[MAX_FILTERS_NUM];
char *function_graph[MAX_FILTERS_NUM];
char *function_filter[MAX_FILTERS_NUM];
/* events */
bool load_avg_cpu;
bool runnable_avg_cpu;
bool util_avg_cpu;
bool load_avg_task;
bool runnable_avg_task;
bool util_avg_task;
bool util_avg_rt;
bool util_avg_dl;
bool util_avg_irq;
bool load_avg_thermal;
bool util_est_cpu;
bool util_est_task;
bool cpu_nr_running;
bool cpu_freq;
bool cpu_idle;
bool softirq;
bool sched_switch;
bool load_balance;
bool ipi;
bool irq;
/* filters */
unsigned int num_pids;
unsigned int num_comms;
pid_t pid[MAX_FILTERS_NUM];
char comm[MAX_FILTERS_NUM][TASK_COMM_LEN];
};
extern struct sa_opts sa_opts;
extern const struct argp argp;
#endif /* __PARSE_ARGS_H__ */