]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
perf session: Make ordered_events reusable
authorWang Nan <wangnan0@huawei.com>
Wed, 13 Apr 2016 08:21:04 +0000 (08:21 +0000)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 14 Apr 2016 11:57:54 +0000 (08:57 -0300)
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

index 91d4528d71fa8a599b34cd625d8e7bb45893f9e2..ca1827c4af4a4f3e57a01d9ac2a4d295eb459cf4 100644 (file)
@@ -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;