Skip to content

Commit

Permalink
perf, x86: Enable not tagged retired instruction counting on P4s
Browse files Browse the repository at this point in the history
This should turn on instruction counting on P4s, which was missing in
the first version of the new PMU driver.

It's inaccurate for now, we still need dependant event to tag mops
before we can count them precisely. The result is that the number of
instruction may be lifted up.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
LKML-Reference: <1268629102.3355.11.camel@minggr.sh.intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Cyrill Gorcunov authored and Ingo Molnar committed Mar 15, 2010
1 parent 8576e19 commit e449526
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
8 changes: 4 additions & 4 deletions arch/x86/include/asm/perf_event_p4.h
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,8 @@ static inline u32 p4_default_escr_conf(int cpu, int exclude_os, int exclude_usr)

#define P4_SSE_INPUT_ASSIST P4_EVENT_PACK(0x34, 0x01)
/*
* MSR_P4_FIRM_ESCR: 8, 9
* MSR_P4_FIRM_ESCR: 10, 11
* MSR_P4_FIRM_ESCR0: 8, 9
* MSR_P4_FIRM_ESCR1: 10, 11
*/

#define P4_PACKED_SP_UOP P4_EVENT_PACK(0x08, 0x01)
Expand Down Expand Up @@ -462,8 +462,8 @@ static inline u32 p4_default_escr_conf(int cpu, int exclude_os, int exclude_usr)

#define P4_INSTR_RETIRED P4_EVENT_PACK(0x02, 0x04)
/*
* MSR_P4_CRU_ESCR2: 12, 13, 16
* MSR_P4_CRU_ESCR3: 14, 15, 17
* MSR_P4_CRU_ESCR0: 12, 13, 16
* MSR_P4_CRU_ESCR1: 14, 15, 17
*/

#define P4_UOPS_RETIRED P4_EVENT_PACK(0x01, 0x04)
Expand Down
8 changes: 3 additions & 5 deletions arch/x86/kernel/cpu/perf_event_p4.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,11 @@ struct p4_event_template p4_templates[] = {
[2] = {
.opcode = P4_INSTR_RETIRED,
.config = 0,
.dep = 0, /* needs front-end tagging */
.dep = -1, /* needs front-end tagging */
.emask =
P4_EVENT_ATTR(P4_INSTR_RETIRED, NBOGUSNTAG) |
P4_EVENT_ATTR(P4_INSTR_RETIRED, NBOGUSTAG) |
P4_EVENT_ATTR(P4_INSTR_RETIRED, BOGUSNTAG) |
P4_EVENT_ATTR(P4_INSTR_RETIRED, BOGUSTAG),
.escr_msr = { MSR_P4_CRU_ESCR2, MSR_P4_CRU_ESCR3 },
P4_EVENT_ATTR(P4_INSTR_RETIRED, BOGUSNTAG),
.escr_msr = { MSR_P4_CRU_ESCR0, MSR_P4_CRU_ESCR1 },
.cntr = { 12, 14 },
},
[3] = {
Expand Down

0 comments on commit e449526

Please sign in to comment.