lkml.org 
[lkml]   [2012]   [Mar]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 1/6] perf: Export perf_assign_events
    Date
    From: "Yan, Zheng" <zheng.z.yan@intel.com>

    Export perf_assign_events so the uncore code can use it to
    schedule events.

    Signed-off-by: Zheng Yan <zheng.z.yan@intel.com>
    ---
    arch/x86/kernel/cpu/perf_event.c | 6 +++---
    arch/x86/kernel/cpu/perf_event.h | 2 ++
    2 files changed, 5 insertions(+), 3 deletions(-)

    diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c
    index bb8e034..70e5784 100644
    --- a/arch/x86/kernel/cpu/perf_event.c
    +++ b/arch/x86/kernel/cpu/perf_event.c
    @@ -640,7 +640,7 @@ static bool __perf_sched_find_counter(struct perf_sched *sched)
    c = sched->constraints[sched->state.event];

    /* Prefer fixed purpose counters */
    - if (x86_pmu.num_counters_fixed) {
    + if (c->idxmsk64 & ((u64)-1 << X86_PMC_IDX_FIXED)) {
    idx = X86_PMC_IDX_FIXED;
    for_each_set_bit_from(idx, c->idxmsk, X86_PMC_IDX_MAX) {
    if (!__test_and_set_bit(idx, sched->state.used))
    @@ -707,8 +707,8 @@ static bool perf_sched_next_event(struct perf_sched *sched)
    /*
    * Assign a counter for each event.
    */
    -static int perf_assign_events(struct event_constraint **constraints, int n,
    - int wmin, int wmax, int *assign)
    +int perf_assign_events(struct event_constraint **constraints, int n,
    + int wmin, int wmax, int *assign)
    {
    struct perf_sched sched;

    diff --git a/arch/x86/kernel/cpu/perf_event.h b/arch/x86/kernel/cpu/perf_event.h
    index 6638aaf..e6dfc00 100644
    --- a/arch/x86/kernel/cpu/perf_event.h
    +++ b/arch/x86/kernel/cpu/perf_event.h
    @@ -466,6 +466,8 @@ static inline void __x86_pmu_enable_event(struct hw_perf_event *hwc,

    void x86_pmu_enable_all(int added);

    +int perf_assign_events(struct event_constraint **constraints, int n,
    + int wmin, int wmax, int *assign);
    int x86_schedule_events(struct cpu_hw_events *cpuc, int n, int *assign);

    void x86_pmu_stop(struct perf_event *event, int flags);
    --
    1.7.7.6


    \
     
     \ /
      Last update: 2012-04-01 03:45    [W:0.024 / U:61.640 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site