Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1338128 > unrolled thread
| Started by | Wang Nan <wangnan0@huawei.com> |
|---|---|
| First post | 2016-02-19 13:10 +0100 |
| Last post | 2016-02-19 13:10 +0100 |
| 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.
[PATCH 27/55] perf tools: Make ordered_events reusable Wang Nan <wangnan0@huawei.com> - 2016-02-19 13:10 +0100
| From | Wang Nan <wangnan0@huawei.com> |
|---|---|
| Date | 2016-02-19 13:10 +0100 |
| Subject | [PATCH 27/55] perf tools: Make ordered_events reusable |
| Message-ID | <r3S2K-4Vi-19@gated-at.bofh.it> |
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.
Calls ordered_events__init() in ordered_events__free() so ordered_events
can be reused.
Signed-off-by: Wang Nan <wangnan0@huawei.com>
Signed-off-by: He Kuang <hekuang@huawei.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
---
tools/perf/util/ordered-events.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/tools/perf/util/ordered-events.c b/tools/perf/util/ordered-events.c
index b1b9e23..70c0dc8 100644
--- a/tools/perf/util/ordered-events.c
+++ b/tools/perf/util/ordered-events.c
@@ -299,6 +299,8 @@ void ordered_events__init(struct ordered_events *oe, ordered_events__deliver_t d
void ordered_events__free(struct ordered_events *oe)
{
+ ordered_events__deliver_t old_deliver = oe->deliver;
+
while (!list_empty(&oe->to_free)) {
struct ordered_event *event;
@@ -307,4 +309,7 @@ void ordered_events__free(struct ordered_events *oe)
free_dup_event(oe, event->event);
free(event);
}
+
+ memset(oe, '\0', sizeof(*oe));
+ ordered_events__init(oe, old_deliver);
}
--
1.8.3.4
Back to top | Article view | linux.kernel
csiph-web