Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755745AbcDNNfl (ORCPT ); Thu, 14 Apr 2016 09:35:41 -0400 Received: from terminus.zytor.com ([198.137.202.10]:55576 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755586AbcDNNfk (ORCPT ); Thu, 14 Apr 2016 09:35:40 -0400 Date: Thu, 14 Apr 2016 06:35:23 -0700 From: tip-bot for Wang Nan Message-ID: Cc: hpa@zytor.com, namhyung@kernel.org, lizefan@huawei.com, jolsa@kernel.org, acme@redhat.com, hekuang@huawei.com, linux-kernel@vger.kernel.org, mhiramat@kernel.org, tglx@linutronix.de, wangnan0@huawei.com, mingo@kernel.org Reply-To: namhyung@kernel.org, hpa@zytor.com, mingo@kernel.org, tglx@linutronix.de, wangnan0@huawei.com, linux-kernel@vger.kernel.org, mhiramat@kernel.org, hekuang@huawei.com, acme@redhat.com, jolsa@kernel.org, lizefan@huawei.com In-Reply-To: <1460535673-159866-2-git-send-email-wangnan0@huawei.com> References: <1460535673-159866-2-git-send-email-wangnan0@huawei.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf ordered_events: Introduce reinit() Git-Commit-ID: 4532f642974d871f9a50e9a09bc482eaed5394f6 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 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2156 Lines: 55 Commit-ID: 4532f642974d871f9a50e9a09bc482eaed5394f6 Gitweb: http://git.kernel.org/tip/4532f642974d871f9a50e9a09bc482eaed5394f6 Author: Wang Nan AuthorDate: Wed, 13 Apr 2016 08:21:04 +0000 Committer: Arnaldo Carvalho de Melo CommitDate: Thu, 14 Apr 2016 08:57:54 -0300 perf ordered_events: Introduce reinit() 'perf record' will use this when outputting multiple perf.data files. Signed-off-by: Wang Nan Cc: Jiri Olsa Cc: Masami Hiramatsu Cc: Namhyung Kim Cc: Zefan Li Cc: pi3orama@163.com Link: http://lkml.kernel.org/r/1460535673-159866-2-git-send-email-wangnan0@huawei.com Signed-off-by: He Kuang [ Split from larger patch ] Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/ordered-events.c | 9 +++++++++ tools/perf/util/ordered-events.h | 1 + 2 files changed, 10 insertions(+) diff --git a/tools/perf/util/ordered-events.c b/tools/perf/util/ordered-events.c index b1b9e23..fe84df1 100644 --- a/tools/perf/util/ordered-events.c +++ b/tools/perf/util/ordered-events.c @@ -308,3 +308,12 @@ void ordered_events__free(struct ordered_events *oe) free(event); } } + +void ordered_events__reinit(struct ordered_events *oe) +{ + ordered_events__deliver_t old_deliver = oe->deliver; + + ordered_events__free(oe); + memset(oe, '\0', sizeof(*oe)); + ordered_events__init(oe, old_deliver); +} diff --git a/tools/perf/util/ordered-events.h b/tools/perf/util/ordered-events.h index f403991..e11468a 100644 --- a/tools/perf/util/ordered-events.h +++ b/tools/perf/util/ordered-events.h @@ -49,6 +49,7 @@ void ordered_events__delete(struct ordered_events *oe, struct ordered_event *eve int ordered_events__flush(struct ordered_events *oe, enum oe_flush how); void ordered_events__init(struct ordered_events *oe, ordered_events__deliver_t deliver); void ordered_events__free(struct ordered_events *oe); +void ordered_events__reinit(struct ordered_events *oe); static inline void ordered_events__set_alloc_size(struct ordered_events *oe, u64 size)