1
2
3
4
5
6
7
8#ifndef HWSAMPLER_H_
9#define HWSAMPLER_H_
10
11#include <linux/workqueue.h>
12
13struct hws_qsi_info_block
14{
15 unsigned int b0_13:14;
16 unsigned int as:1;
17 unsigned int b15_21:7;
18 unsigned int es:1;
19 unsigned int b23_29:7;
20 unsigned int cs:1;
21 unsigned int:1;
22 unsigned int bsdes:16;
23 unsigned int:16;
24 unsigned long min_sampl_rate;
25 unsigned long max_sampl_rate;
26 unsigned long tear;
27 unsigned long dear;
28 unsigned int rsvrd0;
29 unsigned int cpu_speed;
30 unsigned long long rsvrd1;
31 unsigned long long rsvrd2;
32};
33
34struct hws_ssctl_request_block
35{
36 unsigned int s:1;
37 unsigned int h:1;
38 unsigned long b2_53:52;
39 unsigned int es:1;
40 unsigned int b55_61:7;
41 unsigned int cs:1;
42 unsigned int b63:1;
43 unsigned long interval;
44 unsigned long tear;
45 unsigned long dear;
46
47 unsigned long rsvrd1;
48 unsigned long rsvrd2;
49 unsigned long rsvrd3;
50 unsigned long rsvrd4;
51};
52
53struct hws_cpu_buffer {
54 unsigned long first_sdbt;
55 unsigned long worker_entry;
56 unsigned long sample_overflow;
57 struct hws_qsi_info_block qsi;
58 struct hws_ssctl_request_block ssctl;
59 struct work_struct worker;
60 atomic_t ext_params;
61 unsigned long req_alert;
62 unsigned long loss_of_sample_data;
63 unsigned long invalid_entry_address;
64 unsigned long incorrect_sdbt_entry;
65 unsigned long sample_auth_change_alert;
66 unsigned int finish:1;
67 unsigned int oom:1;
68 unsigned int stop_mode:1;
69};
70
71struct hws_data_entry {
72 unsigned int def:16;
73 unsigned int R:4;
74 unsigned int U:4;
75 unsigned int z:2;
76 unsigned int T:1;
77 unsigned int W:1;
78 unsigned int P:1;
79 unsigned int AS:2;
80 unsigned int I:1;
81 unsigned int:16;
82 unsigned int prim_asn:16;
83 unsigned long long ia;
84 unsigned long long gpp;
85 unsigned long long hpp;
86};
87
88struct hws_trailer_entry {
89 unsigned int f:1;
90 unsigned int a:1;
91 unsigned long:62;
92 unsigned long overflow;
93 unsigned long timestamp;
94 unsigned long timestamp1;
95 unsigned long reserved1;
96 unsigned long reserved2;
97 unsigned long progusage1;
98 unsigned long progusage2;
99};
100
101int hwsampler_setup(void);
102int hwsampler_shutdown(void);
103int hwsampler_allocate(unsigned long sdbt, unsigned long sdb);
104int hwsampler_deallocate(void);
105unsigned long hwsampler_query_min_interval(void);
106unsigned long hwsampler_query_max_interval(void);
107int hwsampler_start_all(unsigned long interval);
108int hwsampler_stop_all(void);
109int hwsampler_deactivate(unsigned int cpu);
110int hwsampler_activate(unsigned int cpu);
111unsigned long hwsampler_get_sample_overflow_count(unsigned int cpu);
112
113#endif
114