diff options
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/builtin-buildid-list.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/tools/perf/builtin-buildid-list.c b/tools/perf/builtin-buildid-list.c index a82d99fec83e..4c770d252fd2 100644 --- a/tools/perf/builtin-buildid-list.c +++ b/tools/perf/builtin-buildid-list.c | |||
@@ -49,18 +49,16 @@ static int perf_session__list_build_ids(bool force, bool with_hits) | |||
49 | struct perf_session *session; | 49 | struct perf_session *session; |
50 | 50 | ||
51 | symbol__elf_init(); | 51 | symbol__elf_init(); |
52 | |||
53 | session = perf_session__new(input_name, O_RDONLY, force, false, | ||
54 | &build_id__mark_dso_hit_ops); | ||
55 | if (session == NULL) | ||
56 | return -1; | ||
57 | |||
58 | /* | 52 | /* |
59 | * See if this is an ELF file first: | 53 | * See if this is an ELF file first: |
60 | */ | 54 | */ |
61 | if (filename__fprintf_build_id(session->filename, stdout)) | 55 | if (filename__fprintf_build_id(input_name, stdout)) |
62 | goto out; | 56 | goto out; |
63 | 57 | ||
58 | session = perf_session__new(input_name, O_RDONLY, force, false, | ||
59 | &build_id__mark_dso_hit_ops); | ||
60 | if (session == NULL) | ||
61 | return -1; | ||
64 | /* | 62 | /* |
65 | * in pipe-mode, the only way to get the buildids is to parse | 63 | * in pipe-mode, the only way to get the buildids is to parse |
66 | * the record stream. Buildids are stored as RECORD_HEADER_BUILD_ID | 64 | * the record stream. Buildids are stored as RECORD_HEADER_BUILD_ID |
@@ -69,8 +67,8 @@ static int perf_session__list_build_ids(bool force, bool with_hits) | |||
69 | perf_session__process_events(session, &build_id__mark_dso_hit_ops); | 67 | perf_session__process_events(session, &build_id__mark_dso_hit_ops); |
70 | 68 | ||
71 | perf_session__fprintf_dsos_buildid(session, stdout, with_hits); | 69 | perf_session__fprintf_dsos_buildid(session, stdout, with_hits); |
72 | out: | ||
73 | perf_session__delete(session); | 70 | perf_session__delete(session); |
71 | out: | ||
74 | return 0; | 72 | return 0; |
75 | } | 73 | } |
76 | 74 | ||