提交 4532f642 编写于 作者: W Wang Nan 提交者: Arnaldo Carvalho de Melo

perf ordered_events: Introduce reinit()

'perf record' will use this when outputting multiple perf.data files.
Signed-off-by: NWang 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.comSigned-off-by: NHe Kuang <hekuang@huawei.com>
[ Split from larger patch ]
Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 ea8dc3ce
...@@ -308,3 +308,12 @@ void ordered_events__free(struct ordered_events *oe) ...@@ -308,3 +308,12 @@ void ordered_events__free(struct ordered_events *oe)
free(event); 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);
}
...@@ -49,6 +49,7 @@ void ordered_events__delete(struct ordered_events *oe, struct ordered_event *eve ...@@ -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); 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__init(struct ordered_events *oe, ordered_events__deliver_t deliver);
void ordered_events__free(struct ordered_events *oe); void ordered_events__free(struct ordered_events *oe);
void ordered_events__reinit(struct ordered_events *oe);
static inline static inline
void ordered_events__set_alloc_size(struct ordered_events *oe, u64 size) void ordered_events__set_alloc_size(struct ordered_events *oe, u64 size)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册