aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-buildid-list.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2010-01-07 16:59:38 -0500
committerIngo Molnar <mingo@elte.hu>2010-01-13 04:09:15 -0500
commitfed5af61dc0d9402d26e7fb8fb9731a60a8e05ca (patch)
treeb739ae7d32162a81cd9927f8828de80dd8b8747c /tools/perf/builtin-buildid-list.c
parent8d9e503928638fc95317be42c416fb7907322aff (diff)
perf buildid-list: No need to process the header sections again
As it is already processed by: perf_session__new perf_session__open perf_session__read This was harmless, because we use dsos__findnew, that would already find it, but is unnecessary work and removing it makes builtin-buildid-list.c even shorter. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Frédéric Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> LKML-Reference: <1262901583-8074-1-git-send-email-acme@infradead.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/builtin-buildid-list.c')
-rw-r--r--tools/perf/builtin-buildid-list.c25
1 files changed, 1 insertions, 24 deletions
diff --git a/tools/perf/builtin-buildid-list.c b/tools/perf/builtin-buildid-list.c
index 1e99ac806913..4229c2c213cc 100644
--- a/tools/perf/builtin-buildid-list.c
+++ b/tools/perf/builtin-buildid-list.c
@@ -31,26 +31,6 @@ static const struct option options[] = {
31 OPT_END() 31 OPT_END()
32}; 32};
33 33
34static int perf_file_section__process_buildids(struct perf_file_section *self,
35 int feat, int fd)
36{
37 if (feat != HEADER_BUILD_ID)
38 return 0;
39
40 if (lseek(fd, self->offset, SEEK_SET) < 0) {
41 pr_warning("Failed to lseek to %Ld offset for buildids!\n",
42 self->offset);
43 return -1;
44 }
45
46 if (perf_header__read_build_ids(fd, self->offset, self->size)) {
47 pr_warning("Failed to read buildids!\n");
48 return -1;
49 }
50
51 return 0;
52}
53
54static int __cmd_buildid_list(void) 34static int __cmd_buildid_list(void)
55{ 35{
56 int err = -1; 36 int err = -1;
@@ -60,10 +40,7 @@ static int __cmd_buildid_list(void)
60 if (session == NULL) 40 if (session == NULL)
61 return -1; 41 return -1;
62 42
63 err = perf_header__process_sections(&session->header, session->fd, 43 dsos__fprintf_buildid(stdout);
64 perf_file_section__process_buildids);
65 if (err >= 0)
66 dsos__fprintf_buildid(stdout);
67 44
68 perf_session__delete(session); 45 perf_session__delete(session);
69 return err; 46 return err;