perf coresight: Remove set_drv_config() API
authorMathieu Poirier <mathieu.poirier@linaro.org>
Thu, 31 Jan 2019 18:47:13 +0000 (11:47 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 6 Feb 2019 13:00:39 +0000 (10:00 -0300)
Now that the event's config2 attribute is used to communicate sink
selection to the kernel, remove the old set_drv_config() implementation
since it is no longer needed.

Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Acked-by: Suzuki K Poulouse <suzuki.poulose@arm.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Will Deacon <will.deacon@arm.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-s390@vger.kernel.org
Link: http://lkml.kernel.org/r/20190131184714.20388-7-mathieu.poirier@linaro.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/arch/arm/util/cs-etm.c
tools/perf/arch/arm/util/cs-etm.h
tools/perf/arch/arm/util/pmu.c

index 4f31cf0d1e6d75b692e3bb65413a561abb5b4db0..911426721170b5fa495e63ef8ec3c03b9c836afd 100644 (file)
@@ -27,9 +27,6 @@
 #include <stdlib.h>
 #include <sys/stat.h>
 
-#define ENABLE_SINK_MAX        128
-#define CS_BUS_DEVICE_PATH "/bus/coresight/devices/"
-
 struct cs_etm_recording {
        struct auxtrace_record  itr;
        struct perf_pmu         *cs_etm_pmu;
@@ -642,54 +639,3 @@ struct auxtrace_record *cs_etm_record_init(int *err)
 out:
        return NULL;
 }
-
-static FILE *cs_device__open_file(const char *name)
-{
-       struct stat st;
-       char path[PATH_MAX];
-       const char *sysfs;
-
-       sysfs = sysfs__mountpoint();
-       if (!sysfs)
-               return NULL;
-
-       snprintf(path, PATH_MAX,
-                "%s" CS_BUS_DEVICE_PATH "%s", sysfs, name);
-
-       if (stat(path, &st) < 0)
-               return NULL;
-
-       return fopen(path, "w");
-
-}
-
-static int __printf(2, 3) cs_device__print_file(const char *name, const char *fmt, ...)
-{
-       va_list args;
-       FILE *file;
-       int ret = -EINVAL;
-
-       va_start(args, fmt);
-       file = cs_device__open_file(name);
-       if (file) {
-               ret = vfprintf(file, fmt, args);
-               fclose(file);
-       }
-       va_end(args);
-       return ret;
-}
-
-int cs_etm_set_drv_config(struct perf_evsel_config_term *term)
-{
-       int ret;
-       char enable_sink[ENABLE_SINK_MAX];
-
-       snprintf(enable_sink, ENABLE_SINK_MAX, "%s/%s",
-                term->val.drv_cfg, "enable_sink");
-
-       ret = cs_device__print_file(enable_sink, "%d", 1);
-       if (ret < 0)
-               return ret;
-
-       return 0;
-}
index 1a12e64f51279293dd1f515b84444116d794afbc..a3354bda4fe8e255309dc0ed5df435e80b2dc4c8 100644 (file)
@@ -7,9 +7,6 @@
 #ifndef INCLUDE__PERF_CS_ETM_H__
 #define INCLUDE__PERF_CS_ETM_H__
 
-#include "../../util/evsel.h"
-
 struct auxtrace_record *cs_etm_record_init(int *err);
-int cs_etm_set_drv_config(struct perf_evsel_config_term *term);
 
 #endif
index 64a677b518d081081cec6f120c4965ef4d7a660c..bbc297a7e2e3517059f9c3b33816deb69074ac20 100644 (file)
@@ -9,7 +9,6 @@
 #include <linux/perf_event.h>
 #include <linux/string.h>
 
-#include "cs-etm.h"
 #include "arm-spe.h"
 #include "../../util/pmu.h"
 
@@ -20,7 +19,6 @@ struct perf_event_attr
        if (!strcmp(pmu->name, CORESIGHT_ETM_PMU_NAME)) {
                /* add ETM default config here */
                pmu->selectable = true;
-               pmu->set_drv_config = cs_etm_set_drv_config;
 #if defined(__aarch64__)
        } else if (strstarts(pmu->name, ARM_SPE_PMU_NAME)) {
                return arm_spe_pmu_default_config(pmu);