From 1cacbdc9919acddcbb821dd0fecafcd56542f17f Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Mon, 13 Apr 2020 14:40:18 -0400 Subject: [PATCH] wrapper: remove perf wrapper --- lttng-context-perf-counters.c | 13 ++++++------ wrapper/perf.h | 37 ----------------------------------- 2 files changed, 6 insertions(+), 44 deletions(-) delete mode 100644 wrapper/perf.h diff --git a/lttng-context-perf-counters.c b/lttng-context-perf-counters.c index 8625842c..096189e1 100644 --- a/lttng-context-perf-counters.c +++ b/lttng-context-perf-counters.c @@ -16,7 +16,6 @@ #include #include #include -#include #include static @@ -122,8 +121,8 @@ int lttng_cpuhp_perf_counter_online(unsigned int cpu, struct perf_event_attr *attr = perf_field->attr; struct perf_event *pevent; - pevent = wrapper_perf_event_create_kernel_counter(attr, - cpu, NULL, overflow_callback); + pevent = perf_event_create_kernel_counter(attr, + cpu, NULL, overflow_callback, NULL); if (!pevent || IS_ERR(pevent)) return -EINVAL; if (pevent->state == PERF_EVENT_STATE_ERROR) { @@ -184,8 +183,8 @@ int lttng_perf_counter_cpu_hp_callback(struct notifier_block *nb, switch (action) { case CPU_ONLINE: case CPU_ONLINE_FROZEN: - pevent = wrapper_perf_event_create_kernel_counter(attr, - cpu, NULL, overflow_callback); + pevent = perf_event_create_kernel_counter(attr, + cpu, NULL, overflow_callback, NULL); if (!pevent || IS_ERR(pevent)) return NOTIFY_BAD; if (pevent->state == PERF_EVENT_STATE_ERROR) { @@ -290,8 +289,8 @@ int lttng_add_perf_counter_to_ctx(uint32_t type, #endif get_online_cpus(); for_each_online_cpu(cpu) { - events[cpu] = wrapper_perf_event_create_kernel_counter(attr, - cpu, NULL, overflow_callback); + events[cpu] = perf_event_create_kernel_counter(attr, + cpu, NULL, overflow_callback, NULL); if (!events[cpu] || IS_ERR(events[cpu])) { ret = -EINVAL; goto counter_error; diff --git a/wrapper/perf.h b/wrapper/perf.h deleted file mode 100644 index bbdfb63c..00000000 --- a/wrapper/perf.h +++ /dev/null @@ -1,37 +0,0 @@ -/* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only) - * - * wrapper/perf.h - * - * Copyright (C) 2010-2012 Mathieu Desnoyers - */ - -#ifndef _LTTNG_WRAPPER_PERF_H -#define _LTTNG_WRAPPER_PERF_H - -#include - -#ifdef CONFIG_PERF_EVENTS - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)) -static inline struct perf_event * -wrapper_perf_event_create_kernel_counter(struct perf_event_attr *attr, - int cpu, - struct task_struct *task, - perf_overflow_handler_t callback) -{ - return perf_event_create_kernel_counter(attr, cpu, task, callback, NULL); -} -#else /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)) */ -static inline struct perf_event * -wrapper_perf_event_create_kernel_counter(struct perf_event_attr *attr, - int cpu, - struct task_struct *task, - perf_overflow_handler_t callback) -{ - return perf_event_create_kernel_counter(attr, cpu, task, callback); -} -#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)) */ - -#endif /* CONFIG_PERF_EVENTS */ - -#endif /* _LTTNG_WRAPPER_PERF_H */ -- 2.34.1