Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8b1389ef authored by Dave Martin's avatar Dave Martin Committed by Arnaldo Carvalho de Melo
Browse files

perf tools: remove extra build-id check factored into dso__load



Signed-off-by: default avatarDave Martin <dave.martin@linaro.org>
LKML-Reference: <new-submission>
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 21916c38
Loading
Loading
Loading
Loading
+2 −26
Original line number Original line Diff line number Diff line
@@ -986,12 +986,12 @@ static int dso__load_sym(struct dso *self, struct map *map, const char *name,


	elf = elf_begin(fd, PERF_ELF_C_READ_MMAP, NULL);
	elf = elf_begin(fd, PERF_ELF_C_READ_MMAP, NULL);
	if (elf == NULL) {
	if (elf == NULL) {
		pr_err("%s: cannot read %s ELF file.\n", __func__, name);
		pr_debug("%s: cannot read %s ELF file.\n", __func__, name);
		goto out_close;
		goto out_close;
	}
	}


	if (gelf_getehdr(elf, &ehdr) == NULL) {
	if (gelf_getehdr(elf, &ehdr) == NULL) {
		pr_err("%s: cannot get elf header.\n", __func__);
		pr_debug("%s: cannot get elf header.\n", __func__);
		goto out_elf_end;
		goto out_elf_end;
	}
	}


@@ -1710,30 +1710,6 @@ static int dso__load_vmlinux(struct dso *self, struct map *map,
{
{
	int err = -1, fd;
	int err = -1, fd;


	if (self->has_build_id) {
		u8 build_id[BUILD_ID_SIZE];

		if (filename__read_build_id(vmlinux, build_id,
					    sizeof(build_id)) < 0) {
			pr_debug("No build_id in %s, ignoring it\n", vmlinux);
			return -1;
		}
		if (!dso__build_id_equal(self, build_id)) {
			char expected_build_id[BUILD_ID_SIZE * 2 + 1],
			     vmlinux_build_id[BUILD_ID_SIZE * 2 + 1];

			build_id__sprintf(self->build_id,
					  sizeof(self->build_id),
					  expected_build_id);
			build_id__sprintf(build_id, sizeof(build_id),
					  vmlinux_build_id);
			pr_debug("build_id in %s is %s while expected is %s, "
				 "ignoring it\n", vmlinux, vmlinux_build_id,
				 expected_build_id);
			return -1;
		}
	}

	fd = open(vmlinux, O_RDONLY);
	fd = open(vmlinux, O_RDONLY);
	if (fd < 0)
	if (fd < 0)
		return -1;
		return -1;