Skip to content

Commit 9e31905

Browse files
committed
Merge remote-tracking branch 'tip/perf/core' into kvm-updates/3.3
* tip/perf/core: (66 commits) perf, x86: Expose perf capability to other modules perf, x86: Implement arch event mask as quirk x86, perf: Disable non available architectural events jump_label: Provide jump_label_key initializers jump_label, x86: Fix section mismatch perf, core: Rate limit perf_sched_events jump_label patching perf: Fix enable_on_exec for sibling events perf: Remove superfluous arguments perf, x86: Prefer fixed-purpose counters when scheduling perf, x86: Fix event scheduler for constraints with overlapping counters perf, x86: Implement event scheduler helper functions perf: Avoid a useless pmu_disable() in the perf-tick x86/tools: Add decoded instruction dump mode x86: Update instruction decoder to support new AVX formats x86/tools: Fix insn_sanity message outputs x86/tools: Fix instruction decoder message output x86: Fix instruction decoder to handle grouped AVX instructions x86/tools: Fix Makefile to build all test tools perf test: Soft errors shouldn't stop the "Validate PERF_RECORD_" test perf test: Validate PERF_RECORD_ events and perf_sample fields ... Signed-off-by: Avi Kivity <avi@redhat.com> * commit 'b3d9468a8bd218a695e3a0ff112cd4efd27b670a': (66 commits) perf, x86: Expose perf capability to other modules perf, x86: Implement arch event mask as quirk x86, perf: Disable non available architectural events jump_label: Provide jump_label_key initializers jump_label, x86: Fix section mismatch perf, core: Rate limit perf_sched_events jump_label patching perf: Fix enable_on_exec for sibling events perf: Remove superfluous arguments perf, x86: Prefer fixed-purpose counters when scheduling perf, x86: Fix event scheduler for constraints with overlapping counters perf, x86: Implement event scheduler helper functions perf: Avoid a useless pmu_disable() in the perf-tick x86/tools: Add decoded instruction dump mode x86: Update instruction decoder to support new AVX formats x86/tools: Fix insn_sanity message outputs x86/tools: Fix instruction decoder message output x86: Fix instruction decoder to handle grouped AVX instructions x86/tools: Fix Makefile to build all test tools perf test: Soft errors shouldn't stop the "Validate PERF_RECORD_" test perf test: Validate PERF_RECORD_ events and perf_sample fields ...
2 parents ff5c2c0 + b3d9468 commit 9e31905

98 files changed

Lines changed: 4196 additions & 2389 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Documentation/kernel-parameters.txt‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1882,6 +1882,9 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
18821882
arch_perfmon: [X86] Force use of architectural
18831883
perfmon on Intel CPUs instead of the
18841884
CPU specific event set.
1885+
timer: [X86] Force use of architectural NMI
1886+
timer mode (see also oprofile.timer
1887+
for generic hr timer mode)
18851888

18861889
oops=panic Always panic on oopses. Default is to just kill the
18871890
process, but there is a small probability of

‎Documentation/trace/events.txt‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,6 @@ And for string fields they are:
191191

192192
Currently, only exact string matches are supported.
193193

194-
Currently, the maximum number of predicates in a filter is 16.
195-
196194
5.2 Setting filters
197195
-------------------
198196

‎arch/Kconfig‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ config OPROFILE_EVENT_MULTIPLEX
3030
config HAVE_OPROFILE
3131
bool
3232

33+
config OPROFILE_NMI_TIMER
34+
def_bool y
35+
depends on PERF_EVENTS && HAVE_PERF_EVENTS_NMI
36+
3337
config KPROBES
3438
bool "Kprobes"
3539
depends on MODULES

‎arch/x86/include/asm/insn.h‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,13 @@ static inline int insn_is_avx(struct insn *insn)
137137
return (insn->vex_prefix.value != 0);
138138
}
139139

140+
/* Ensure this instruction is decoded completely */
141+
static inline int insn_complete(struct insn *insn)
142+
{
143+
return insn->opcode.got && insn->modrm.got && insn->sib.got &&
144+
insn->displacement.got && insn->immediate.got;
145+
}
146+
140147
static inline insn_byte_t insn_vex_m_bits(struct insn *insn)
141148
{
142149
if (insn->vex_prefix.nbytes == 2) /* 2 bytes VEX */

‎arch/x86/include/asm/perf_event.h‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
(1 << (ARCH_PERFMON_UNHALTED_CORE_CYCLES_INDEX))
5858

5959
#define ARCH_PERFMON_BRANCH_MISSES_RETIRED 6
60+
#define ARCH_PERFMON_EVENTS_COUNT 7
6061

6162
/*
6263
* Intel "Architectural Performance Monitoring" CPUID
@@ -72,6 +73,19 @@ union cpuid10_eax {
7273
unsigned int full;
7374
};
7475

76+
union cpuid10_ebx {
77+
struct {
78+
unsigned int no_unhalted_core_cycles:1;
79+
unsigned int no_instructions_retired:1;
80+
unsigned int no_unhalted_reference_cycles:1;
81+
unsigned int no_llc_reference:1;
82+
unsigned int no_llc_misses:1;
83+
unsigned int no_branch_instruction_retired:1;
84+
unsigned int no_branch_misses_retired:1;
85+
} split;
86+
unsigned int full;
87+
};
88+
7589
union cpuid10_edx {
7690
struct {
7791
unsigned int num_counters_fixed:5;
@@ -81,6 +95,15 @@ union cpuid10_edx {
8195
unsigned int full;
8296
};
8397

98+
struct x86_pmu_capability {
99+
int version;
100+
int num_counters_gp;
101+
int num_counters_fixed;
102+
int bit_width_gp;
103+
int bit_width_fixed;
104+
unsigned int events_mask;
105+
int events_mask_len;
106+
};
84107

85108
/*
86109
* Fixed-purpose performance events:
@@ -202,13 +225,19 @@ struct perf_guest_switch_msr {
202225
};
203226

204227
extern struct perf_guest_switch_msr *perf_guest_get_msrs(int *nr);
228+
extern void perf_get_x86_pmu_capability(struct x86_pmu_capability *cap);
205229
#else
206230
static inline perf_guest_switch_msr *perf_guest_get_msrs(int *nr)
207231
{
208232
*nr = 0;
209233
return NULL;
210234
}
211235

236+
static inline void perf_get_x86_pmu_capability(struct x86_pmu_capability *cap)
237+
{
238+
memset(cap, 0, sizeof(*cap));
239+
}
240+
212241
static inline void perf_events_lapic_init(void) { }
213242
#endif
214243

0 commit comments

Comments
 (0)