Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755777AbcDNNgD (ORCPT ); Thu, 14 Apr 2016 09:36:03 -0400 Received: from terminus.zytor.com ([198.137.202.10]:55606 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755693AbcDNNgB (ORCPT ); Thu, 14 Apr 2016 09:36:01 -0400 Date: Thu, 14 Apr 2016 06:35:46 -0700 From: tip-bot for Wang Nan Message-ID: Cc: tglx@linutronix.de, linux-kernel@vger.kernel.org, acme@redhat.com, mhiramat@kernel.org, namhyung@kernel.org, jolsa@kernel.org, hpa@zytor.com, lizefan@huawei.com, wangnan0@huawei.com, mingo@kernel.org, hekuang@huawei.com Reply-To: hpa@zytor.com, wangnan0@huawei.com, lizefan@huawei.com, mingo@kernel.org, hekuang@huawei.com, namhyung@kernel.org, jolsa@kernel.org, acme@redhat.com, linux-kernel@vger.kernel.org, mhiramat@kernel.org, tglx@linutronix.de 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 session: Make ordered_events reusable Git-Commit-ID: b26dc73018d2e3a68cad0cf0bad902a8637f9bdf 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: 1713 Lines: 47 Commit-ID: b26dc73018d2e3a68cad0cf0bad902a8637f9bdf Gitweb: http://git.kernel.org/tip/b26dc73018d2e3a68cad0cf0bad902a8637f9bdf 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 session: Make ordered_events reusable ordered_events__free() leaves linked lists and timestamps not cleared, so unable to be reused after ordered_events__free(). Which is inconvenient after 'perf record' supports generating multiple perf.data output and process build-ids for each of them. Use ordered_events__reinit() for this. 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/session.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index 91d4528..ca1827c 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c @@ -1836,7 +1836,11 @@ out: out_err: ui_progress__finish(); perf_session__warn_about_errors(session); - ordered_events__free(&session->ordered_events); + /* + * We may switching perf.data output, make ordered_events + * reusable. + */ + ordered_events__reinit(&session->ordered_events); auxtrace__free_events(session); session->one_mmap = false; return err;