Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp5877806ybi; Sun, 21 Jul 2019 04:31:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqz9cRAzB1xO6LGlX5GAESgl61dQuY2bPpY8aMY/0bIdqWsCed2GM2aeJyyfC6pzGH/2/IOG X-Received: by 2002:a63:1a03:: with SMTP id a3mr62772016pga.397.1563708671140; Sun, 21 Jul 2019 04:31:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563708671; cv=none; d=google.com; s=arc-20160816; b=Sm0iYu1/7sjapkfvXrB9Frzpp3SwtEX6E8DW28q9i6YsqH8LhrlIdDs9/pgVsyM1IY S7V4lHjbWbH805sVcEkqO/5PJGph6NwJSiCJE0Ft6Utu32i4WDrHQ7C+7GOtKKG/KhZB 6tXUPwy4KlLDRdDS9kmErH8sPmg4/iNLBPMSQzzPIwT9Crs9/1mRf3pue3V7Y8FhU+aS 68CoRlyIaqDGxxlVi4ijuKqzbv/ySY3v61K3Rykg3YiCjUXq5MYiS+5N0yIHGCFeQC93 SPqMhBDfEoNv/zFzWES8vm0+jKKcviG4DtW7J3cFCSc6CLX928TVc9OkFI+zaJZNqi5J zB4Q== 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; bh=IlsKI2Lwx1KfV+3iRq/DOWZIT8rk5MYYluE8FCMyOvg=; b=vIN/+vEe4SyhjImAIVkk3yTOq1gnO3qH2LhS0YsAeqlVLO0XgAuZT/afZxPiCINpEC ojjDtyz8vCfEN18fzXrAa73iHmZnDuqmSi6jsJb7iSdzEG1zq3Houz5k3vvp+Wr4moEm MLlcChXZnMinpvpMug9AaeRyyizdczoUKs1/NtlLWLCSeQ5GJ/sfPgEO03UpzEHOrNjj FDV+beOU6AWkAay2aSDxmi3dgqMGI9ZcP9VN7HGNrlpRm7uKt2O9rXUnP3IZPquhG4nv DEbUfix1zZieSv4h9xh9LwgbQ7/Oc+wydSG0ds1mXPdY8Ic9xPhveFhG2+A8ficYQJCl Dtdw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (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 32si7203194pgm.409.2019.07.21.04.30.55; Sun, 21 Jul 2019 04:31:11 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726801AbfGUL3m (ORCPT + 99 others); Sun, 21 Jul 2019 07:29:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43480 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726262AbfGUL3l (ORCPT ); Sun, 21 Jul 2019 07:29:41 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CD451308429D; Sun, 21 Jul 2019 11:29:40 +0000 (UTC) Received: from krava.redhat.com (ovpn-204-23.brq.redhat.com [10.40.204.23]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8120C5D9D3; Sun, 21 Jul 2019 11:29:36 +0000 (UTC) From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: lkml , Ingo Molnar , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Andi Kleen , Alexey Budankov , Michael Petlan Subject: [PATCH 39/79] libperf: Add perf_evlist__add function Date: Sun, 21 Jul 2019 13:24:26 +0200 Message-Id: <20190721112506.12306-40-jolsa@kernel.org> In-Reply-To: <20190721112506.12306-1-jolsa@kernel.org> References: <20190721112506.12306-1-jolsa@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Sun, 21 Jul 2019 11:29:41 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Adding perf_evlist__add function to add perf_evsel in perf_evlist struct. Link: http://lkml.kernel.org/n/tip-pnfovrqcgxquioroelzfzb57@git.kernel.org Signed-off-by: Jiri Olsa --- 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 aacddd9b2d64..ea25c7b49a4c 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; -- 2.21.0