Skip to content

Commit

Permalink
perf buildid-list: No need to process the header sections again
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Arnaldo Carvalho de Melo authored and Ingo Molnar committed Jan 13, 2010
1 parent 8d9e503 commit fed5af6
Showing 1 changed file with 1 addition and 24 deletions.
25 changes: 1 addition & 24 deletions tools/perf/builtin-buildid-list.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,6 @@ static const struct option options[] = {
OPT_END()
};

static int perf_file_section__process_buildids(struct perf_file_section *self,
int feat, int fd)
{
if (feat != HEADER_BUILD_ID)
return 0;

if (lseek(fd, self->offset, SEEK_SET) < 0) {
pr_warning("Failed to lseek to %Ld offset for buildids!\n",
self->offset);
return -1;
}

if (perf_header__read_build_ids(fd, self->offset, self->size)) {
pr_warning("Failed to read buildids!\n");
return -1;
}

return 0;
}

static int __cmd_buildid_list(void)
{
int err = -1;
Expand All @@ -60,10 +40,7 @@ static int __cmd_buildid_list(void)
if (session == NULL)
return -1;

err = perf_header__process_sections(&session->header, session->fd,
perf_file_section__process_buildids);
if (err >= 0)
dsos__fprintf_buildid(stdout);
dsos__fprintf_buildid(stdout);

perf_session__delete(session);
return err;
Expand Down

0 comments on commit fed5af6

Please sign in to comment.