linux-mips
[Top] [All Lists]

Re: [PATCH 3/4] tlbex.c: cleanup debug code

To: Franck Bui-Huu <fbuihuu@gmail.com>
Subject: Re: [PATCH 3/4] tlbex.c: cleanup debug code
From: Thiemo Seufer <ths@networkno.de>
Date: Fri, 12 Oct 2007 18:11:21 +0100
Cc: Ralf Baechle <ralf@linux-mips.org>, linux-mips <linux-mips@linux-mips.org>
In-reply-to: <470F1775.7090807@gmail.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <470F16B9.7030406@gmail.com> <470F1775.7090807@gmail.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.16 (2007-06-11)
Franck Bui-Huu wrote:
> 
> Signed-off-by: Franck Bui-Huu <fbuihuu@gmail.com>
> ---
>  arch/mips/mm/tlbex.c |   83 +++++++++++++++----------------------------------
>  1 files changed, 26 insertions(+), 57 deletions(-)
> 
> diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c
> index 923515e..4775e4c 100644
> --- a/arch/mips/mm/tlbex.c
> +++ b/arch/mips/mm/tlbex.c
> @@ -705,6 +705,22 @@ il_bgez(u32 **p, struct reloc **r, unsigned int reg, 
> enum label_id l)
>       i_bgez(p, reg, 0);
>  }
>  
> +/*
> + * For debug purposes.
> + */
> +static inline void dump_handler(const u32 *handler, int count)
> +{
> +     int i;
> +
> +     pr_debug("\t.set push\n");
> +     pr_debug("\t.set noreorder\n");
> +
> +     for (i = 0; i < count; i++)
> +             pr_debug("\t%p\t.word 0x%08x\n", &handler[i], handler[i]);
> +
> +     pr_debug("\t.set pop\n");
> +}

I don't like this patch. I wrote the code to
a) print the handler before the (potentially fatal) memcpy. Touching
   EBASE for the first time is a place where things like to go wrong.
b) avoid printing leading nops which are never executed. The trailing
   nops have less potential for confusion.


Thiemo

<Prev in Thread] Current Thread [Next in Thread>