Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp5116208ybi; Tue, 30 Jul 2019 14:08:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqyEc1CevtIhDaqZw1WK3IMnfkhJ130pP8Gi9pWOfIRs7AGYvjBuQ1h52H+W3LSweoGyZON+ X-Received: by 2002:a63:1310:: with SMTP id i16mr109144141pgl.187.1564520881813; Tue, 30 Jul 2019 14:08:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564520881; cv=none; d=google.com; s=arc-20160816; b=MOc4/DxyJxqWhRzK2HLfBOt8mlz4vSkDSaraOweEBQpo9GdBDOTJ79aVXo+LEtHWt/ +cWFeHW8S/B6h4vPjsXIZWpdN/L9c2dkPveirFydyvxuDQ0rUNWPh07DoirX0+yQL/R9 kGSpTByFCUNxzz5sdEuoLl9Dw8kabfprXucNmDMsNvbsM94DgBCHdg6i91KYNNkIIO2o r82HiajeRbsRdiGMRxPtuUNqyWDHm5x2XAH1UVOd3p6ARw2hm1ZH2WKWyHTHqMepht/W 3rHvVqucJWR7omWqV8qe20M3kXT764fXMU+/7mtda9ZvDF/7ljfeKfJ6oSMgF35HmJFy g50w== 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=71BJRIeDOD8zMMqkymlqadd5jaWx+y1t5a2f9WJfDHc=; b=BNOEaGRNyfxQvHz19N/cxM8nmBkxTklL52xpydWk4+tmbmg494HyB40Oe2KoSaUnHr Fy9AUyiEpu53tn0ZbRUF4iL4/oiX0E1kPA48afHV7C6DHl800Nxq5Zir1PvCqiyPiXVw bityPJcq6BkEKP4uHX8hAlHNE0q1F1kC4zKaEZBRq5xC3fQqpq9whQpInYzZ7xms+7Tn qDhVjYZyr4Fee+x/b6AA44MnquHUbkzt3qWVGQRTicVh9x9aI+uN4MR6aZljobPH77Xz AKh85seCYJ9Elk0RVFEKr9HRuj04W75z5AdsbSK2+MWkwVFPW87Z1EOEaVv+/s/Xja0a zQmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zytor.com header.s=2019071901 header.b="Fd6/N3+e"; 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 w15si643391ply.127.2019.07.30.14.07.46; Tue, 30 Jul 2019 14:08:01 -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="Fd6/N3+e"; 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 S1729894AbfG3SfI (ORCPT + 99 others); Tue, 30 Jul 2019 14:35:08 -0400 Received: from terminus.zytor.com ([198.137.202.136]:52091 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726050AbfG3SfG (ORCPT ); Tue, 30 Jul 2019 14:35:06 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id x6UIYrYp3331187 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 30 Jul 2019 11:34:54 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 terminus.zytor.com x6UIYrYp3331187 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2019071901; t=1564511694; bh=71BJRIeDOD8zMMqkymlqadd5jaWx+y1t5a2f9WJfDHc=; h=Date:From:Cc:Reply-To:In-Reply-To:References:To:Subject:From; b=Fd6/N3+euIJsIxUFQ49HmzAlseA+P0mAY39SOCSnAEJHcifppNBw67j/7AGGTaRxB pe/N/Ib0f4RABjWHvngsBzJEJJi9PAvgd2PSklE+u8CN4AabT5YUnjzCuUdXf/DOjx o1HZipn8MPBuLT/omAH56xuLIQY4Cnl5eRqyU06Cqo+BE55uzVzP6G3V4lGjIYjoDk lieqMlkk/BtnmRTOE95qw0/hb6Ji97V7nLEHCVZrAkAix58xzf0eGO+eQ1n/mOSzCx d8YFt4P+w8pjbMjqbrPTfNiby/qVdR+tcUV4r716BXwtB0AJ7PQ6axa4qrKWAea/ld NvXMtSsDHsZTg== Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id x6UIYr0s3331184; Tue, 30 Jul 2019 11:34:53 -0700 Date: Tue, 30 Jul 2019 11:34:53 -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, mpetlan@redhat.com, alexey.budankov@linux.intel.com, tglx@linutronix.de, alexander.shishkin@linux.intel.com, jolsa@kernel.org, hpa@zytor.com, ak@linux.intel.com, linux-kernel@vger.kernel.org, acme@redhat.com, peterz@infradead.org, namhyung@kernel.org Reply-To: mingo@kernel.org, alexey.budankov@linux.intel.com, mpetlan@redhat.com, tglx@linutronix.de, alexander.shishkin@linux.intel.com, jolsa@kernel.org, hpa@zytor.com, ak@linux.intel.com, linux-kernel@vger.kernel.org, acme@redhat.com, peterz@infradead.org, namhyung@kernel.org In-Reply-To: <20190721112506.12306-38-jolsa@kernel.org> References: <20190721112506.12306-38-jolsa@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] libperf: Add perf_evsel__init function Git-Commit-ID: b04c597af761ccfd32f40ee3629843b6f3674fce 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: b04c597af761ccfd32f40ee3629843b6f3674fce Gitweb: https://git.kernel.org/tip/b04c597af761ccfd32f40ee3629843b6f3674fce Author: Jiri Olsa AuthorDate: Sun, 21 Jul 2019 13:24:24 +0200 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 29 Jul 2019 18:34:44 -0300 libperf: Add perf_evsel__init function Add the perf_evsel__init() function to initialize perf_evsel 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-38-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/lib/evsel.c | 5 +++++ tools/perf/lib/include/perf/evsel.h | 4 ++++ tools/perf/lib/libperf.map | 1 + tools/perf/util/evsel.c | 3 ++- 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/tools/perf/lib/evsel.c b/tools/perf/lib/evsel.c index 12e86de1994b..9a87e867a7ec 100644 --- a/tools/perf/lib/evsel.c +++ b/tools/perf/lib/evsel.c @@ -2,3 +2,8 @@ #include #include #include + +void perf_evsel__init(struct perf_evsel *evsel) +{ + INIT_LIST_HEAD(&evsel->node); +} diff --git a/tools/perf/lib/include/perf/evsel.h b/tools/perf/lib/include/perf/evsel.h index 162bffd43409..b4d074a3684b 100644 --- a/tools/perf/lib/include/perf/evsel.h +++ b/tools/perf/lib/include/perf/evsel.h @@ -2,6 +2,10 @@ #ifndef __LIBPERF_EVSEL_H #define __LIBPERF_EVSEL_H +#include + struct perf_evsel; +LIBPERF_API void perf_evsel__init(struct perf_evsel *evsel); + #endif /* __LIBPERF_EVSEL_H */ diff --git a/tools/perf/lib/libperf.map b/tools/perf/lib/libperf.map index c4f611010ccc..54f8503c6d82 100644 --- a/tools/perf/lib/libperf.map +++ b/tools/perf/lib/libperf.map @@ -9,6 +9,7 @@ LIBPERF_0.0.1 { perf_thread_map__comm; perf_thread_map__get; perf_thread_map__put; + perf_evsel__init; local: *; }; diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index 8fed22d889a4..172bcc2e198f 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -22,6 +22,7 @@ #include #include #include +#include #include "asm/bug.h" #include "callchain.h" #include "cgroup.h" @@ -226,6 +227,7 @@ bool perf_evsel__is_function_event(struct evsel *evsel) void evsel__init(struct evsel *evsel, struct perf_event_attr *attr, int idx) { + perf_evsel__init(&evsel->core); evsel->idx = idx; evsel->tracking = !idx; evsel->attr = *attr; @@ -236,7 +238,6 @@ void evsel__init(struct evsel *evsel, evsel->evlist = NULL; evsel->bpf_obj = NULL; evsel->bpf_fd = -1; - INIT_LIST_HEAD(&evsel->core.node); INIT_LIST_HEAD(&evsel->config_terms); perf_evsel__object.init(evsel); evsel->sample_size = __perf_evsel__sample_size(attr->sample_type);