Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp5168014ybi; Tue, 30 Jul 2019 15:16:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqwhcR9cHd07wHikcLhBSN+PT1N2Y+AXi4ynIjgk0pdEz6HHOU9i2k29FjJE/mGBBUOtWyrd X-Received: by 2002:aa7:9210:: with SMTP id 16mr45295484pfo.11.1564524972562; Tue, 30 Jul 2019 15:16:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564524972; cv=none; d=google.com; s=arc-20160816; b=05ga+gabzA+AiiQ9UIRbg+ZDfvmHtemmhxStz19EesEzTLEfh4UBxKaSJIo0nBiVqB AFSNjEGajSXATPGIVV94oGXGMdNPAcBb1S7QH9qqBaUPXDzwptgrLPh+6UcA66M+3CqG QeY96czwomIEuRRQ1AaKXdo22tvBEaadZ8RjRA14Q2CzVmvixOb7cyd7fw6axv+HzqoT yF2xYg99oyXu6EbKQH2hIgZepe7Y4PejrS2O8+O2QUSZrIGu2iCmWNarE+Z3qCXMfMK3 lTgl8sz0KUk+RnnzY4kHHf4w0UbwG7KoCLVhhnt7hyJWaFSHEaQlL7JAsQ/9/Bycg4pq CFSg== 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=bLje3VanhU+Dzk38KDoi83r8huN6l0y6UjtRHV8ZWHw=; b=rgSgdkSASco1GoVeijqKnkUlTBMhP+zvIYDnwzgfY8MO0kNEH7k6kvH7stPhCDmfUd FJpCc+t776lj1Ee7p/pRufGQHGKow9ketvGR+Q8ppUYq2HANlgEoL9iquynFvgEdTrWp UefBgqQNgFE87z2tMWGp96GvYRiFTLjPR+ubngzZatFF3AVNWGXJW7ZLdjPMLNqgyQj5 akYS0Axvf3z2g2pwMYxNF/ZryiP5ZPqlKXFXKFq+M5WMVKl4StKK+gsv4f+XIqYI6xJj COwMP5WTTRsVbU45ohH5+5vlvFNEwWWUqQyK/v2cg/pgQ6yDrmcsjQao5CENgmS9LWXk IfTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zytor.com header.s=2019071901 header.b=zkF2J58s; 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 60si28244373plf.398.2019.07.30.15.15.57; Tue, 30 Jul 2019 15:16:12 -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=zkF2J58s; 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 S1729963AbfG3Shj (ORCPT + 99 others); Tue, 30 Jul 2019 14:37:39 -0400 Received: from terminus.zytor.com ([198.137.202.136]:53785 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726165AbfG3Shj (ORCPT ); Tue, 30 Jul 2019 14:37:39 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id x6UIaSk83331622 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 30 Jul 2019 11:36:28 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 terminus.zytor.com x6UIaSk83331622 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2019071901; t=1564511788; bh=bLje3VanhU+Dzk38KDoi83r8huN6l0y6UjtRHV8ZWHw=; h=Date:From:Cc:Reply-To:In-Reply-To:References:To:Subject:From; b=zkF2J58srw9YZ0qR7a8jNAutBiP9q37Z/xQpqr1UcS6azxOkQ8eV9/LQ4CwFHCInA twbadyK3qzD4P8CTLb2J2ROovm3aonzx00VP9Jz4x5VuNHxGFCA/lmObnSwV6rjjEN kPld66WKP0lN6DZ5VKqotbdeS/E7rbmxvS068yppt8eF9fWWU7OLDMZzZN3h94o2wx BawdI+ovsAlDkDbr7Fy2ku7QF3is88s/QYsA1HCq8My+4fCSREpyq1OP7j9tjjZzJS PDFJA0qN/zVjhyDuxqrlR+3sn5bPZdYpW/Iz6M0NQy6iSIgNfECKhGfseJ6qDEjCQB Hvctksb2ZJ64A== Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id x6UIaR113331619; Tue, 30 Jul 2019 11:36:27 -0700 Date: Tue, 30 Jul 2019 11:36:27 -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: acme@redhat.com, hpa@zytor.com, namhyung@kernel.org, mpetlan@redhat.com, tglx@linutronix.de, mingo@kernel.org, peterz@infradead.org, ak@linux.intel.com, alexey.budankov@linux.intel.com, alexander.shishkin@linux.intel.com, linux-kernel@vger.kernel.org, jolsa@kernel.org Reply-To: linux-kernel@vger.kernel.org, jolsa@kernel.org, alexander.shishkin@linux.intel.com, alexey.budankov@linux.intel.com, peterz@infradead.org, ak@linux.intel.com, mingo@kernel.org, mpetlan@redhat.com, tglx@linutronix.de, hpa@zytor.com, namhyung@kernel.org, acme@redhat.com In-Reply-To: <20190721112506.12306-40-jolsa@kernel.org> References: <20190721112506.12306-40-jolsa@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] libperf: Add perf_evlist__add() function Git-Commit-ID: 9a5edde6d3a6fb26101406534f7a5d09a9fcd362 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: 9a5edde6d3a6fb26101406534f7a5d09a9fcd362 Gitweb: https://git.kernel.org/tip/9a5edde6d3a6fb26101406534f7a5d09a9fcd362 Author: Jiri Olsa AuthorDate: Sun, 21 Jul 2019 13:24:26 +0200 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 29 Jul 2019 18:34:44 -0300 libperf: Add perf_evlist__add() function Add the perf_evlist__add() function to add a perf_evsel in a perf_evlist struct. 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-40-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/lib/evlist.c | 7 +++++++ tools/perf/lib/include/perf/evlist.h | 3 +++ tools/perf/lib/libperf.map | 1 + tools/perf/util/evlist.c | 2 +- 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/tools/perf/lib/evlist.c b/tools/perf/lib/evlist.c index fdc8c1894b37..e5f187fa4e57 100644 --- a/tools/perf/lib/evlist.c +++ b/tools/perf/lib/evlist.c @@ -2,8 +2,15 @@ #include #include #include +#include void perf_evlist__init(struct perf_evlist *evlist) { INIT_LIST_HEAD(&evlist->entries); } + +void perf_evlist__add(struct perf_evlist *evlist, + struct perf_evsel *evsel) +{ + list_add_tail(&evsel->node, &evlist->entries); +} diff --git a/tools/perf/lib/include/perf/evlist.h b/tools/perf/lib/include/perf/evlist.h index 1ddfcca0bd01..6992568b14a0 100644 --- a/tools/perf/lib/include/perf/evlist.h +++ b/tools/perf/lib/include/perf/evlist.h @@ -5,7 +5,10 @@ #include struct perf_evlist; +struct perf_evsel; LIBPERF_API void perf_evlist__init(struct perf_evlist *evlist); +LIBPERF_API void perf_evlist__add(struct perf_evlist *evlist, + struct perf_evsel *evsel); #endif /* __LIBPERF_EVLIST_H */ diff --git a/tools/perf/lib/libperf.map b/tools/perf/lib/libperf.map index 5ca6ff6fcdfa..06ccf31eb24d 100644 --- a/tools/perf/lib/libperf.map +++ b/tools/perf/lib/libperf.map @@ -11,6 +11,7 @@ LIBPERF_0.0.1 { perf_thread_map__put; perf_evsel__init; perf_evlist__init; + perf_evlist__add; local: *; }; diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index f4aa6cf80559..f2b86f49ab8d 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c @@ -180,8 +180,8 @@ static void perf_evlist__propagate_maps(struct evlist *evlist) void evlist__add(struct evlist *evlist, struct evsel *entry) { + perf_evlist__add(&evlist->core, &entry->core); entry->evlist = evlist; - list_add_tail(&entry->core.node, &evlist->core.entries); entry->idx = evlist->nr_entries; entry->tracking = !entry->idx;