public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/6] perf buildid-list: No need to process the header sections again
@ 2010-01-07 21:59 Arnaldo Carvalho de Melo
  2010-01-07 21:59 ` [PATCH 2/6] perf symbols: Record the domain of DSOs in HEADER_BUILD_ID header table Arnaldo Carvalho de Melo
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Arnaldo Carvalho de Melo @ 2010-01-07 21:59 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo,
	Frédéric Weisbecker, Mike Galbraith, Peter Zijlstra,
	Paul Mackerras

From: Arnaldo Carvalho de Melo <acme@redhat.com>

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.

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>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-buildid-list.c |   25 +------------------------
 1 files changed, 1 insertions(+), 24 deletions(-)

diff --git a/tools/perf/builtin-buildid-list.c b/tools/perf/builtin-buildid-list.c
index 1e99ac8..4229c2c 100644
--- a/tools/perf/builtin-buildid-list.c
+++ b/tools/perf/builtin-buildid-list.c
@@ -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;
@@ -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;
-- 
1.6.2.5


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-01-13 12:58 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-07 21:59 [PATCH 1/6] perf buildid-list: No need to process the header sections again Arnaldo Carvalho de Melo
2010-01-07 21:59 ` [PATCH 2/6] perf symbols: Record the domain of DSOs in HEADER_BUILD_ID header table Arnaldo Carvalho de Melo
2010-01-07 21:59 ` [PATCH 3/6] perf tools: Create typedef for common event synthesizing callback Arnaldo Carvalho de Melo
2010-01-07 21:59 ` [PATCH 4/6] rbtree: Introduce rb_for_each_entry Arnaldo Carvalho de Melo
2010-01-07 21:59 ` [PATCH 5/6] perf tools: Use rb_for_each_entry Arnaldo Carvalho de Melo
2010-01-13  9:11   ` Ingo Molnar
2010-01-13 12:58     ` Arnaldo Carvalho de Melo
2010-01-07 21:59 ` [PATCH 6/6] perf tools: Encode kernel module mappings in perf.data Arnaldo Carvalho de Melo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox