diff options
author | Wang Nan <wangnan0@huawei.com> | 2016-04-13 08:21:04 +0000 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-04-14 08:57:54 -0300 |
commit | 4532f642974d871f9a50e9a09bc482eaed5394f6 (patch) | |
tree | 51d57a1e9465131760a45ae707c933201e3a7471 /tools/perf/util/ordered-events.c | |
parent | ea8dc3cefba0a0decaedc710b218a6ceffe0194a (diff) | |
download | lwn-4532f642974d871f9a50e9a09bc482eaed5394f6.tar.gz lwn-4532f642974d871f9a50e9a09bc482eaed5394f6.zip |
perf ordered_events: Introduce reinit()
'perf record' will use this when outputting multiple perf.data files.
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>
Diffstat (limited to 'tools/perf/util/ordered-events.c')
-rw-r--r-- | tools/perf/util/ordered-events.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/perf/util/ordered-events.c b/tools/perf/util/ordered-events.c index b1b9e2385f4b..fe84df1875aa 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); +} |