All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf symbols: reuse of name in dso__load when starting second pass
@ 2010-11-21 15:03 David Ahern
  2010-11-21 22:03 ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 4+ messages in thread
From: David Ahern @ 2010-11-21 15:03 UTC (permalink / raw)
  To: linux-perf-users; +Cc: David Ahern

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.

Signed-off-by: David Ahern <daahern@cisco.com>
---
 tools/perf/util/symbol.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index d30136e..861be8b 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -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 */
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] perf symbols: reuse of name in dso__load when starting second pass
  2010-11-21 15:03 [PATCH] perf symbols: reuse of name in dso__load when starting second pass David Ahern
@ 2010-11-21 22:03 ` Arnaldo Carvalho de Melo
  2010-11-22  0:50   ` David S. Ahern
  0 siblings, 1 reply; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2010-11-21 22:03 UTC (permalink / raw)
  To: David Ahern; +Cc: linux-perf-users

Em Sun, Nov 21, 2010 at 08:03:50AM -0700, David Ahern escreveu:
> 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.
> 
> Signed-off-by: David Ahern <daahern@cisco.com>
> ---
>  tools/perf/util/symbol.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
> index d30136e..861be8b 100644
> --- a/tools/perf/util/symbol.c
> +++ b/tools/perf/util/symbol.c
> @@ -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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] perf symbols: reuse of name in dso__load when starting second pass
  2010-11-21 22:03 ` Arnaldo Carvalho de Melo
@ 2010-11-22  0:50   ` David S. Ahern
  2010-11-22 12:35     ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 4+ messages in thread
From: David S. Ahern @ 2010-11-22  0:50 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo; +Cc: linux-perf-users



On 11/21/10 15:03, Arnaldo Carvalho de Melo wrote:
> Em Sun, Nov 21, 2010 at 08:03:50AM -0700, David Ahern escreveu:
>> 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.
>>
>> Signed-off-by: David Ahern <daahern@cisco.com>
>> ---
>>  tools/perf/util/symbol.c |    4 ++--
>>  1 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
>> index d30136e..861be8b 100644
>> --- a/tools/perf/util/symbol.c
>> +++ b/tools/perf/util/symbol.c
>> @@ -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.

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


> 
> - Arnaldo

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] perf symbols: reuse of name in dso__load when starting second pass
  2010-11-22  0:50   ` David S. Ahern
@ 2010-11-22 12:35     ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2010-11-22 12:35 UTC (permalink / raw)
  To: David S. Ahern; +Cc: linux-perf-users

Em Sun, Nov 21, 2010 at 05:50:46PM -0700, David S. Ahern escreveu:
> On 11/21/10 15:03, Arnaldo Carvalho de Melo wrote:
> > Em Sun, Nov 21, 2010 at 08:03:50AM -0700, David Ahern escreveu:
> >> 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.
> >>
> >> Signed-off-by: David Ahern <daahern@cisco.com>
> >> ---
> >>  tools/perf/util/symbol.c |    4 ++--
> >>  1 files changed, 2 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
> >> index d30136e..861be8b 100644
> >> --- a/tools/perf/util/symbol.c
> >> +++ b/tools/perf/util/symbol.c
> >> @@ -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.
> 
> 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.

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

- Arnaldo

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-11-22 12:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-21 15:03 [PATCH] perf symbols: reuse of name in dso__load when starting second pass David Ahern
2010-11-21 22:03 ` Arnaldo Carvalho de Melo
2010-11-22  0:50   ` David S. Ahern
2010-11-22 12:35     ` Arnaldo Carvalho de Melo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.