Skip to contentSkip to conversation

perf symbols: reuse of name in dso__load when starting second pass

PATCH In review David Ahern 2 participants 4 messages Nov 21, 2010 – Nov 22, 2010 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf symbols: reuse of name in dso__load when starting second pass

continue statement in default case applies when a second pass is wanted as well. As it stands the code drops down to the open re-using the value in name from the previous origin attempt.

---
 tools/perf/util/symbol.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
tools/perf/util/symbol.c +2 -2
index d30136e..861be8b 100644
@@ -1488,8 +1488,8 @@ int dso__load(struct dso *self, struct map *map, symbol_filter_t filter)
 			if (want_symtab) {
 				want_symtab = 0;
 				self->origin = DSO__ORIG_BUILD_ID_CACHE;
-			} else
-				continue;
+			}
+			continue;
 		}
 
 		/* Name is now the name of the next image to try */
Signature · 1 line
1.7.2.3
#1 lore raw

Em Sun, Nov 21, 2010 at 08:03:50AM -0700, David Ahern escreveu:

Quoted 14 lines

continue statement in default case applies when a second pass is wanted as well. As it stands the code drops down to the open re-using the value in name from the previous origin attempt.

---
 tools/perf/util/symbol.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
tools/perf/util/symbol.c +0 -0
index d30136e..861be8b 100644

tools/perf/util/symbol.c int dso__load(struct dso *self, struct map *map, symbol_filter_t filter) · line 1493

Quoted 8 lines
tools/perf/util/symbol.c +2 -2
@@ -1488,8 +1488,8 @@ int dso__load(struct dso *self, struct map *map, symbol_filter_t filter)
 			if (want_symtab) {
 				want_symtab = 0;
 				self->origin = DSO__ORIG_BUILD_ID_CACHE;
-			} else
-				continue;
+			}
+			continue;
 		}

But we want to restart at DSO__ORIG_BUILD_ID_CACHE, right? If you do your change we keep a existing mistake and will instead restart at DSO__ORIG_BUILD_ID_CACHE + 1, please take a look to validate my understanding that we need to set self->origin to DSO__ORIG_BUILD_ID_CACHE - 1.

- Arnaldo

#2 lore raw
Quoted 21 lines · Arnaldo Carvalho de Melo

Em Sun, Nov 21, 2010 at 08:03:50AM -0700, David Ahern escreveu:

Quoted 20 lines

continue statement in default case applies when a second pass is wanted as well. As it stands the code drops down to the open re-using the value in name from the previous origin attempt.

---
 tools/perf/util/symbol.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
tools/perf/util/symbol.c +1 -2
index d30136e..861be8b 100644
@@ -1488,8 +1488,8 @@ int dso__load(struct dso *self, struct map *map, symbol_filter_t filter)
 			if (want_symtab) {
 				want_symtab = 0;
 				self->origin = DSO__ORIG_BUILD_ID_CACHE;
-			} else
-				continue;
+			}
Quoted 8 lines

tools/perf/util/symbol.c int dso__load(struct dso *self, struct map *map, symbol_filter_t filter) · line 1493

Quoted 2 lines
tools/perf/util/symbol.c +1 -0
+			continue;
 		}

But we want to restart at DSO__ORIG_BUILD_ID_CACHE, right? If you do your change we keep a existing mistake and will instead restart at DSO__ORIG_BUILD_ID_CACHE + 1, please take a look to validate my understanding that we need to set self->origin to DSO__ORIG_BUILD_ID_CACHE - 1.

Correct. In working on the rootfs change I noticed that the default case falls through to the open using the 'name' value set from the previous origin so it is tried twice. This patch fixes that bug.

I also noted that the BUILD_ID_CACHE was skipped, but I was not sure if that was desired or not. If it is then correcting the proper 'next origin' is another trivial bug fix.

Some projects like single focused bug fixes for bisecting. I am fine with combining if that is wanted.

David

Quoted 2 lines

- Arnaldo

#3 lore raw

Em Sun, Nov 21, 2010 at 05:50:46PM -0700, David S. Ahern escreveu:

Quoted 34 lines · Arnaldo Carvalho de Melo
Quoted 20 lines

Em Sun, Nov 21, 2010 at 08:03:50AM -0700, David Ahern escreveu:

Quoted 19 lines

continue statement in default case applies when a second pass is wanted as well. As it stands the code drops down to the open re-using the value in name from the previous origin attempt.

---
 tools/perf/util/symbol.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
tools/perf/util/symbol.c +0 -2
index d30136e..861be8b 100644
@@ -1488,8 +1488,8 @@ int dso__load(struct dso *self, struct map *map, symbol_filter_t filter)
 			if (want_symtab) {
 				want_symtab = 0;
 				self->origin = DSO__ORIG_BUILD_ID_CACHE;
-			} else
-				continue;
Quoted 8 lines

tools/perf/util/symbol.c int dso__load(struct dso *self, struct map *map, symbol_filter_t filter) · line 1492

Quoted 2 lines
tools/perf/util/symbol.c +2 -0
+			}
+			continue;

But we want to restart at DSO__ORIG_BUILD_ID_CACHE, right? If you do your change we keep a existing mistake and will instead restart at DSO__ORIG_BUILD_ID_CACHE + 1, please take a look to validate my understanding that we need to set self->origin to DSO__ORIG_BUILD_ID_CACHE - 1.

Correct. In working on the rootfs change I noticed that the default case falls through to the open using the 'name' value set from the previous origin so it is tried twice. This patch fixes that bug.

Quoted 6 lines

I also noted that the BUILD_ID_CACHE was skipped, but I was not sure if that was desired or not. If it is then correcting the proper 'next origin' is another trivial bug fix.

Some projects like single focused bug fixes for bisecting. I am fine with combining if that is wanted.

Agreed, two is better, I'll apply yours and add a followup fixing this other issue, thanks.

- Arnaldo