Re: [PATCH] kallsyms: optimize kallsyms_lookup_name() for a few cases

2017-06-27 Thread Naveen N. Rao
eviously? > > > > > > But it's correct, because you can lookup a symbol in a module without a > > > module prefix, it just looks in every module. > > > > Yes. > > > > > > > > You could invert the logic, ie. check that the

Re: [PATCH] kallsyms: optimize kallsyms_lookup_name() for a few cases

2017-04-26 Thread Masami Hiramatsu
't a ":" in the name > > and only in that case do the for loop, always falling back to module > > lookup. > > > > Or just add a comment explaining why we call module lookup in two places. > > Good point. Here's a v2 - I'm using a goto so as to not inden

Re: [PATCH] kallsyms: optimize kallsyms_lookup_name() for a few cases

2017-04-26 Thread Naveen N. Rao
; You could invert the logic, ie. check that there isn't a ":" in the name > and only in that case do the for loop, always falling back to module > lookup. > > Or just add a comment explaining why we call module lookup in two places. Good point. Here's a v2 - I'm using a goto s

Re: [PATCH] kallsyms: optimize kallsyms_lookup_name() for a few cases

2017-04-26 Thread Michael Ellerman
"Naveen N. Rao" writes: > diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c > index 6a3b249a2ae1..d134b060564f 100644 > --- a/kernel/kallsyms.c > +++ b/kernel/kallsyms.c > @@ -205,6 +205,12 @@ unsigned long kallsyms_lookup_name(const char *name) > unsigned

RE: [PATCH] kallsyms: optimize kallsyms_lookup_name() for a few cases

2017-04-25 Thread Naveen N. Rao
Excerpts from David Laight's message of April 25, 2017 22:06: From: Naveen N. Rao Sent: 25 April 2017 17:18 1. Fail early for invalid/zero length symbols. 2. Detect names of the form and skip checking for kernel symbols in that case. Signed-off-by: Naveen N. Rao

RE: [PATCH] kallsyms: optimize kallsyms_lookup_name() for a few cases

2017-04-25 Thread David Laight
From: Naveen N. Rao > Sent: 25 April 2017 17:18 > 1. Fail early for invalid/zero length symbols. > 2. Detect names of the form and skip checking for kernel > symbols in that case. > > Signed-off-by: Naveen N. Rao > --- > Masami, Michael, > I have added two very

[PATCH] kallsyms: optimize kallsyms_lookup_name() for a few cases

2017-04-25 Thread Naveen N. Rao
1. Fail early for invalid/zero length symbols. 2. Detect names of the form and skip checking for kernel symbols in that case. Signed-off-by: Naveen N. Rao --- Masami, Michael, I have added two very simple checks here, which I felt is good to have, rather than