]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
perf pmu: Remove set_drv_config API
authorMathieu Poirier <mathieu.poirier@linaro.org>
Thu, 31 Jan 2019 18:47:14 +0000 (11:47 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 6 Feb 2019 13:00:39 +0000 (10:00 -0300)
CoreSight was the only client of the PMU's set_drv_config() API.  Now
that it is no longer needed by CoreSight remove it from the code base.

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-8-mathieu.poirier@linaro.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-record.c
tools/perf/builtin-stat.c
tools/perf/builtin-top.c
tools/perf/util/Build
tools/perf/util/drv_configs.c [deleted file]
tools/perf/util/drv_configs.h [deleted file]
tools/perf/util/pmu.h

index 88ea11d57c6f1a8103bd9728f8de1608b811ab45..56e9d9e8c174bedd49d6e4564af94b3c19f53ce1 100644 (file)
@@ -23,7 +23,6 @@
 #include "util/evlist.h"
 #include "util/evsel.h"
 #include "util/debug.h"
-#include "util/drv_configs.h"
 #include "util/session.h"
 #include "util/tool.h"
 #include "util/symbol.h"
@@ -567,7 +566,6 @@ static int record__open(struct record *rec)
        struct perf_evlist *evlist = rec->evlist;
        struct perf_session *session = rec->session;
        struct record_opts *opts = &rec->opts;
-       struct perf_evsel_config_term *err_term;
        int rc = 0;
 
        /*
@@ -620,14 +618,6 @@ static int record__open(struct record *rec)
                goto out;
        }
 
-       if (perf_evlist__apply_drv_configs(evlist, &pos, &err_term)) {
-               pr_err("failed to set config \"%s\" on event %s with %d (%s)\n",
-                     err_term->val.drv_cfg, perf_evsel__name(pos), errno,
-                     str_error_r(errno, msg, sizeof(msg)));
-               rc = -1;
-               goto out;
-       }
-
        rc = record__mmap(rec);
        if (rc)
                goto out;
index e587808591e82623b41236d8b37f8b1d9cec813c..bb24f9c17f9a62c8ded72479313177d67dba1bb2 100644 (file)
@@ -52,7 +52,6 @@
 #include "util/evlist.h"
 #include "util/evsel.h"
 #include "util/debug.h"
-#include "util/drv_configs.h"
 #include "util/color.h"
 #include "util/stat.h"
 #include "util/header.h"
@@ -417,7 +416,6 @@ static int __run_perf_stat(int argc, const char **argv, int run_idx)
        int status = 0;
        const bool forks = (argc > 0);
        bool is_pipe = STAT_RECORD ? perf_stat.data.is_pipe : false;
-       struct perf_evsel_config_term *err_term;
 
        if (interval) {
                ts.tv_sec  = interval / USEC_PER_MSEC;
@@ -514,13 +512,6 @@ static int __run_perf_stat(int argc, const char **argv, int run_idx)
                return -1;
        }
 
-       if (perf_evlist__apply_drv_configs(evsel_list, &counter, &err_term)) {
-               pr_err("failed to set config \"%s\" on event %s with %d (%s)\n",
-                     err_term->val.drv_cfg, perf_evsel__name(counter), errno,
-                     str_error_r(errno, msg, sizeof(msg)));
-               return -1;
-       }
-
        if (STAT_RECORD) {
                int err, fd = perf_data__fd(&perf_stat.data);
 
index 619406339e4b91ccb94b2f7bb48a5678d41cd641..231a90daa958131e132fb79ef7f7d4b0f3d10ff0 100644 (file)
@@ -25,7 +25,6 @@
 #include "util/bpf-event.h"
 #include "util/config.h"
 #include "util/color.h"
-#include "util/drv_configs.h"
 #include "util/evlist.h"
 #include "util/evsel.h"
 #include "util/event.h"
@@ -1186,10 +1185,6 @@ static void init_process_thread(struct perf_top *top)
 
 static int __cmd_top(struct perf_top *top)
 {
-       char msg[512];
-       struct perf_evsel *pos;
-       struct perf_evsel_config_term *err_term;
-       struct perf_evlist *evlist = top->evlist;
        struct record_opts *opts = &top->record_opts;
        pthread_t thread, thread_process;
        int ret;
@@ -1240,14 +1235,6 @@ static int __cmd_top(struct perf_top *top)
        if (ret)
                goto out_delete;
 
-       ret = perf_evlist__apply_drv_configs(evlist, &pos, &err_term);
-       if (ret) {
-               pr_err("failed to set config \"%s\" on event %s with %d (%s)\n",
-                       err_term->val.drv_cfg, perf_evsel__name(pos), errno,
-                       str_error_r(errno, msg, sizeof(msg)));
-               goto out_delete;
-       }
-
        top->session->evlist = top->evlist;
        perf_session__set_id_hdr_size(top->session);
 
index b69d6294c88c38acdf4f6da8b5d27b4c31e4b5e0..a36e6e5a6f4fa46a515375e6fd725184f2cc20e8 100644 (file)
@@ -107,7 +107,6 @@ libperf-y += term.o
 libperf-y += help-unknown-cmd.o
 libperf-y += mem-events.o
 libperf-y += vsprintf.o
-libperf-y += drv_configs.o
 libperf-y += units.o
 libperf-y += time-utils.o
 libperf-y += expr-bison.o
diff --git a/tools/perf/util/drv_configs.c b/tools/perf/util/drv_configs.c
deleted file mode 100644 (file)
index eec7542..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * drv_configs.h: Interface to apply PMU specific configuration
- * Copyright (c) 2016-2018, Linaro Ltd.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- */
-
-#include "drv_configs.h"
-#include "evlist.h"
-#include "evsel.h"
-#include "pmu.h"
-#include <errno.h>
-
-static int
-perf_evsel__apply_drv_configs(struct perf_evsel *evsel,
-                             struct perf_evsel_config_term **err_term)
-{
-       bool found = false;
-       int err = 0;
-       struct perf_evsel_config_term *term;
-       struct perf_pmu *pmu = NULL;
-
-       while ((pmu = perf_pmu__scan(pmu)) != NULL)
-               if (pmu->type == evsel->attr.type) {
-                       found = true;
-                       break;
-               }
-
-       list_for_each_entry(term, &evsel->config_terms, list) {
-               if (term->type != PERF_EVSEL__CONFIG_TERM_DRV_CFG)
-                       continue;
-
-               /*
-                * We have a configuration term, report an error if we
-                * can't find the PMU or if the PMU driver doesn't support
-                * cmd line driver configuration.
-                */
-               if (!found || !pmu->set_drv_config) {
-                       err = -EINVAL;
-                       *err_term = term;
-                       break;
-               }
-
-               err = pmu->set_drv_config(term);
-               if (err) {
-                       *err_term = term;
-                       break;
-               }
-       }
-
-       return err;
-}
-
-int perf_evlist__apply_drv_configs(struct perf_evlist *evlist,
-                                  struct perf_evsel **err_evsel,
-                                  struct perf_evsel_config_term **err_term)
-{
-       struct perf_evsel *evsel;
-       int err = 0;
-
-       evlist__for_each_entry(evlist, evsel) {
-               err = perf_evsel__apply_drv_configs(evsel, err_term);
-               if (err) {
-                       *err_evsel = evsel;
-                       break;
-               }
-       }
-
-       return err;
-}
diff --git a/tools/perf/util/drv_configs.h b/tools/perf/util/drv_configs.h
deleted file mode 100644 (file)
index 32bc9ba..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * drv_configs.h: Interface to apply PMU specific configuration
- * Copyright (c) 2016-2018, Linaro Ltd.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- */
-
-#ifndef __PERF_DRV_CONFIGS_H
-#define __PERF_DRV_CONFIGS_H
-
-#include "drv_configs.h"
-#include "evlist.h"
-#include "evsel.h"
-
-int perf_evlist__apply_drv_configs(struct perf_evlist *evlist,
-                                  struct perf_evsel **err_evsel,
-                                  struct perf_evsel_config_term **term);
-#endif
index 1c12a61ed0dc10ad2445339fbba573c8d55301a2..47253c3daf55b8cc6f8e4849f300101f8786fc3d 100644 (file)
@@ -31,7 +31,6 @@ struct perf_pmu {
        struct list_head format;  /* HEAD struct perf_pmu_format -> list */
        struct list_head aliases; /* HEAD struct perf_pmu_alias -> list */
        struct list_head list;    /* ELEM */
-       int (*set_drv_config)   (struct perf_evsel_config_term *term);
 };
 
 struct perf_pmu_info {