mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Jörn Engel" <joern@wohnheim.fh-wedel.de>
To: Finn Thain <ft01@webmastery.com.au>
Cc: "Geert Uytterhoeven" <geert@linux-m68k.org>,
	Linux/m68k <linux-m68k@lists.linux-m68k.org>,
	"Matt Mackall" <mpm@selenic.com>,
	"Linux Kernel Development" <linux-kernel@vger.kernel.org>,
	"Jörn Engel" <joern@wohnheim.fh-wedel.de>
Subject: Re: Subject: Re: make checkstack on m68k
Date: Thu, 17 Jun 2004 20:36:16 +0200	[thread overview]
Message-ID: <20040617183616.GC29029@wohnheim.fh-wedel.de> (raw)
In-Reply-To: <Pine.LNX.4.58.0406171812440.8197@bonkers.disegno.com.au>

On Thu, 17 June 2004 18:43:18 +1000, Finn Thain wrote:
> To:	Geert Uytterhoeven <geert@linux-m68k.org>,
> 	Linux/m68k <linux-m68k@lists.linux-m68k.org>,
> 	Matt Mackall <mpm@selenic.com>,
> 	Linux Kernel Development <linux-kernel@vger.kernel.org>

Who are you replying to again? ;)

> Jörn Engel wrote:
> 
> > On Wed, 16 June 2004 18:51:03 +0200, Geert Uytterhoeven wrote:
> > >
> > > @@ -40,6 +40,11 @@
> > >  	} elsif ($arch =~ /^ia64$/) {
> > >  		#e0000000044011fc:       01 0f fc 8c     adds r12=-384,r12
> > >  		$re = qr/.*adds.*r12=-(([0-9]{2}|[3-9])[0-9]{2}),r12/o;
> > > +	} elsif ($arch =~ /^m68k$/) {
> > > +		#2b6c:       4e56 fb70       linkw %fp,#-1168
> > > +		#$re = qr/.*linkw %fp,#-([0-9]{1,4})/o;
> > > +		#1df770:       defc ffe4       addaw #-28,%sp
> > > +		$re = qr/.*addaw #-([0-9]{1,4}),%sp/o;
> >
> > For i386 I used a really ugly hack, but this needs someone with better
> > perl skills.  Matt, can you find a nice regex?  If it adds more
> > brackets, that's fine.  We'll just add empty brackets to the other
> > regexes and use $2 instead of $1 or so.
> 
> There is no nice way to do this in perl in a single regex and have the
> result always in $1 or always in $2. So you would test for undef in one
> and use the other.  But then the other arch regexes that capture more than
> one cluster would need to be rewritten to use (?: ) syntax to get
> clustering without capturing (see man perlre) so as to leave $2 undefined.
> 
> A list of regexes for each arch would be nice. But should probably be
> left until needed. Following is probably the simplest way. The regexes
> remain understandable to mortals since they don't do fancy stuff. And the
> other archs don't need to be touched.

It's not as ugly as my hack.  Can I get a success report from m68k?
Thanks!

> --- linux-2.6.7/Makefile	2004-06-16 13:06:15.000000000 +0200
> +++ linux-m68k-2.6.7/Makefile	2004-06-16 18:27:13.000000000 +0200
> @@ -1070,7 +1070,7 @@ endif #ifeq ($(mixed-targets),1)
>  .PHONY: checkstack
>  checkstack:
>  	$(OBJDUMP) -d vmlinux $$(find . -name '*.ko') | \
> -	$(PERL) scripts/checkstack.pl $(ARCH)
> +	$(PERL) $(src)/scripts/checkstack.pl $(ARCH)
> 
>  # FIXME Should go into a make.lib or something
>  # ===========================================================================
> --- linux-2.6.7/scripts/checkstack.pl	Thu Jun 17 18:06:18 2004
> +++ linux-m68k-2.6.7/scripts/checkstack.pl	Thu Jun 17 18:09:21 2004
> @@ -12,7 +12,7 @@
>  #	Random bits by Matt Mackall <mpm@selenic.com>
>  #
>  #	Usage:
> -#	objdump -d vmlinux | stackcheck_ppc.pl [arch]
> +#	objdump -d vmlinux | stackcheck.pl [arch]
>  #
>  #	TODO :	Port to all architectures (one regex per arch)
> 
> @@ -40,6 +40,11 @@
>  	} elsif ($arch =~ /^ia64$/) {
>  		#e0000000044011fc:       01 0f fc 8c     adds r12=-384,r12
>  		$re = qr/.*adds.*r12=-(([0-9]{2}|[3-9])[0-9]{2}),r12/o;
> +	} elsif ($arch =~ /^m68k$/) {
> +		#2b6c:       4e56 fb70       linkw %fp,#-1168
> +		$re = qr/.*linkw %fp,#-([0-9]{1,4})/o;
> +		#1df770:       defc ffe4       addaw #-28,%sp
> +		$re_2 = qr/.*addaw #-([0-9]{1,4}),%sp/o;
>  	} elsif ($arch =~ /^mips64$/) {
>  		#8800402c:       67bdfff0        daddiu  sp,sp,-16
>  		$re = qr/.*daddiu.*sp,sp,-(([0-9]{2}|[3-9])[0-9]{2})/o;
> @@ -75,7 +80,7 @@
>  	if ($line =~ m/$funcre/) {
>  		$func = $1;
>  	}
> -	if ($line =~ m/$re/) {
> +	if ($line =~ m/$re/ or (defined($re_2) && $line =~ m/$re_2/)) {
>  		my $size = $1;
>  		$size = hex($size) if ($size =~ /^0x/);

Jörn

-- 
When in doubt, punt.  When somebody actually complains, go back and fix it...
The 90% solution is a good thing.
-- Rob Landley

  reply	other threads:[~2004-06-17 18:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200406161930.VAA16618@pfultra.phil.uni-sb.de>
2004-06-17  8:43 ` Finn Thain
2004-06-17 18:36   ` Jörn Engel [this message]
2004-06-17 19:27     ` Geert Uytterhoeven
2004-06-18 12:18       ` Jörn Engel
2004-06-18 13:39         ` Geert Uytterhoeven
2004-06-18 13:43           ` Jörn Engel
2004-06-18 15:59             ` Finn Thain
2004-06-18 16:06               ` Jörn Engel

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=20040617183616.GC29029@wohnheim.fh-wedel.de \
    --to=joern@wohnheim.fh-wedel.de \
    --cc=ft01@webmastery.com.au \
    --cc=geert@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    --cc=mpm@selenic.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

all inboxes | Powered by JetHome®