linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman.id.au>
To: Mukesh Kumar Chaurasiya <mchauras@linux.ibm.com>
Cc: npiggin@gmail.com, christophe.leroy@csgroup.eu,
	naveen@kernel.org, maddy@linux.ibm.com, peterx@redhat.com,
	groug@kaod.org, sshegde@linux.ibm.com, mchauras@linux.ibm.com,
	linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] powerpc/xmon: symbol lookup length fixed
Date: Thu, 24 Oct 2024 12:00:53 +1100	[thread overview]
Message-ID: <878que2u2i.fsf@mail.lhotse> (raw)
In-Reply-To: <20241023212225.1306609-2-mchauras@linux.ibm.com>

Mukesh Kumar Chaurasiya <mchauras@linux.ibm.com> writes:
> Currently xmon cannot lookup symbol beyond 64 characters in some cases.

Can you mention which commands? It looks like it's "ls" and "lp".

> Fix this by using KSYM_NAME_LEN instead of fixed 64 characters.
>
> Signed-off-by: Mukesh Kumar Chaurasiya <mchauras@linux.ibm.com>
> ---
>  arch/powerpc/xmon/xmon.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
> index e6cddbb2305f..22b8b5cc4df0 100644
> --- a/arch/powerpc/xmon/xmon.c
> +++ b/arch/powerpc/xmon/xmon.c
> @@ -3662,7 +3662,7 @@ symbol_lookup(void)
>  	int type = inchar();
>  	unsigned long addr, cpu;
>  	void __percpu *ptr = NULL;
> -	static char tmp[64];
> +	static char tmp[KSYM_NAME_LEN];
  
I think you could use the existing tmpstr buffer.

It is global so it's a little hard to track down all the users, but I
think it's only used briefly in get_function_bounds(),
xmon_print_symbol() and scanhex(). ie. none of the uses persist across
function calls.

We don't want to have two 512 byte static arrays lying around if we can
get by with one.

cheers

>  	switch (type) {
>  	case 'a':
> @@ -3671,7 +3671,7 @@ symbol_lookup(void)
>  		termch = 0;
>  		break;
>  	case 's':
> -		getstring(tmp, 64);
> +		getstring(tmp, KSYM_NAME_LEN);
>  		if (setjmp(bus_error_jmp) == 0) {
>  			catch_memory_errors = 1;
>  			sync();
> @@ -3686,7 +3686,7 @@ symbol_lookup(void)
>  		termch = 0;
>  		break;
>  	case 'p':
> -		getstring(tmp, 64);
> +		getstring(tmp, KSYM_NAME_LEN);
>  		if (setjmp(bus_error_jmp) == 0) {
>  			catch_memory_errors = 1;
>  			sync();
> -- 
> 2.47.0


  reply	other threads:[~2024-10-24  1:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-23 21:22 [PATCH] powerpc/xmon: symbol lookup length fixed Mukesh Kumar Chaurasiya
2024-10-24  1:00 ` Michael Ellerman [this message]
2024-10-24  5:12   ` Mukesh Kumar Chaurasiya
2024-10-24 19:03     ` Mukesh Kumar Chaurasiya
2024-10-25  2:32       ` Michael Ellerman

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=878que2u2i.fsf@mail.lhotse \
    --to=mpe@ellerman.id.au \
    --cc=christophe.leroy@csgroup.eu \
    --cc=groug@kaod.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=maddy@linux.ibm.com \
    --cc=mchauras@linux.ibm.com \
    --cc=naveen@kernel.org \
    --cc=npiggin@gmail.com \
    --cc=peterx@redhat.com \
    --cc=sshegde@linux.ibm.com \
    /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;
as well as URLs for NNTP newsgroup(s).