File tree Expand file tree Collapse file tree 3 files changed +27
-17
lines changed Expand file tree Collapse file tree 3 files changed +27
-17
lines changed Original file line number Diff line number Diff line change @@ -3978,6 +3978,8 @@ static __initconst const struct x86_pmu core_pmu = {
3978
3978
.cpu_dead = intel_pmu_cpu_dead ,
3979
3979
3980
3980
.check_period = intel_pmu_check_period ,
3981
+
3982
+ .lbr_reset = intel_pmu_lbr_reset_64 ,
3981
3983
};
3982
3984
3983
3985
static __initconst const struct x86_pmu intel_pmu = {
@@ -4023,6 +4025,8 @@ static __initconst const struct x86_pmu intel_pmu = {
4023
4025
.check_period = intel_pmu_check_period ,
4024
4026
4025
4027
.aux_output_match = intel_pmu_aux_output_match ,
4028
+
4029
+ .lbr_reset = intel_pmu_lbr_reset_64 ,
4026
4030
};
4027
4031
4028
4032
static __init void intel_clovertown_quirk (void )
@@ -4649,6 +4653,9 @@ __init int intel_pmu_init(void)
4649
4653
x86_pmu .intel_cap .capabilities = capabilities ;
4650
4654
}
4651
4655
4656
+ if (x86_pmu .intel_cap .lbr_format == LBR_FORMAT_32 )
4657
+ x86_pmu .lbr_reset = intel_pmu_lbr_reset_32 ;
4658
+
4652
4659
intel_ds_init ();
4653
4660
4654
4661
x86_add_quirk (intel_arch_events_quirk ); /* Install first, so it runs last */
Original file line number Diff line number Diff line change 8
8
9
9
#include "../perf_event.h"
10
10
11
- enum {
12
- LBR_FORMAT_32 = 0x00 ,
13
- LBR_FORMAT_LIP = 0x01 ,
14
- LBR_FORMAT_EIP = 0x02 ,
15
- LBR_FORMAT_EIP_FLAGS = 0x03 ,
16
- LBR_FORMAT_EIP_FLAGS2 = 0x04 ,
17
- LBR_FORMAT_INFO = 0x05 ,
18
- LBR_FORMAT_TIME = 0x06 ,
19
- LBR_FORMAT_MAX_KNOWN = LBR_FORMAT_TIME ,
20
- };
21
-
22
11
static const enum {
23
12
LBR_EIP_FLAGS = 1 ,
24
13
LBR_TSX = 2 ,
@@ -194,15 +183,15 @@ static void __intel_pmu_lbr_disable(void)
194
183
wrmsrl (MSR_IA32_DEBUGCTLMSR , debugctl );
195
184
}
196
185
197
- static void intel_pmu_lbr_reset_32 (void )
186
+ void intel_pmu_lbr_reset_32 (void )
198
187
{
199
188
int i ;
200
189
201
190
for (i = 0 ; i < x86_pmu .lbr_nr ; i ++ )
202
191
wrmsrl (x86_pmu .lbr_from + i , 0 );
203
192
}
204
193
205
- static void intel_pmu_lbr_reset_64 (void )
194
+ void intel_pmu_lbr_reset_64 (void )
206
195
{
207
196
int i ;
208
197
@@ -221,10 +210,7 @@ void intel_pmu_lbr_reset(void)
221
210
if (!x86_pmu .lbr_nr )
222
211
return ;
223
212
224
- if (x86_pmu .intel_cap .lbr_format == LBR_FORMAT_32 )
225
- intel_pmu_lbr_reset_32 ();
226
- else
227
- intel_pmu_lbr_reset_64 ();
213
+ x86_pmu .lbr_reset ();
228
214
229
215
cpuc -> last_task_ctx = NULL ;
230
216
cpuc -> last_log_id = 0 ;
Original file line number Diff line number Diff line change @@ -179,6 +179,17 @@ struct intel_excl_cntrs {
179
179
struct x86_perf_task_context ;
180
180
#define MAX_LBR_ENTRIES 32
181
181
182
+ enum {
183
+ LBR_FORMAT_32 = 0x00 ,
184
+ LBR_FORMAT_LIP = 0x01 ,
185
+ LBR_FORMAT_EIP = 0x02 ,
186
+ LBR_FORMAT_EIP_FLAGS = 0x03 ,
187
+ LBR_FORMAT_EIP_FLAGS2 = 0x04 ,
188
+ LBR_FORMAT_INFO = 0x05 ,
189
+ LBR_FORMAT_TIME = 0x06 ,
190
+ LBR_FORMAT_MAX_KNOWN = LBR_FORMAT_TIME ,
191
+ };
192
+
182
193
enum {
183
194
X86_PERF_KFREE_SHARED = 0 ,
184
195
X86_PERF_KFREE_EXCL = 1 ,
@@ -682,6 +693,8 @@ struct x86_pmu {
682
693
bool lbr_double_abort ; /* duplicated lbr aborts */
683
694
bool lbr_pt_coexist ; /* (LBR|BTS) may coexist with PT */
684
695
696
+ void (* lbr_reset )(void );
697
+
685
698
/*
686
699
* Intel PT/LBR/BTS are exclusive
687
700
*/
@@ -1058,6 +1071,10 @@ u64 lbr_from_signext_quirk_wr(u64 val);
1058
1071
1059
1072
void intel_pmu_lbr_reset (void );
1060
1073
1074
+ void intel_pmu_lbr_reset_32 (void );
1075
+
1076
+ void intel_pmu_lbr_reset_64 (void );
1077
+
1061
1078
void intel_pmu_lbr_add (struct perf_event * event );
1062
1079
1063
1080
void intel_pmu_lbr_del (struct perf_event * event );
You can’t perform that action at this time.
0 commit comments