From patchwork Tue Jan 22 18:11:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 156308 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp7883062jaa; Tue, 22 Jan 2019 10:12:02 -0800 (PST) X-Google-Smtp-Source: ALg8bN4i7NLkc4xrspcK/PN+LcN58j0aJEf+rswmDAhjFbYa4Yu5iRKh3yNjWXww1ldQPuoX0T07 X-Received: by 2002:a62:ea09:: with SMTP id t9mr36042098pfh.228.1548180722563; Tue, 22 Jan 2019 10:12:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548180722; cv=none; d=google.com; s=arc-20160816; b=sywrQII4r4bND4YWK+K/wP5SmMa0mm4rJ7Kqb87L+elyvfXLfRI32YJBU096DLm6hp Hi7q5Keg4Dc+71OqVkba8C9Dhao7D7TTImoijyfQu0Z4q4ir7Jam+i5KCRVIyqIstRmE i3x+LvI8zcG2CVYNnCH9ThaGFmLCApocMovfS5pixt8Mx9agelPX0bVaTzxigAaXaYC9 R3frSlIVNQkfxSqX5Smk7L3f277y9Q3lJUKfZFEhRMLf4RkGz52oZK13E5awdbhz5BEW hA4tGX3EfcEw7eCSuYpl0dTj6pHGUwLpZp3Tm66PZiJ36UBYiWD3YZrD6RWR26u0JRaQ BQ8A== 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=zauErTH7+emyJuuGVQciu7QyFNMpIUnOyuE9HhCfweNa0hSt1idBLz026EaP4eNA/e Y1PI/bdoOVKOOivgTiG6H1NmWMfBUgkrBh89QjX/FmhCHTX3M3/MamPNsu6RX2lDtuon PT1LmPMOki8IpUpXzMbVnE8bEc8e7sHw72t/86DI1+k+90YspgIIIAZy9FmkawOJlBG/ kN0219oe3gY5psFSGQaLkVZ2XNOBRKJofIUV3wnDbYSoqD+cfUSL8YoKXXSxONvVc1/W UOC0QD6yPrp/0I1Hc3qK81Ua6dYlzZbi76zVFda4kqsFTqcOII/KujWe+TJiiQHPBx86 KFHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iYX1E+Qk; 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 e11si15355618pfh.147.2019.01.22.10.12.02; Tue, 22 Jan 2019 10:12:02 -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=iYX1E+Qk; 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 S1726863AbfAVSMA (ORCPT + 27 others); Tue, 22 Jan 2019 13:12:00 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:32870 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726827AbfAVSL5 (ORCPT ); Tue, 22 Jan 2019 13:11:57 -0500 Received: by mail-pl1-f193.google.com with SMTP id z23so11875101plo.0 for ; Tue, 22 Jan 2019 10:11: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=iYX1E+QkQtS+reozDRSNxJxAJ9t+crCH5YtMtbQ4hKqfNhGWIE6Oajd4RJIpXCTU2N JUI21kO42yJuv8h2ZyR1KtgfDrWQ88ir7AC0UbLF8NrzgjWKi715QVxMIgYfHMtgGM7x AdrigTyORi+AoTL5gf8Mvab/tfhrRU0HH3y6Y= 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=LT+S33qDBZX9vV8ASzvNRCKqFpuyXihmM2TvnN2W+zxd/MF7yy2cWZYQlxaow8Pzd9 HvcA8PPsBc2B/aBqk7ZGKGkuylqzwUueiMLZLNvQqZK3zHK9UhIHJAndJjW4sUhL73AW 4vz69Wxcpfx4SQ3veQE6fNP3varuF4AN5YSDVZTcm/VyJd6zDpUqGYCs74qsWKWLRk/p orpEVJSEdIwMHEbGHYF4UfZq5Y8HCcagLxlfnI6Cd3FsYZsQXv159VpYzIq2QVEuZTdD UB5+cJR9nB9l8DnLULYfGn4w9gsDMuUnyr8KCU6cGGgvappwkxol2/PQ6iQl/ioGcoWN PhyA== X-Gm-Message-State: AJcUukcKrNgkpUlRLBn0x9tcbrh9k0V5mGS60Z0JLipSll7GtcaDhMvW yp6yzKq8vPT3iE1Iwa6qUk2UNA== X-Received: by 2002:a17:902:2862:: with SMTP id e89mr35764673plb.158.1548180717330; Tue, 22 Jan 2019 10:11:57 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id a18sm23489919pgj.30.2019.01.22.10.11.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Jan 2019 10:11:56 -0800 (PST) From: Mathieu Poirier To: acme@kernel.org, peterz@infradead.org Cc: gregkh@linuxfoundation.org, 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, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, suzuki.poulose@arm.com Subject: [PATCH v2 6/7] perf tools: Removing CoreSight set_drv_config() API Date: Tue, 22 Jan 2019 11:11:43 -0700 Message-Id: <20190122181144.26645-7-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190122181144.26645-1-mathieu.poirier@linaro.org> References: <20190122181144.26645-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);