-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathperf_case.h
113 lines (101 loc) · 3.04 KB
/
perf_case.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#ifndef __PERF_CASE_H
#define __PERF_CASE_H
#include <getopt.h>
#include "perf_stat.h"
#define PERF_CASE_DEFINE(_name) \
struct perf_case __perf_case_##_name
#define PERF_CASE_DECLARE(_name) \
extern struct perf_case __perf_case_##_name
#define PERF_CASE(_name) \
&__perf_case_##_name
#define PERF_EVENT_SET(_name, _events) \
{.name = _name, .events = _events, .event_num = sizeof(_events) / sizeof(struct perf_event)}
struct perf_eventset {
char *name;
struct perf_event *events;
int event_num;
};
struct perf_option {
struct option opt;
char *ostr;
char *desc;
};
struct perf_case {
char *name;
char *desc;
void* data;
int (*init)(struct perf_case *p_case, struct perf_stat *p_stat, int argc, char *argv[]);
int (*exit)(struct perf_case *p_case, struct perf_stat *p_stat);
void (*func)(struct perf_case *p_case, struct perf_stat *p_stat);
void (*help)(struct perf_case *p_case);
int (*getopt)(struct perf_case *p_case, int opt);
struct perf_option *opts;
int opts_num;
struct perf_event *events;
int event_num;
int inner_stat;
};
struct perf_run {
struct perf_case *p_case;
struct perf_stat *stats;
int stat_num;
long max_dur;
long min_dur;
long avg_dur;
};
PERF_CASE_DECLARE(memset_malloc);
PERF_CASE_DECLARE(memset_malloc_x2);
PERF_CASE_DECLARE(memset_mmap);
PERF_CASE_DECLARE(memset_static_bss);
PERF_CASE_DECLARE(memset_static_data);
PERF_CASE_DECLARE(membw_rd_1);
PERF_CASE_DECLARE(membw_rd_4);
PERF_CASE_DECLARE(membw_rd_8);
PERF_CASE_DECLARE(membw_rd_1_4x);
PERF_CASE_DECLARE(membw_rd_4_4x);
PERF_CASE_DECLARE(membw_rd_8_4x);
PERF_CASE_DECLARE(membw_wr_1);
PERF_CASE_DECLARE(membw_wr_4);
PERF_CASE_DECLARE(membw_wr_8);
PERF_CASE_DECLARE(membw_wr_1_4x);
PERF_CASE_DECLARE(membw_wr_4_4x);
PERF_CASE_DECLARE(membw_wr_8_4x);
PERF_CASE_DECLARE(membw_cp_1);
PERF_CASE_DECLARE(membw_cp_4);
PERF_CASE_DECLARE(membw_cp_8);
PERF_CASE_DECLARE(membw_cp_1_4x);
PERF_CASE_DECLARE(membw_cp_4_4x);
PERF_CASE_DECLARE(membw_cp_8_4x);
PERF_CASE_DECLARE(memlat_random);
PERF_CASE_DECLARE(cpuint_add);
PERF_CASE_DECLARE(cpuint_mul);
PERF_CASE_DECLARE(cpufp_add);
PERF_CASE_DECLARE(cpufp_mul);
PERF_CASE_DECLARE(cpusimd_add);
PERF_CASE_DECLARE(cpusimd_mul);
PERF_CASE_DECLARE(branch_pred);
PERF_CASE_DECLARE(branch_next);
PERF_CASE_DECLARE(ustress_branch_direct);
PERF_CASE_DECLARE(ustress_branch_indirect);
PERF_CASE_DECLARE(ustress_call_return);
PERF_CASE_DECLARE(ustress_div32);
PERF_CASE_DECLARE(ustress_div64);
PERF_CASE_DECLARE(ustress_double2int);
PERF_CASE_DECLARE(ustress_fpdiv);
PERF_CASE_DECLARE(ustress_fpmac);
PERF_CASE_DECLARE(ustress_fpmul);
PERF_CASE_DECLARE(ustress_fpsqrt);
PERF_CASE_DECLARE(ustress_int2double);
PERF_CASE_DECLARE(ustress_isb);
PERF_CASE_DECLARE(ustress_l1d_cache);
PERF_CASE_DECLARE(ustress_l1d_tlb);
PERF_CASE_DECLARE(ustress_l1i_cache);
PERF_CASE_DECLARE(ustress_l2d_cache);
PERF_CASE_DECLARE(ustress_load_after_store);
PERF_CASE_DECLARE(ustress_mac32);
PERF_CASE_DECLARE(ustress_mac64);
PERF_CASE_DECLARE(ustress_memcpy);
PERF_CASE_DECLARE(ustress_mul32);
PERF_CASE_DECLARE(ustress_mul64);
PERF_CASE_DECLARE(ustress_store_buffer_full);
#endif