From: Franck Bui-Huu <vagabon.xyz@gmail.com>
To: Paulo Marques <pmarques@grupopie.com>
Cc: Franck <vagabon.xyz@gmail.com>,
rusty@rustcorp.com.au,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [RFC] kallsyms_lookup always requires buffers
Date: Wed, 23 Aug 2006 09:49:27 +0200 [thread overview]
Message-ID: <44EC0887.10402@innova-card.com> (raw)
In-Reply-To: <44EB5A73.9080206@grupopie.com>
Hi
Paulo Marques wrote:
> Franck Bui-Huu wrote:
>>
>> This simple patch adds a new entry "kallsyms_lookup_gently()". The
>> name actually sucks but I can't figure out a coherent name with the
>> rest of the file. If someone could give me a better idea...
>
> kallsyms_lookup_size_offset() ?
>
> Granted it is a little bigger, but it tells exactly what it does and
> there are not that many users that we have to write this name all that
> often.
>
ok.
>> This new entry does exactly the same as kallsyms_lookup() but does
>> not require any buffers to store any names. It returns 0 if it fails
>> otherwise 1.
>>
>> Do you think this can be usefull ?
>
> You tell me, since you're proposing the change ;)
>
:)
actually the question was rather "does this change look sensible to you ?"
>> +static int is_kernel_addr(unsigned long addr)
>
> Maybe change the name to kallsyms_is_kernel_addr, because this function
> does more things than what the generic name implies.
>
it sounds like a public function name. Maybe is_ksym_addr() is better ?
>> + * Lookup an address but don't bother to find any names.
>> + */
>> +int kallsyms_lookup_gently(unsigned long addr, unsigned long
>> *symbolsize,
>> + unsigned long *offset)
>> +{
>> + int rv;
>> +
>> + if (is_kernel_addr(addr))
>> + rv = !!get_symbol_pos(addr, symbolsize, offset);
>> + else
>> + rv = !!module_address_lookup(addr, symbolsize, offset, NULL);
>> +
>> + return rv;
>> +}
>
> <minor nitpick>
>
> Why not just:
>
>> if (is_kernel_addr(addr))
>> return !!get_symbol_pos(addr, symbolsize, offset);
>>
>> return !!module_address_lookup(addr, symbolsize, offset, NULL);
>
> and just get rid of "rv" completely?
>
> </minor nitpick>
>
No problem.
>> +EXPORT_SYMBOL_GPL(kallsyms_lookup_gently);
>
> I agree with Arjan here. If kallsyms_lookup wasn't exported, I don't see
> a reason to export this either.
>
Already removed.
thanks
Franck
prev parent reply other threads:[~2006-08-23 7:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-22 12:51 [RFC] kallsyms_lookup always requires buffers Franck Bui-Huu
2006-08-22 13:18 ` Arjan van de Ven
2006-08-22 13:54 ` Franck Bui-Huu
2006-08-22 19:26 ` Paulo Marques
2006-08-23 7:49 ` Franck Bui-Huu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=44EC0887.10402@innova-card.com \
--to=vagabon.xyz@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pmarques@grupopie.com \
--cc=rusty@rustcorp.com.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox