Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 277327
b: refs/heads/master
c: b3d9468
h: refs/heads/master
i:
  277325: 526cb6d
  277323: 01e522e
  277319: 3d4ce26
  277311: 1d5ae95
v: v3
  • Loading branch information
Gleb Natapov authored and Ingo Molnar committed Dec 6, 2011
1 parent be3c8c2 commit 848e66f
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c1d6f42f1a42c721513e2f388c208e5348004f64
refs/heads/master: b3d9468a8bd218a695e3a0ff112cd4efd27b670a
15 changes: 15 additions & 0 deletions trunk/arch/x86/include/asm/perf_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,15 @@ union cpuid10_edx {
unsigned int full;
};

struct x86_pmu_capability {
int version;
int num_counters_gp;
int num_counters_fixed;
int bit_width_gp;
int bit_width_fixed;
unsigned int events_mask;
int events_mask_len;
};

/*
* Fixed-purpose performance events:
Expand Down Expand Up @@ -216,13 +225,19 @@ struct perf_guest_switch_msr {
};

extern struct perf_guest_switch_msr *perf_guest_get_msrs(int *nr);
extern void perf_get_x86_pmu_capability(struct x86_pmu_capability *cap);
#else
static inline perf_guest_switch_msr *perf_guest_get_msrs(int *nr)
{
*nr = 0;
return NULL;
}

static inline void perf_get_x86_pmu_capability(struct x86_pmu_capability *cap)
{
memset(cap, 0, sizeof(*cap));
}

static inline void perf_events_lapic_init(void) { }
#endif

Expand Down
12 changes: 12 additions & 0 deletions trunk/arch/x86/kernel/cpu/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -1696,3 +1696,15 @@ unsigned long perf_misc_flags(struct pt_regs *regs)

return misc;
}

void perf_get_x86_pmu_capability(struct x86_pmu_capability *cap)
{
cap->version = x86_pmu.version;
cap->num_counters_gp = x86_pmu.num_counters;
cap->num_counters_fixed = x86_pmu.num_counters_fixed;
cap->bit_width_gp = x86_pmu.cntval_bits;
cap->bit_width_fixed = x86_pmu.cntval_bits;
cap->events_mask = (unsigned int)x86_pmu.events_maskl;
cap->events_mask_len = x86_pmu.events_mask_len;
}
EXPORT_SYMBOL_GPL(perf_get_x86_pmu_capability);

0 comments on commit 848e66f

Please sign in to comment.