Commit d0acce68 authored by Chengen Du's avatar Chengen Du Committed by Arnaldo Carvalho de Melo

perf symbols: Parse NOTE segments until the build id is found

In the ELF file, multiple NOTE segments may exist.
To locate the build id, the process shall persist
in parsing NOTE segments until the build id is found.
Signed-off-by: default avatarChengen Du <chengen.du@canonical.com>
Acked-by: default avatarIan Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20231130135723.17562-1-chengen.du@canonical.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 030ac3ca
......@@ -159,9 +159,10 @@ int filename__read_build_id(const char *filename, struct build_id *bid)
goto out_free;
ret = read_build_id(buf, buf_size, bid, need_swap);
if (ret == 0)
if (ret == 0) {
ret = bid->size;
break;
break;
}
}
} else {
Elf64_Ehdr ehdr;
......@@ -210,9 +211,10 @@ int filename__read_build_id(const char *filename, struct build_id *bid)
goto out_free;
ret = read_build_id(buf, buf_size, bid, need_swap);
if (ret == 0)
if (ret == 0) {
ret = bid->size;
break;
break;
}
}
}
out_free:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment