Commit 51b0fe39 authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Ingo Molnar

perf: Deconstify struct pmu

sed -ie 's/const struct pmu\>/struct pmu/g' `git grep -l "const struct pmu\>"`
Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
Cc: paulus <paulus@samba.org>
Cc: stephane eranian <eranian@googlemail.com>
Cc: Robert Richter <robert.richter@amd.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: Lin Ming <ming.m.lin@intel.com>
Cc: Yanmin <yanmin_zhang@linux.intel.com>
Cc: Deng-Cheng Zhu <dengcheng.zhu@gmail.com>
Cc: David Miller <davem@davemloft.net>
Cc: Michael Cree <mcree@orcon.net.nz>
LKML-Reference: <new-submission>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 2aa61274
...@@ -642,7 +642,7 @@ static int __hw_perf_event_init(struct perf_event *event) ...@@ -642,7 +642,7 @@ static int __hw_perf_event_init(struct perf_event *event)
return 0; return 0;
} }
static const struct pmu pmu = { static struct pmu pmu = {
.enable = alpha_pmu_enable, .enable = alpha_pmu_enable,
.disable = alpha_pmu_disable, .disable = alpha_pmu_disable,
.read = alpha_pmu_read, .read = alpha_pmu_read,
...@@ -653,7 +653,7 @@ static const struct pmu pmu = { ...@@ -653,7 +653,7 @@ static const struct pmu pmu = {
/* /*
* Main entry point to initialise a HW performance event. * Main entry point to initialise a HW performance event.
*/ */
const struct pmu *hw_perf_event_init(struct perf_event *event) struct pmu *hw_perf_event_init(struct perf_event *event)
{ {
int err; int err;
......
...@@ -491,7 +491,7 @@ __hw_perf_event_init(struct perf_event *event) ...@@ -491,7 +491,7 @@ __hw_perf_event_init(struct perf_event *event)
return err; return err;
} }
const struct pmu * struct pmu *
hw_perf_event_init(struct perf_event *event) hw_perf_event_init(struct perf_event *event)
{ {
int err = 0; int err = 0;
......
...@@ -857,7 +857,7 @@ static void power_pmu_unthrottle(struct perf_event *event) ...@@ -857,7 +857,7 @@ static void power_pmu_unthrottle(struct perf_event *event)
* Set the flag to make pmu::enable() not perform the * Set the flag to make pmu::enable() not perform the
* schedulability test, it will be performed at commit time * schedulability test, it will be performed at commit time
*/ */
void power_pmu_start_txn(const struct pmu *pmu) void power_pmu_start_txn(struct pmu *pmu)
{ {
struct cpu_hw_events *cpuhw = &__get_cpu_var(cpu_hw_events); struct cpu_hw_events *cpuhw = &__get_cpu_var(cpu_hw_events);
...@@ -870,7 +870,7 @@ void power_pmu_start_txn(const struct pmu *pmu) ...@@ -870,7 +870,7 @@ void power_pmu_start_txn(const struct pmu *pmu)
* Clear the flag and pmu::enable() will perform the * Clear the flag and pmu::enable() will perform the
* schedulability test. * schedulability test.
*/ */
void power_pmu_cancel_txn(const struct pmu *pmu) void power_pmu_cancel_txn(struct pmu *pmu)
{ {
struct cpu_hw_events *cpuhw = &__get_cpu_var(cpu_hw_events); struct cpu_hw_events *cpuhw = &__get_cpu_var(cpu_hw_events);
...@@ -882,7 +882,7 @@ void power_pmu_cancel_txn(const struct pmu *pmu) ...@@ -882,7 +882,7 @@ void power_pmu_cancel_txn(const struct pmu *pmu)
* Perform the group schedulability test as a whole * Perform the group schedulability test as a whole
* Return 0 if success * Return 0 if success
*/ */
int power_pmu_commit_txn(const struct pmu *pmu) int power_pmu_commit_txn(struct pmu *pmu)
{ {
struct cpu_hw_events *cpuhw; struct cpu_hw_events *cpuhw;
long i, n; long i, n;
...@@ -1014,7 +1014,7 @@ static int hw_perf_cache_event(u64 config, u64 *eventp) ...@@ -1014,7 +1014,7 @@ static int hw_perf_cache_event(u64 config, u64 *eventp)
return 0; return 0;
} }
const struct pmu *hw_perf_event_init(struct perf_event *event) struct pmu *hw_perf_event_init(struct perf_event *event)
{ {
u64 ev; u64 ev;
unsigned long flags; unsigned long flags;
......
...@@ -428,7 +428,7 @@ static int hw_perf_cache_event(u64 config, u64 *eventp) ...@@ -428,7 +428,7 @@ static int hw_perf_cache_event(u64 config, u64 *eventp)
return 0; return 0;
} }
const struct pmu *hw_perf_event_init(struct perf_event *event) struct pmu *hw_perf_event_init(struct perf_event *event)
{ {
u64 ev; u64 ev;
struct perf_event *events[MAX_HWEVENTS]; struct perf_event *events[MAX_HWEVENTS];
......
...@@ -257,13 +257,13 @@ static void sh_pmu_read(struct perf_event *event) ...@@ -257,13 +257,13 @@ static void sh_pmu_read(struct perf_event *event)
sh_perf_event_update(event, &event->hw, event->hw.idx); sh_perf_event_update(event, &event->hw, event->hw.idx);
} }
static const struct pmu pmu = { static struct pmu pmu = {
.enable = sh_pmu_enable, .enable = sh_pmu_enable,
.disable = sh_pmu_disable, .disable = sh_pmu_disable,
.read = sh_pmu_read, .read = sh_pmu_read,
}; };
const struct pmu *hw_perf_event_init(struct perf_event *event) struct pmu *hw_perf_event_init(struct perf_event *event)
{ {
int err = __hw_perf_event_init(event); int err = __hw_perf_event_init(event);
if (unlikely(err)) { if (unlikely(err)) {
......
...@@ -1099,7 +1099,7 @@ static int __hw_perf_event_init(struct perf_event *event) ...@@ -1099,7 +1099,7 @@ static int __hw_perf_event_init(struct perf_event *event)
* Set the flag to make pmu::enable() not perform the * Set the flag to make pmu::enable() not perform the
* schedulability test, it will be performed at commit time * schedulability test, it will be performed at commit time
*/ */
static void sparc_pmu_start_txn(const struct pmu *pmu) static void sparc_pmu_start_txn(struct pmu *pmu)
{ {
struct cpu_hw_events *cpuhw = &__get_cpu_var(cpu_hw_events); struct cpu_hw_events *cpuhw = &__get_cpu_var(cpu_hw_events);
...@@ -1111,7 +1111,7 @@ static void sparc_pmu_start_txn(const struct pmu *pmu) ...@@ -1111,7 +1111,7 @@ static void sparc_pmu_start_txn(const struct pmu *pmu)
* Clear the flag and pmu::enable() will perform the * Clear the flag and pmu::enable() will perform the
* schedulability test. * schedulability test.
*/ */
static void sparc_pmu_cancel_txn(const struct pmu *pmu) static void sparc_pmu_cancel_txn(struct pmu *pmu)
{ {
struct cpu_hw_events *cpuhw = &__get_cpu_var(cpu_hw_events); struct cpu_hw_events *cpuhw = &__get_cpu_var(cpu_hw_events);
...@@ -1123,7 +1123,7 @@ static void sparc_pmu_cancel_txn(const struct pmu *pmu) ...@@ -1123,7 +1123,7 @@ static void sparc_pmu_cancel_txn(const struct pmu *pmu)
* Perform the group schedulability test as a whole * Perform the group schedulability test as a whole
* Return 0 if success * Return 0 if success
*/ */
static int sparc_pmu_commit_txn(const struct pmu *pmu) static int sparc_pmu_commit_txn(struct pmu *pmu)
{ {
struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
int n; int n;
...@@ -1142,7 +1142,7 @@ static int sparc_pmu_commit_txn(const struct pmu *pmu) ...@@ -1142,7 +1142,7 @@ static int sparc_pmu_commit_txn(const struct pmu *pmu)
return 0; return 0;
} }
static const struct pmu pmu = { static struct pmu pmu = {
.enable = sparc_pmu_enable, .enable = sparc_pmu_enable,
.disable = sparc_pmu_disable, .disable = sparc_pmu_disable,
.read = sparc_pmu_read, .read = sparc_pmu_read,
...@@ -1152,7 +1152,7 @@ static const struct pmu pmu = { ...@@ -1152,7 +1152,7 @@ static const struct pmu pmu = {
.commit_txn = sparc_pmu_commit_txn, .commit_txn = sparc_pmu_commit_txn,
}; };
const struct pmu *hw_perf_event_init(struct perf_event *event) struct pmu *hw_perf_event_init(struct perf_event *event)
{ {
int err = __hw_perf_event_init(event); int err = __hw_perf_event_init(event);
......
...@@ -618,7 +618,7 @@ static void x86_pmu_enable_all(int added) ...@@ -618,7 +618,7 @@ static void x86_pmu_enable_all(int added)
} }
} }
static const struct pmu pmu; static struct pmu pmu;
static inline int is_x86_event(struct perf_event *event) static inline int is_x86_event(struct perf_event *event)
{ {
...@@ -1427,7 +1427,7 @@ static inline void x86_pmu_read(struct perf_event *event) ...@@ -1427,7 +1427,7 @@ static inline void x86_pmu_read(struct perf_event *event)
* Set the flag to make pmu::enable() not perform the * Set the flag to make pmu::enable() not perform the
* schedulability test, it will be performed at commit time * schedulability test, it will be performed at commit time
*/ */
static void x86_pmu_start_txn(const struct pmu *pmu) static void x86_pmu_start_txn(struct pmu *pmu)
{ {
struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
...@@ -1440,7 +1440,7 @@ static void x86_pmu_start_txn(const struct pmu *pmu) ...@@ -1440,7 +1440,7 @@ static void x86_pmu_start_txn(const struct pmu *pmu)
* Clear the flag and pmu::enable() will perform the * Clear the flag and pmu::enable() will perform the
* schedulability test. * schedulability test.
*/ */
static void x86_pmu_cancel_txn(const struct pmu *pmu) static void x86_pmu_cancel_txn(struct pmu *pmu)
{ {
struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
...@@ -1457,7 +1457,7 @@ static void x86_pmu_cancel_txn(const struct pmu *pmu) ...@@ -1457,7 +1457,7 @@ static void x86_pmu_cancel_txn(const struct pmu *pmu)
* Perform the group schedulability test as a whole * Perform the group schedulability test as a whole
* Return 0 if success * Return 0 if success
*/ */
static int x86_pmu_commit_txn(const struct pmu *pmu) static int x86_pmu_commit_txn(struct pmu *pmu)
{ {
struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
int assign[X86_PMC_IDX_MAX]; int assign[X86_PMC_IDX_MAX];
...@@ -1483,7 +1483,7 @@ static int x86_pmu_commit_txn(const struct pmu *pmu) ...@@ -1483,7 +1483,7 @@ static int x86_pmu_commit_txn(const struct pmu *pmu)
return 0; return 0;
} }
static const struct pmu pmu = { static struct pmu pmu = {
.enable = x86_pmu_enable, .enable = x86_pmu_enable,
.disable = x86_pmu_disable, .disable = x86_pmu_disable,
.start = x86_pmu_start, .start = x86_pmu_start,
...@@ -1569,9 +1569,9 @@ static int validate_group(struct perf_event *event) ...@@ -1569,9 +1569,9 @@ static int validate_group(struct perf_event *event)
return ret; return ret;
} }
const struct pmu *hw_perf_event_init(struct perf_event *event) struct pmu *hw_perf_event_init(struct perf_event *event)
{ {
const struct pmu *tmp; struct pmu *tmp;
int err; int err;
err = __hw_perf_event_init(event); err = __hw_perf_event_init(event);
......
...@@ -578,19 +578,19 @@ struct pmu { ...@@ -578,19 +578,19 @@ struct pmu {
* Start the transaction, after this ->enable() doesn't need * Start the transaction, after this ->enable() doesn't need
* to do schedulability tests. * to do schedulability tests.
*/ */
void (*start_txn) (const struct pmu *pmu); void (*start_txn) (struct pmu *pmu);
/* /*
* If ->start_txn() disabled the ->enable() schedulability test * If ->start_txn() disabled the ->enable() schedulability test
* then ->commit_txn() is required to perform one. On success * then ->commit_txn() is required to perform one. On success
* the transaction is closed. On error the transaction is kept * the transaction is closed. On error the transaction is kept
* open until ->cancel_txn() is called. * open until ->cancel_txn() is called.
*/ */
int (*commit_txn) (const struct pmu *pmu); int (*commit_txn) (struct pmu *pmu);
/* /*
* Will cancel the transaction, assumes ->disable() is called for * Will cancel the transaction, assumes ->disable() is called for
* each successfull ->enable() during the transaction. * each successfull ->enable() during the transaction.
*/ */
void (*cancel_txn) (const struct pmu *pmu); void (*cancel_txn) (struct pmu *pmu);
}; };
/** /**
...@@ -669,7 +669,7 @@ struct perf_event { ...@@ -669,7 +669,7 @@ struct perf_event {
int nr_siblings; int nr_siblings;
int group_flags; int group_flags;
struct perf_event *group_leader; struct perf_event *group_leader;
const struct pmu *pmu; struct pmu *pmu;
enum perf_event_active_state state; enum perf_event_active_state state;
unsigned int attach_state; unsigned int attach_state;
...@@ -849,7 +849,7 @@ struct perf_output_handle { ...@@ -849,7 +849,7 @@ struct perf_output_handle {
*/ */
extern int perf_max_events; extern int perf_max_events;
extern const struct pmu *hw_perf_event_init(struct perf_event *event); extern struct pmu *hw_perf_event_init(struct perf_event *event);
extern void perf_event_task_sched_in(struct task_struct *task); extern void perf_event_task_sched_in(struct task_struct *task);
extern void perf_event_task_sched_out(struct task_struct *task, struct task_struct *next); extern void perf_event_task_sched_out(struct task_struct *task, struct task_struct *next);
......
...@@ -75,7 +75,7 @@ static DEFINE_SPINLOCK(perf_resource_lock); ...@@ -75,7 +75,7 @@ static DEFINE_SPINLOCK(perf_resource_lock);
/* /*
* Architecture provided APIs - weak aliases: * Architecture provided APIs - weak aliases:
*/ */
extern __weak const struct pmu *hw_perf_event_init(struct perf_event *event) extern __weak struct pmu *hw_perf_event_init(struct perf_event *event)
{ {
return NULL; return NULL;
} }
...@@ -691,7 +691,7 @@ group_sched_in(struct perf_event *group_event, ...@@ -691,7 +691,7 @@ group_sched_in(struct perf_event *group_event,
struct perf_event_context *ctx) struct perf_event_context *ctx)
{ {
struct perf_event *event, *partial_group = NULL; struct perf_event *event, *partial_group = NULL;
const struct pmu *pmu = group_event->pmu; struct pmu *pmu = group_event->pmu;
bool txn = false; bool txn = false;
if (group_event->state == PERF_EVENT_STATE_OFF) if (group_event->state == PERF_EVENT_STATE_OFF)
...@@ -4501,7 +4501,7 @@ static int perf_swevent_int(struct perf_event *event) ...@@ -4501,7 +4501,7 @@ static int perf_swevent_int(struct perf_event *event)
return 0; return 0;
} }
static const struct pmu perf_ops_generic = { static struct pmu perf_ops_generic = {
.enable = perf_swevent_enable, .enable = perf_swevent_enable,
.disable = perf_swevent_disable, .disable = perf_swevent_disable,
.start = perf_swevent_int, .start = perf_swevent_int,
...@@ -4614,7 +4614,7 @@ static void cpu_clock_perf_event_read(struct perf_event *event) ...@@ -4614,7 +4614,7 @@ static void cpu_clock_perf_event_read(struct perf_event *event)
cpu_clock_perf_event_update(event); cpu_clock_perf_event_update(event);
} }
static const struct pmu perf_ops_cpu_clock = { static struct pmu perf_ops_cpu_clock = {
.enable = cpu_clock_perf_event_enable, .enable = cpu_clock_perf_event_enable,
.disable = cpu_clock_perf_event_disable, .disable = cpu_clock_perf_event_disable,
.read = cpu_clock_perf_event_read, .read = cpu_clock_perf_event_read,
...@@ -4671,7 +4671,7 @@ static void task_clock_perf_event_read(struct perf_event *event) ...@@ -4671,7 +4671,7 @@ static void task_clock_perf_event_read(struct perf_event *event)
task_clock_perf_event_update(event, time); task_clock_perf_event_update(event, time);
} }
static const struct pmu perf_ops_task_clock = { static struct pmu perf_ops_task_clock = {
.enable = task_clock_perf_event_enable, .enable = task_clock_perf_event_enable,
.disable = task_clock_perf_event_disable, .disable = task_clock_perf_event_disable,
.read = task_clock_perf_event_read, .read = task_clock_perf_event_read,
...@@ -4785,7 +4785,7 @@ static int swevent_hlist_get(struct perf_event *event) ...@@ -4785,7 +4785,7 @@ static int swevent_hlist_get(struct perf_event *event)
#ifdef CONFIG_EVENT_TRACING #ifdef CONFIG_EVENT_TRACING
static const struct pmu perf_ops_tracepoint = { static struct pmu perf_ops_tracepoint = {
.enable = perf_trace_enable, .enable = perf_trace_enable,
.disable = perf_trace_disable, .disable = perf_trace_disable,
.start = perf_swevent_int, .start = perf_swevent_int,
...@@ -4849,7 +4849,7 @@ static void tp_perf_event_destroy(struct perf_event *event) ...@@ -4849,7 +4849,7 @@ static void tp_perf_event_destroy(struct perf_event *event)
perf_trace_destroy(event); perf_trace_destroy(event);
} }
static const struct pmu *tp_perf_event_init(struct perf_event *event) static struct pmu *tp_perf_event_init(struct perf_event *event)
{ {
int err; int err;
...@@ -4896,7 +4896,7 @@ static void perf_event_free_filter(struct perf_event *event) ...@@ -4896,7 +4896,7 @@ static void perf_event_free_filter(struct perf_event *event)
#else #else
static const struct pmu *tp_perf_event_init(struct perf_event *event) static struct pmu *tp_perf_event_init(struct perf_event *event)
{ {
return NULL; return NULL;
} }
...@@ -4918,7 +4918,7 @@ static void bp_perf_event_destroy(struct perf_event *event) ...@@ -4918,7 +4918,7 @@ static void bp_perf_event_destroy(struct perf_event *event)
release_bp_slot(event); release_bp_slot(event);
} }
static const struct pmu *bp_perf_event_init(struct perf_event *bp) static struct pmu *bp_perf_event_init(struct perf_event *bp)
{ {
int err; int err;
...@@ -4942,7 +4942,7 @@ void perf_bp_event(struct perf_event *bp, void *data) ...@@ -4942,7 +4942,7 @@ void perf_bp_event(struct perf_event *bp, void *data)
perf_swevent_add(bp, 1, 1, &sample, regs); perf_swevent_add(bp, 1, 1, &sample, regs);
} }
#else #else
static const struct pmu *bp_perf_event_init(struct perf_event *bp) static struct pmu *bp_perf_event_init(struct perf_event *bp)
{ {
return NULL; return NULL;
} }
...@@ -4964,9 +4964,9 @@ static void sw_perf_event_destroy(struct perf_event *event) ...@@ -4964,9 +4964,9 @@ static void sw_perf_event_destroy(struct perf_event *event)
swevent_hlist_put(event); swevent_hlist_put(event);
} }
static const struct pmu *sw_perf_event_init(struct perf_event *event) static struct pmu *sw_perf_event_init(struct perf_event *event)
{ {
const struct pmu *pmu = NULL; struct pmu *pmu = NULL;
u64 event_id = event->attr.config; u64 event_id = event->attr.config;
/* /*
...@@ -5028,7 +5028,7 @@ perf_event_alloc(struct perf_event_attr *attr, ...@@ -5028,7 +5028,7 @@ perf_event_alloc(struct perf_event_attr *attr,
perf_overflow_handler_t overflow_handler, perf_overflow_handler_t overflow_handler,
gfp_t gfpflags) gfp_t gfpflags)
{ {
const struct pmu *pmu; struct pmu *pmu;
struct perf_event *event; struct perf_event *event;
struct hw_perf_event *hwc; struct hw_perf_event *hwc;
long err; long err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment