From patchwork Tue Jan 15 23:07:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 155680 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp5454801jaa; Tue, 15 Jan 2019 15:08:13 -0800 (PST) X-Google-Smtp-Source: ALg8bN6vkeVYKsPkivML26fIICrrq7zrmivrSShJmU3XGpEWGEuODQm4i0WuRVNEfMxqLemTR89N X-Received: by 2002:a63:5346:: with SMTP id t6mr6100202pgl.40.1547593692990; Tue, 15 Jan 2019 15:08:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547593692; cv=none; d=google.com; s=arc-20160816; b=FIpr5G8cjc7lpfWDNnPz8jB+gUbtG4iOvb/tRR18YiotpPaR/8cf6sN/H2iPFs8g8a BF9tFLLZ8vM0np3rkNeibUS4hLVU9v71wSf9s/ysgOqpSBnkfVDzs0RllBQM1MtXpsr3 lKd7qsMI3eVrYseJQzha6oZZIKtQP6A4uByQr/Ij1cry2SfsZ3ECCfGOicenTLVfh2qt TBrIUYO8IVlfw9IBITtP96+9A4rlD6D3uwmFlIgrmi6Jzsppl34qHxTKprjYYWhooDHU aAR9UynYU6HZTcKC2yTizGLTJZVxJ9dp9vzQC466sRJrAimMBO6lMUvL8ASDMb3KVU5H URKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=W+tcSbssL1cjoomd1/kZjJ7IjRwzQZIgCHeNiM3a0+8=; b=HEG9LzH3wQxDtWIBsKS29pZZNhdND40FEPjRZJl/8NRAYTG6w8ssrJmggpENSV2crT Ri1wT6ueaO72XloNDMsKHrwD/819/FEYNTDpTMx6wFFPC0w/cZDSyiDzHyVx/nodgQkn Hdw4dR9h9n8GZsx3khZd+1Um0ce7oDdWn6W0jvOi9n1IfeGLoNCMffmiS45Iv6iN4djO Ur5LDtrUOp5llM6PB5LmKdeItXr+ZAbfiubnkq/1XuYSnodoLXVKrtHFp2Sa4vpc0CZt +Lzt8BHod3ekY7bO3vvFipMsY7FiCGb/FBBwZU2kP6rfccYjLjHwFqBFt7Lp7qptd69b J+9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FhWvV2jW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u28si4219177pgn.436.2019.01.15.15.08.12; Tue, 15 Jan 2019 15:08:12 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FhWvV2jW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391332AbfAOXIA (ORCPT + 31 others); Tue, 15 Jan 2019 18:08:00 -0500 Received: from mail-pl1-f194.google.com ([209.85.214.194]:46220 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391285AbfAOXH6 (ORCPT ); Tue, 15 Jan 2019 18:07:58 -0500 Received: by mail-pl1-f194.google.com with SMTP id t13so1984163ply.13 for ; Tue, 15 Jan 2019 15:07:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=W+tcSbssL1cjoomd1/kZjJ7IjRwzQZIgCHeNiM3a0+8=; b=FhWvV2jW3/XhC5+T+avYrTigCzmBbikp0R7D0LvqiJVqYCUHY4ajRCElkIziyN6xu4 zH9BHEvTLavNGPfVnT7pU4BCTGCv5ycPbz93ubvn3TPu0l+DG+22XY8EWdiDGwl4W4Sd uvhg2oyyi16g03Q+sE47o7o37DenxghqDzliM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=W+tcSbssL1cjoomd1/kZjJ7IjRwzQZIgCHeNiM3a0+8=; b=IeI6SVLldti82Fxqog+bdMlbgFsI0P7yz7CIBhaSN3qBy5FJtdt67qCDC3xRR52WRG C8MjGUWG8ph6GOgJ+SnzoK7Wpqk+Lo9/S/g2vKU6u37uqu7nxfNnpInCoAAD/hRCkJqA d/c7SEVbUqqFdItHSM+CCzRjdaR2egeOd874K9dMiXE/Npy9+OnOWHShaH0Q+KsNwfWw D7XYsMYB25pj1+V3ae2QzKHE+PBiYm0tLT8drfh72Fv5y5drHwNQ/J3UbWtlN1uN8EHD jNe2A7sfI4HQz6PJuVgf2rqZtvXZjlzhNTxGX5p41WnZvVS8vkjxqfQIe4HRTw4HqAdi vBVQ== X-Gm-Message-State: AJcUukfzb/LjfQnbb4eecWX7HpcpH/duGvNje9r87SQnRiq+s8yttOb7 CTmzc//afAszZ6VxTmDFS1+uIQ== X-Received: by 2002:a17:902:b090:: with SMTP id p16mr6605089plr.190.1547593677531; Tue, 15 Jan 2019 15:07:57 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id h19sm4985928pfn.114.2019.01.15.15.07.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Jan 2019 15:07:56 -0800 (PST) From: Mathieu Poirier To: acme@kernel.org, peterz@infradead.org, gregkh@linuxfoundation.org Cc: mingo@redhat.com, tglx@linutronix.de, alexander.shishkin@linux.intel.com, schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com, will.deacon@arm.com, mark.rutland@arm.com, jolsa@redhat.com, namhyung@kernel.org, adrian.hunter@intel.com, ast@kernel.org, hpa@zytor.com, suzuki.poulose@arm.com, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 6/7] perf tools: Removing CoreSight set_drv_config() API Date: Tue, 15 Jan 2019 16:07:41 -0700 Message-Id: <20190115230742.13730-7-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190115230742.13730-1-mathieu.poirier@linaro.org> References: <20190115230742.13730-1-mathieu.poirier@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now that 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 --- tools/perf/arch/arm/util/cs-etm.c | 54 ------------------------------- tools/perf/arch/arm/util/cs-etm.h | 3 -- tools/perf/arch/arm/util/pmu.c | 2 -- 3 files changed, 59 deletions(-) -- 2.17.1 diff --git a/tools/perf/arch/arm/util/cs-etm.c b/tools/perf/arch/arm/util/cs-etm.c index 4aa6193dcb50..9a4a8153e4c2 100644 --- a/tools/perf/arch/arm/util/cs-etm.c +++ b/tools/perf/arch/arm/util/cs-etm.c @@ -26,9 +26,6 @@ #include #include -#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; @@ -638,54 +635,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; -} diff --git a/tools/perf/arch/arm/util/cs-etm.h b/tools/perf/arch/arm/util/cs-etm.h index 1a12e64f5127..a3354bda4fe8 100644 --- a/tools/perf/arch/arm/util/cs-etm.h +++ b/tools/perf/arch/arm/util/cs-etm.h @@ -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 diff --git a/tools/perf/arch/arm/util/pmu.c b/tools/perf/arch/arm/util/pmu.c index e047571e6080..e4619f2fe7ce 100644 --- a/tools/perf/arch/arm/util/pmu.c +++ b/tools/perf/arch/arm/util/pmu.c @@ -8,7 +8,6 @@ #include #include -#include "cs-etm.h" #include "arm-spe.h" #include "../../util/pmu.h" @@ -19,7 +18,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);