Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp5169586ybi; Tue, 30 Jul 2019 15:18:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqy+A6uMr4VHLellnDjPfetzUvdt7eNyduXjXY8Hl1vlL4w/vm+0vzO/sZxGRtmjp/s8eodM X-Received: by 2002:a17:902:381:: with SMTP id d1mr114635936pld.331.1564525089941; Tue, 30 Jul 2019 15:18:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564525089; cv=none; d=google.com; s=arc-20160816; b=AYg0PYoIHeRH8oerIgLEXmgc0GnaSq1Ojytx9qoNmwBPEJi3rq2AOmSxP5mScoos84 RDNW0hW9v805XADkrgAPRP1JkmQfpsBYkMJU+TMLYj2IPVC5OYUShw0GFnYwlhQAlXkQ QPOMccpmxzxQn3Fxnl2R7MVXrYYSTJ3WYoDdQ3cErdukVra/ouPZBiXu5mSaFOnbU1XC Pofc4u7mJqUxWevkrNlA8qguAHCWTKARR0YMJY8fVUge28INc6NyAH3g6HlNv+3z9DVk Br5CN+EiiSeg2fuT9uEPvCQbhKio7sTPe4Y15/4GmCHE31wcT6BkGl4GKom3xhFBtzx8 lv5A== 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=+BB1SJcNU4L+JJkZfm+OeqH//qteO1BzhfAvtQCxHA0=; b=EYYCMsqqvLshZG+CbIpjU3N0BPWlTFFVSJlf2j45ZddmghQp9GY8oIKpHkG8Qs2RZr pfD/CSLkjFRx7RLoQASDLxQlzNpVlglxAxFUUJot7SpYLMYThIIAlEVs2k9YMGIbjILf cIhnqYXruV+tiol5sgCG1y25csstLeFaPcBGDv+O4Ok4/JL9Rt2qX3jy3k69yeFpI8I4 mogD2NiCsH4Nv9OOeHK9if7EF0YyBx898e2OVt1bynu11UZQNjRK7/VrOQo2fPNGZoSO pkszo+by4NcpEutVcsm+B7KNR3hhzDZh1e3vzfPFqEZ8SPINbaRr/7FdJtgotdwktO1m RScg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zytor.com header.s=2019071901 header.b="0oB6/df/"; 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 u9si31516364pgm.167.2019.07.30.15.17.54; Tue, 30 Jul 2019 15:18:09 -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="0oB6/df/"; 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 S2387767AbfG3Sn1 (ORCPT + 99 others); Tue, 30 Jul 2019 14:43:27 -0400 Received: from terminus.zytor.com ([198.137.202.136]:33523 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726165AbfG3Sn1 (ORCPT ); Tue, 30 Jul 2019 14:43:27 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id x6UIhGiA3332821 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 30 Jul 2019 11:43:16 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 terminus.zytor.com x6UIhGiA3332821 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2019071901; t=1564512197; bh=+BB1SJcNU4L+JJkZfm+OeqH//qteO1BzhfAvtQCxHA0=; h=Date:From:Cc:Reply-To:In-Reply-To:References:To:Subject:From; b=0oB6/df/BM0KgeedAaWP1IUfBvoyWWjqXZsRae1RyjpqxZEXH9QH/6hRkjqCltCVt yZ45RF7Ux7g/Tk5NhjOobfU9Y0OJiCddTFbYuvD74cZOSf0gsdCcV3HM56u2igaic9 SVNJJRh4dNoVYTaz0HncoTXVQ19MBToEjp9tEY2TzCFn4wOpmL9CdxW30zL5ADu7CQ qizJqJJYVEKdUPPD6IE3s51hJEuuLc1d6sj80YqEB2o9ON0Mmi3ZiLoZEnSrvIzv1t XsfghncGAcyOiWRKDaLBCfSVHghhFa6krR0Z/HyZplgo4x7iw5F67s4PXUkrc3IG/0 XRmLMH0dBp2gQ== Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id x6UIhFAW3332818; Tue, 30 Jul 2019 11:43:15 -0700 Date: Tue, 30 Jul 2019 11:43:15 -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: namhyung@kernel.org, linux-kernel@vger.kernel.org, acme@redhat.com, alexander.shishkin@linux.intel.com, jolsa@kernel.org, tglx@linutronix.de, peterz@infradead.org, mingo@kernel.org, ak@linux.intel.com, mpetlan@redhat.com, hpa@zytor.com, alexey.budankov@linux.intel.com Reply-To: alexander.shishkin@linux.intel.com, jolsa@kernel.org, tglx@linutronix.de, namhyung@kernel.org, linux-kernel@vger.kernel.org, acme@redhat.com, alexey.budankov@linux.intel.com, mingo@kernel.org, peterz@infradead.org, ak@linux.intel.com, mpetlan@redhat.com, hpa@zytor.com In-Reply-To: <20190721112506.12306-49-jolsa@kernel.org> References: <20190721112506.12306-49-jolsa@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] libperf: Add perf_evlist__delete() function Git-Commit-ID: 57f0c3b6e13ae822ba02dd37563c8e6956a47141 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: 57f0c3b6e13ae822ba02dd37563c8e6956a47141 Gitweb: https://git.kernel.org/tip/57f0c3b6e13ae822ba02dd37563c8e6956a47141 Author: Jiri Olsa AuthorDate: Sun, 21 Jul 2019 13:24:35 +0200 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 29 Jul 2019 18:34:45 -0300 libperf: Add perf_evlist__delete() function Add the perf_evlist__delete() function to delete a perf_evlist 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-49-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/lib/evlist.c | 6 ++++++ tools/perf/lib/include/perf/evlist.h | 1 + tools/perf/lib/libperf.map | 1 + 3 files changed, 8 insertions(+) diff --git a/tools/perf/lib/evlist.c b/tools/perf/lib/evlist.c index 979ee423490f..087ef76ea8fd 100644 --- a/tools/perf/lib/evlist.c +++ b/tools/perf/lib/evlist.c @@ -4,6 +4,7 @@ #include #include #include +#include void perf_evlist__init(struct perf_evlist *evlist) { @@ -54,3 +55,8 @@ perf_evlist__next(struct perf_evlist *evlist, struct perf_evsel *prev) return next; } + +void perf_evlist__delete(struct perf_evlist *evlist) +{ + free(evlist); +} diff --git a/tools/perf/lib/include/perf/evlist.h b/tools/perf/lib/include/perf/evlist.h index 5092b622935b..9a126fd0773c 100644 --- a/tools/perf/lib/include/perf/evlist.h +++ b/tools/perf/lib/include/perf/evlist.h @@ -13,6 +13,7 @@ LIBPERF_API void perf_evlist__add(struct perf_evlist *evlist, LIBPERF_API void perf_evlist__remove(struct perf_evlist *evlist, struct perf_evsel *evsel); LIBPERF_API struct perf_evlist *perf_evlist__new(void); +LIBPERF_API void perf_evlist__delete(struct perf_evlist *evlist); LIBPERF_API struct perf_evsel* perf_evlist__next(struct perf_evlist *evlist, struct perf_evsel *evsel); diff --git a/tools/perf/lib/libperf.map b/tools/perf/lib/libperf.map index c0968226f7b6..153e77cd6739 100644 --- a/tools/perf/lib/libperf.map +++ b/tools/perf/lib/libperf.map @@ -14,6 +14,7 @@ LIBPERF_0.0.1 { perf_evsel__new; perf_evsel__init; perf_evlist__new; + perf_evlist__delete; perf_evlist__init; perf_evlist__add; perf_evlist__remove;