Skip to contentSkip to conversation

perf annotate: Don't prepend symfs path to build_id_filename

PATCH In review Martin Vuille 2 participants 4 messages Feb 11, 2018 – Mar 13, 2018 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf annotate: Don't prepend symfs path to build_id_filename

build_id_filename already contains symfs path if applicable, so don't prepend it a second time.

---
 tools/perf/util/annotate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/annotate.c +1 -1
index 28b233c3dcbe..425b7f0760ec 100644
@@ -1381,7 +1381,7 @@ static int dso__disassemble_filename(struct dso *dso, char *filename, size_t fil
 
 	build_id_filename = dso__build_id_filename(dso, NULL, 0, false);
 	if (build_id_filename) {
-		__symbol__join_symfs(filename, filename_size, build_id_filename);
+		scnprintf(filename, filename_size, "%s", build_id_filename);
 		free(build_id_filename);
 	} else {
 		if (dso->has_build_id)
Signature · 1 line
2.13.6
#1 lore raw

Em Sun, Feb 11, 2018 at 02:19:37PM -0500, Martin Vuille escreveu:

Quoted 2 lines

build_id_filename already contains symfs path if applicable, so don't prepend it a second time.

Where is the analysis that shows that that is the case? I looked here at the implementation for dso__build_id_filename() and couldn't find where was it that the symfs would be appended, can you clarify?

- Arnaldo

Quoted 20 lines
---
 tools/perf/util/annotate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/annotate.c +1 -1
index 28b233c3dcbe..425b7f0760ec 100644
@@ -1381,7 +1381,7 @@ static int dso__disassemble_filename(struct dso *dso, char *filename, size_t fil
 
 	build_id_filename = dso__build_id_filename(dso, NULL, 0, false);
 	if (build_id_filename) {
-		__symbol__join_symfs(filename, filename_size, build_id_filename);
+		scnprintf(filename, filename_size, "%s", build_id_filename);
 		free(build_id_filename);
 	} else {
 		if (dso->has_build_id)
Signature · 1 line
2.13.6
#2 lore raw

dso__build_id_filename calls build_id_cache__linkname

build_id_cache__linkname uses buildid_dir

symbol__config_symfs includes the symfs directory in buildid_dir

So it's not necessary to prepend it again.

Should've included those notes in the original submission.

Will do better next time.

MV

Quoted 29 lines · Arnaldo Carvalho de Melo

Em Sun, Feb 11, 2018 at 02:19:37PM -0500, Martin Vuille escreveu:

Quoted 2 lines

build_id_filename already contains symfs path if applicable, so don't prepend it a second time.

Where is the analysis that shows that that is the case? I looked here at the implementation for dso__build_id_filename() and couldn't find where was it that the symfs would be appended, can you clarify?

- Arnaldo

Quoted 20 lines
---
  tools/perf/util/annotate.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/annotate.c +1 -1
index 28b233c3dcbe..425b7f0760ec 100644
@@ -1381,7 +1381,7 @@ static int dso__disassemble_filename(struct dso *dso, char *filename, size_t fil
 
  	build_id_filename = dso__build_id_filename(dso, NULL, 0, false);
  	if (build_id_filename) {
-		__symbol__join_symfs(filename, filename_size, build_id_filename);
+		scnprintf(filename, filename_size, "%s", build_id_filename);
  		free(build_id_filename);
  	} else {
  		if (dso->has_build_id)
Signature · 1 line
2.13.6
#3 lore raw
In reply to Arnaldo Carvalho de Melo
Quoted 9 lines · Arnaldo Carvalho de Melo

Em Sun, Feb 11, 2018 at 02:19:37PM -0500, Martin Vuille escreveu:

Quoted 2 lines

build_id_filename already contains symfs path if applicable, so don't prepend it a second time.

Where is the analysis that shows that that is the case? I looked here at the implementation for dso__build_id_filename() and couldn't find where was it that the symfs would be appended, can you clarify?

- Arnaldo

Patch resubmitted with additional details in commit message:

https://patchwork.kernel.org/patch/10279077/

Regards,
MV