From patchwork Wed Feb 6 18:48:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaldo Carvalho de Melo X-Patchwork-Id: 157658 Delivered-To: patch@linaro.org Received: by 2002:ac9:7558:0:0:0:0:0 with SMTP id r24csp6437527oct; Wed, 6 Feb 2019 10:50:40 -0800 (PST) X-Google-Smtp-Source: AHgI3IYqXU8d2VCeWX0E0j3G9HQ8+TYbIenIWgC0M2OjVDFv1X/9LN61ddrc/c7EnSmTToXqMxpJ X-Received: by 2002:a63:9306:: with SMTP id b6mr5930785pge.36.1549479040329; Wed, 06 Feb 2019 10:50:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549479040; cv=none; d=google.com; s=arc-20160816; b=u/vUKxL2w3zPInPagWr4p4iJhh/tKfQOGjEGSK4eKu6WWh2xJekwFuZs0KsIXElalq AcJPOSfZMxpbZ5flTno/go3nErylY6aHCrfKzdYMuqXqryQMml6/9O/U/l0OsAdL9zY/ Ox9ZGmsMNS5dYbqyFhukV4uqb6ji3I7bZWojA/2134mCVcg87m8YlaDoM20Dt99lnNmw 20E6k5oByZDnszA5Vax9eVcaxad9EnOXxQe4vIzghbnhcZMYAtImBjqQXBgdY/36/SK7 K5le1R0eGqWZZD0tRKfyomrU2PFrYvSZylKrAsYNgVy6DTry3AZnw4nNwdnVVtiF/OyP LQ7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=1Bdl8jwTRBJ8UIs13VKacHVdYLYLBfPLzbSMdcUvMY8=; b=WxNiwZvpDXFRwmBp16D5i4SW/2HLd81fp7xBE+F8OQ59TudC2jLbw27FtRjnNrAs/c i2xFE71rkc1GMpGcOIq+1O5QxAGBES2DkfbHT+SD/yrfQJPkn8+4jMddJdtLIxAQO/g1 qzbHBayXCJI3s70jStmS5f2LG/QpXf0utRyI2x/ivrMcOHLRp9gqrC6/+ECE3lMwcNRC PLo/N0TqopxcgEEuu7QVTYqGe2IwYbMR/DvrQfvFOFdOIG0adur9EA4L9CmnSNGifZnK 9NgMZ73tGHLp36IDcBeiwsXCexN3VfjTGmcAgtuORmc2s1JlOxJZ9m1woyPZNeMYcGmv aLoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uoJc9A5n; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h2si4220078pgq.310.2019.02.06.10.50.40; Wed, 06 Feb 2019 10:50:40 -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=@kernel.org header.s=default header.b=uoJc9A5n; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727714AbfBFSui (ORCPT + 31 others); Wed, 6 Feb 2019 13:50:38 -0500 Received: from mail.kernel.org ([198.145.29.99]:44878 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727673AbfBFSuh (ORCPT ); Wed, 6 Feb 2019 13:50:37 -0500 Received: from quaco.ghostprotocols.net (unknown [179.97.41.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CD380218D3; Wed, 6 Feb 2019 18:50:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549479035; bh=y1hJcwFfmM7GowVfJ/o6QbsDTQqNuGG8uGw2xjQ2wpo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uoJc9A5n7e3mOsJLHtlZ3RGftrFnl+9kRWCpTs7XbcKp5cHIxPNwCONyiG1W4ZwiJ xBnUCS3onjWxSX5HgUXkMXN5Zsz16qpphsgs7sG6T5JlCVS410pQE0fZVJvi6SDLi4 VcvfadMFekNHCh1hVhrGCD1HymtLvJdEu5YLyRac= From: Arnaldo Carvalho de Melo To: Ingo Molnar Cc: Jiri Olsa , Namhyung Kim , Clark Williams , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Mathieu Poirier , Suzuki K Poulouse , Adrian Hunter , Alexander Shishkin , Alexei Starovoitov , Greg Kroah-Hartman , "H . Peter Anvin" , Heiko Carstens , Jiri Olsa , Mark Rutland , Martin Schwidefsky , Peter Zijlstra , Thomas Gleixner , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-s390@vger.kernel.org, Arnaldo Carvalho de Melo Subject: [PATCH 25/53] perf coresight: Remove set_drv_config() API Date: Wed, 6 Feb 2019 15:48:35 -0300 Message-Id: <20190206184903.24054-26-acme@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190206184903.24054-1-acme@kernel.org> References: <20190206184903.24054-1-acme@kernel.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mathieu Poirier 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 Acked-by: Suzuki K Poulouse Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Alexei Starovoitov Cc: Greg Kroah-Hartman Cc: H. Peter Anvin Cc: Heiko Carstens Cc: Jiri Olsa Cc: Mark Rutland Cc: Martin Schwidefsky Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Will Deacon 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 --- 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.20.1 diff --git a/tools/perf/arch/arm/util/cs-etm.c b/tools/perf/arch/arm/util/cs-etm.c index 4f31cf0d1e6d..911426721170 100644 --- a/tools/perf/arch/arm/util/cs-etm.c +++ b/tools/perf/arch/arm/util/cs-etm.c @@ -27,9 +27,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; @@ -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; -} 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 64a677b518d0..bbc297a7e2e3 100644 --- a/tools/perf/arch/arm/util/pmu.c +++ b/tools/perf/arch/arm/util/pmu.c @@ -9,7 +9,6 @@ #include #include -#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);