Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1378784 > unrolled thread

[PATCH 06/11] perf session: Make ordered_events reusable

Started byArnaldo Carvalho de Melo <acme@kernel.org>
First post2016-04-14 14:40 +0200
Last post2016-04-14 14:40 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 06/11] perf session: Make ordered_events reusable Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-04-14 14:40 +0200

#1378784 — [PATCH 06/11] perf session: Make ordered_events reusable

FromArnaldo Carvalho de Melo <acme@kernel.org>
Date2016-04-14 14:40 +0200
Subject[PATCH 06/11] perf session: Make ordered_events reusable
Message-ID<rnOIV-1Cp-13@gated-at.bofh.it>
From: Wang Nan <wangnan0@huawei.com>

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 <wangnan0@huawei.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/1460535673-159866-2-git-send-email-wangnan0@huawei.com
Signed-off-by: He Kuang <hekuang@huawei.com>
[ Split from larger patch ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 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 91d4528d71fa..ca1827c4af4a 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;
-- 
2.5.5

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web