Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp5004838ybi; Tue, 30 Jul 2019 12:01:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqzob09Qqb8cezMuC3yqtTcl0aF6CRMpjxdZxO5Z1YiWCoCpVy0tvBXFBd+aeeEa9yEwRxCe X-Received: by 2002:a17:902:1003:: with SMTP id b3mr57210038pla.172.1564513308736; Tue, 30 Jul 2019 12:01:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564513308; cv=none; d=google.com; s=arc-20160816; b=GRd6Sryj6D0srWXBCxoG44sSl8BrVsrC18K11QB7BGXkF2RTFs0XZSqSb/cKBrU3mJ QcCbIJi20I1oVbpjSn7LGV80XuoOrg1kWj9kBx5mJE4o2PynoX7hQMgFZKYhhbNM/VHm Xh5Bl7rjl8E5PRjvGOeUDfKG+SGAuWvDITKUY7PrKYoyQKZFHVjMaY+sGZTTuXiYsi1y 5r3Ny+PVxUdx0G6s1/9VtQvdlFnT8wExgkPUtc9jKz0inVrCb/7yIvBCvAdp4l/FaFhR gpeD/uwW2P5eA688V9Fii1txHfQUpHEij+7ZH06XNtX4oPcPUhYlhU8/KuqM24lCjuCd QPXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:dkim-signature:dkim-filter; bh=2rUDSYIIBiJ0PM97+S+pkNehnoJe9/BPB3d86sVW1os=; b=l27k6ihgAmVzaz59FP/BFcAFaVg/VSvR4MaEBlxSAzJ9QNDIIp50R5AvwjHleEMPhI Ht6x2BKQe/QOVZFmAERuCQtG9sN8wypPL/Ds6v2V0nXHQXLQWuQmOWljOmfYFpCf1OAD LFpzo9DURUWWhU0uWu8EZ7zpx5Pwd5g47oGLSjpZuSZf68QSIQ1jzRl0wLeZTYn7N+Fr 40nSvQXkX9+RGJKUD1m7ZYEY4bUvBqw+TZjGkcP/lHfux2M36J+UYpW76UFSGalAjLvD CyJjWSW0cneN14flYWDEUtstHmpQmxrgsVqFcCGvgwZltP8uk6rIe7wvAZ2iCv0KyOjL np9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zytor.com header.s=2019071901 header.b=eIwwbCLJ; 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=zytor.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p93si26888966pjp.66.2019.07.30.12.01.32; Tue, 30 Jul 2019 12:01:48 -0700 (PDT) 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=@zytor.com header.s=2019071901 header.b=eIwwbCLJ; 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=zytor.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388496AbfG3TAQ (ORCPT + 99 others); Tue, 30 Jul 2019 15:00:16 -0400 Received: from terminus.zytor.com ([198.137.202.136]:45431 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388059AbfG3TAQ (ORCPT ); Tue, 30 Jul 2019 15:00:16 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id x6UJ05Ya3337437 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 30 Jul 2019 12:00:05 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 terminus.zytor.com x6UJ05Ya3337437 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2019071901; t=1564513206; bh=2rUDSYIIBiJ0PM97+S+pkNehnoJe9/BPB3d86sVW1os=; h=Date:From:Cc:Reply-To:In-Reply-To:References:To:Subject:From; b=eIwwbCLJU1qquaxfhqotIf5HZN1rXsXWrpIP27f2vGJZywBDOVAJY4E4MyaZ7ohF6 UTNFHTmRemTbh8bSzPP+Ux2yp9rOGw09juE0pA+lHiYEvXrxMHpg7GGCyImmqFt19K +UC0pzFCm7BKySFXi/kgZvJSznYnS2g0qhcfUEBjVFqf3YyxG9c1suO9GJTWcg7x6X 0ZL3QHBIVmhI8qfZz1/Ce1QVR5kYsWVbq4M9zmbFDd0peymjFOgeSCr/MlSZc4/XI+ onIip1s9NCIhgzMeNbm8vTwUsl8hofRSGcwWj0Jesnk/cS6qZQkZRQm0psItcjEg8n P6rk9e9QP+Yyw== Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id x6UJ03573337432; Tue, 30 Jul 2019 12:00:03 -0700 Date: Tue, 30 Jul 2019 12:00:03 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Jiri Olsa Message-ID: Cc: mingo@kernel.org, hpa@zytor.com, namhyung@kernel.org, peterz@infradead.org, acme@redhat.com, mpetlan@redhat.com, alexey.budankov@linux.intel.com, jolsa@kernel.org, ak@linux.intel.com, alexander.shishkin@linux.intel.com, linux-kernel@vger.kernel.org, tglx@linutronix.de Reply-To: ak@linux.intel.com, alexander.shishkin@linux.intel.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, mingo@kernel.org, hpa@zytor.com, namhyung@kernel.org, peterz@infradead.org, acme@redhat.com, alexey.budankov@linux.intel.com, mpetlan@redhat.com, jolsa@kernel.org In-Reply-To: <20190721112506.12306-71-jolsa@kernel.org> References: <20190721112506.12306-71-jolsa@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] libperf: Add perf_evsel__attr() function Git-Commit-ID: 384c4ad192a01fe235c7ac9e9fd8605d12a807e8 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-0.2 required=5.0 tests=ALL_TRUSTED,BAYES_00, DATE_IN_FUTURE_96_Q,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 384c4ad192a01fe235c7ac9e9fd8605d12a807e8 Gitweb: https://git.kernel.org/tip/384c4ad192a01fe235c7ac9e9fd8605d12a807e8 Author: Jiri Olsa AuthorDate: Sun, 21 Jul 2019 13:24:57 +0200 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 29 Jul 2019 18:34:46 -0300 libperf: Add perf_evsel__attr() function Add a perf_evsel__attr() function to get attr pointer from a perf_evsel instance. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Alexey Budankov Cc: Andi Kleen Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20190721112506.12306-71-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/lib/evsel.c | 5 +++++ tools/perf/lib/include/perf/evsel.h | 1 + tools/perf/lib/libperf.map | 1 + 3 files changed, 7 insertions(+) diff --git a/tools/perf/lib/evsel.c b/tools/perf/lib/evsel.c index 8dbe0e841b8f..24abc80dd767 100644 --- a/tools/perf/lib/evsel.c +++ b/tools/perf/lib/evsel.c @@ -225,3 +225,8 @@ struct perf_thread_map *perf_evsel__threads(struct perf_evsel *evsel) { return evsel->threads; } + +struct perf_event_attr *perf_evsel__attr(struct perf_evsel *evsel) +{ + return &evsel->attr; +} diff --git a/tools/perf/lib/include/perf/evsel.h b/tools/perf/lib/include/perf/evsel.h index ae9f7eeb53a2..4388667f265c 100644 --- a/tools/perf/lib/include/perf/evsel.h +++ b/tools/perf/lib/include/perf/evsel.h @@ -34,5 +34,6 @@ LIBPERF_API int perf_evsel__enable(struct perf_evsel *evsel); LIBPERF_API int perf_evsel__disable(struct perf_evsel *evsel); LIBPERF_API struct perf_cpu_map *perf_evsel__cpus(struct perf_evsel *evsel); LIBPERF_API struct perf_thread_map *perf_evsel__threads(struct perf_evsel *evsel); +LIBPERF_API struct perf_event_attr *perf_evsel__attr(struct perf_evsel *evsel); #endif /* __LIBPERF_EVSEL_H */ diff --git a/tools/perf/lib/libperf.map b/tools/perf/lib/libperf.map index 2068e3d52227..e24d3cec01c1 100644 --- a/tools/perf/lib/libperf.map +++ b/tools/perf/lib/libperf.map @@ -23,6 +23,7 @@ LIBPERF_0.0.1 { perf_evsel__read; perf_evsel__cpus; perf_evsel__threads; + perf_evsel__attr; perf_evlist__new; perf_evlist__delete; perf_evlist__open;