diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2009-11-11 04:51:03 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-11-11 07:30:17 +0100 |
commit | 8671dab9d5b2f0b444b8d09792384dccbfd43d14 (patch) | |
tree | 399d45fd784e7210bc1847ab2643731243f67f1d /tools/perf/builtin-record.c | |
parent | de8967214d8ce536161a1ad6538ad1cb82e7428d (diff) | |
download | kernel_samsung_smdk4412-8671dab9d5b2f0b444b8d09792384dccbfd43d14.zip kernel_samsung_smdk4412-8671dab9d5b2f0b444b8d09792384dccbfd43d14.tar.gz kernel_samsung_smdk4412-8671dab9d5b2f0b444b8d09792384dccbfd43d14.tar.bz2 |
perf tools: Move the build-id storage operations to headers
So that it makes easier to control it. Especially because we
plan to give it a feature section.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
LKML-Reference: <1257911467-28276-2-git-send-email-fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/builtin-record.c')
-rw-r--r-- | tools/perf/builtin-record.c | 32 |
1 files changed, 2 insertions, 30 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 9f98b86..c35e61b 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -378,39 +378,11 @@ static void open_counters(int cpu, pid_t pid) nr_cpu++; } -static bool write_buildid_table(void) -{ - struct dso *pos; - bool have_buildid = false; - - list_for_each_entry(pos, &dsos, node) { - struct build_id_event b; - size_t len; - - if (filename__read_build_id(pos->long_name, - &b.build_id, - sizeof(b.build_id)) < 0) - continue; - have_buildid = true; - memset(&b.header, 0, sizeof(b.header)); - len = strlen(pos->long_name) + 1; - len = ALIGN(len, 64); - b.header.size = sizeof(b) + len; - write_output(&b, sizeof(b)); - write_output(pos->long_name, len); - } - - return have_buildid; -} - static void atexit_header(void) { header->data_size += bytes_written; - if (write_buildid_table()) - perf_header__set_feat(header, HEADER_BUILD_ID); - - perf_header__write(header, output); + perf_header__write(header, output, true); } static int __cmd_record(int argc, const char **argv) @@ -487,7 +459,7 @@ static int __cmd_record(int argc, const char **argv) } if (file_new) - perf_header__write(header, output); + perf_header__write(header, output, false); if (!system_wide) event__synthesize_thread(pid, process_synthesized_event); |