perf record: Generate tracking events for process forked by perf
authorWang Nan <wangnan0@huawei.com>
Wed, 20 Apr 2016 18:59:54 +0000 (18:59 +0000)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 28 Apr 2016 12:58:59 +0000 (09:58 -0300)
commitbe7b0c9e376e93a00b6c8631e2721e9dc7c6a1fa
tree3e506744da6b6198292515a459de22c47b26db4d
parent0c1d46a8796e8309f1ca693e5cad6f318e4b8159
perf record: Generate tracking events for process forked by perf

With 'perf record --switch-output' without -a, record__synthesize() in
record__switch_output() won't generate tracking events because there's
no thread_map in evlist. Which causes newly created perf.data doesn't
contain map and comm information.

This patch creates a fake thread_map and directly call
perf_event__synthesize_thread_map() for those events.

Signed-off-by: Wang Nan <wangnan0@huawei.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
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/1461178794-40467-8-git-send-email-wangnan0@huawei.com
Signed-off-by: He Kuang <hekuang@huawei.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-record.c