* Subject: Re: make checkstack on m68k [not found] <200406161930.VAA16618@pfultra.phil.uni-sb.de> @ 2004-06-17 8:43 ` Finn Thain 2004-06-17 18:36 ` Jörn Engel 0 siblings, 1 reply; 8+ messages in thread From: Finn Thain @ 2004-06-17 8:43 UTC (permalink / raw) To: Geert Uytterhoeven, Linux/m68k, Matt Mackall, Linux Kernel Development [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #1: Type: TEXT/PLAIN; charset=X-UNKNOWN, Size: 2986 bytes --] 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. -F --- 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/); ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Subject: Re: make checkstack on m68k 2004-06-17 8:43 ` Subject: Re: make checkstack on m68k Finn Thain @ 2004-06-17 18:36 ` Jörn Engel 2004-06-17 19:27 ` Geert Uytterhoeven 0 siblings, 1 reply; 8+ messages in thread From: Jörn Engel @ 2004-06-17 18:36 UTC (permalink / raw) To: Finn Thain Cc: Geert Uytterhoeven, Linux/m68k, Matt Mackall, Linux Kernel Development, Jörn Engel 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 ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Subject: Re: make checkstack on m68k 2004-06-17 18:36 ` Jörn Engel @ 2004-06-17 19:27 ` Geert Uytterhoeven 2004-06-18 12:18 ` Jörn Engel 0 siblings, 1 reply; 8+ messages in thread From: Geert Uytterhoeven @ 2004-06-17 19:27 UTC (permalink / raw) To: Jörn Engel Cc: Finn Thain, Linux/m68k, Matt Mackall, Linux Kernel Development On Thu, 17 Jun 2004, [iso-8859-1] Jörn Engel wrote: > On Thu, 17 June 2004 18:43:18 +1000, Finn Thain wrote: > > 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! Works. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Subject: Re: make checkstack on m68k 2004-06-17 19:27 ` Geert Uytterhoeven @ 2004-06-18 12:18 ` Jörn Engel 2004-06-18 13:39 ` Geert Uytterhoeven 0 siblings, 1 reply; 8+ messages in thread From: Jörn Engel @ 2004-06-18 12:18 UTC (permalink / raw) To: Geert Uytterhoeven Cc: Finn Thain, Linux/m68k, Matt Mackall, Linux Kernel Development On Thu, 17 June 2004 21:27:35 +0200, Geert Uytterhoeven wrote: > On Thu, 17 Jun 2004, [iso-8859-1] Jörn Engel wrote: > > > > It's not as ugly as my hack. Can I get a success report from m68k? > > Thanks! Good. Finn, can you resend to me with a signed-off-by: comment? If you grow bored, you could seperate the i386 regexes (sub..., add...) as well. Jörn -- Mundie uses a textbook tactic of manipulation: start with some reasonable talk, and lead the audience to an unreasonable conclusion. -- Bruce Perens ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Subject: Re: make checkstack on m68k 2004-06-18 12:18 ` Jörn Engel @ 2004-06-18 13:39 ` Geert Uytterhoeven 2004-06-18 13:43 ` Jörn Engel 0 siblings, 1 reply; 8+ messages in thread From: Geert Uytterhoeven @ 2004-06-18 13:39 UTC (permalink / raw) To: Jörn Engel Cc: Finn Thain, Linux/m68k, Matt Mackall, Linux Kernel Development On Fri, 18 Jun 2004, [iso-8859-1] Jörn Engel wrote: > On Thu, 17 June 2004 21:27:35 +0200, Geert Uytterhoeven wrote: > > On Thu, 17 Jun 2004, [iso-8859-1] Jörn Engel wrote: > > > > > > It's not as ugly as my hack. Can I get a success report from m68k? > > > Thanks! > > Good. Finn, can you resend to me with a signed-off-by: comment? If > you grow bored, you could seperate the i386 regexes (sub..., add...) > as well. If you insist... Add m68k support to checkstack.pl Regular expression combination by Andres Schwab Signed-off-by: geert@linux-m68k.org --- linux-2.6.7/scripts/checkstack.pl 2004-06-09 14:51:23.000000000 +0200 +++ linux-m68k-2.6.7/scripts/checkstack.pl 2004-06-17 21:31:45.000000000 +0200 @@ -40,6 +40,10 @@ } 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 + # 1df770: defc ffe4 addaw #-28,%sp + $re = qr/.*(?:linkw %fp,|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; Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Subject: Re: make checkstack on m68k 2004-06-18 13:39 ` Geert Uytterhoeven @ 2004-06-18 13:43 ` Jörn Engel 2004-06-18 15:59 ` Finn Thain 0 siblings, 1 reply; 8+ messages in thread From: Jörn Engel @ 2004-06-18 13:43 UTC (permalink / raw) To: Geert Uytterhoeven Cc: Finn Thain, Linux/m68k, Matt Mackall, Linux Kernel Development On Fri, 18 June 2004 15:39:38 +0200, Geert Uytterhoeven wrote: > On Fri, 18 Jun 2004, [iso-8859-1] Jörn Engel wrote: > > On Thu, 17 June 2004 21:27:35 +0200, Geert Uytterhoeven wrote: > > > On Thu, 17 Jun 2004, [iso-8859-1] Jörn Engel wrote: > > > > > > > > It's not as ugly as my hack. Can I get a success report from m68k? > > > > Thanks! > > > > Good. Finn, can you resend to me with a signed-off-by: comment? If > > you grow bored, you could seperate the i386 regexes (sub..., add...) > > as well. > > If you insist... > > Add m68k support to checkstack.pl > > Regular expression combination by Andres Schwab Ah, no. I really wanted Finn's version with two seperate regexes, it's much cleaner. An array of regexes might be the best, but in a perfect world, we would have compiler support instead, so I don't mind a little ugliness. Jörn -- Courage is not the absence of fear, but rather the judgement that something else is more important than fear. -- Ambrose Redmoon ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Subject: Re: make checkstack on m68k 2004-06-18 13:43 ` Jörn Engel @ 2004-06-18 15:59 ` Finn Thain 2004-06-18 16:06 ` Jörn Engel 0 siblings, 1 reply; 8+ messages in thread From: Finn Thain @ 2004-06-18 15:59 UTC (permalink / raw) To: Jörn Engel Cc: Geert Uytterhoeven, Linux/m68k, Matt Mackall, Linux Kernel Development [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #1: Type: TEXT/PLAIN; charset=X-UNKNOWN, Size: 1297 bytes --] On Fri, 18 Jun 2004, [iso-8859-1] Jörn Engel wrote: > On Fri, 18 June 2004 15:39:38 +0200, Geert Uytterhoeven wrote: > > On Fri, 18 Jun 2004, [iso-8859-1] Jörn Engel wrote: > > > > > Good. Finn, can you resend to me with a signed-off-by: comment? If > > > you grow bored, you could seperate the i386 regexes (sub..., add...) > > > as well. > > > > If you insist... > > > > Add m68k support to checkstack.pl > > > > Regular expression combination by Andres Schwab > > Ah, no. I really wanted Finn's version with two seperate regexes, > it's much cleaner. An array of regexes might be the best, but in a > perfect world, we would have compiler support instead, so I don't mind > a little ugliness. Jörn, the best thing about my hack was that it didn't interfere with the regexes for the other archs. Andreas better solved that problem by providing the result in $1, by using some foreknowlegde of the objdump output format. I whole-heartedly endorse the signed-off-by-Geert and provided-by-Andreas patch on the basis of even less interference with the existing code. i.e. http://lkml.org/lkml/2004/6/18/104 But, if you really want my patch, I'll provide it here as well as the m68k lists... but really, Andreas did a much nicer job given that the assembler is generated by objdump. -F ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Subject: Re: make checkstack on m68k 2004-06-18 15:59 ` Finn Thain @ 2004-06-18 16:06 ` Jörn Engel 0 siblings, 0 replies; 8+ messages in thread From: Jörn Engel @ 2004-06-18 16:06 UTC (permalink / raw) To: Finn Thain Cc: Geert Uytterhoeven, Linux/m68k, Matt Mackall, Linux Kernel Development On Sat, 19 June 2004 01:59:27 +1000, Finn Thain wrote: > > Jörn, the best thing about my hack was that it didn't interfere with the > regexes for the other archs. Andreas better solved that problem by > providing the result in $1, by using some foreknowlegde of the objdump > output format. > > I whole-heartedly endorse the signed-off-by-Geert and provided-by-Andreas > patch on the basis of even less interference with the existing code. i.e. > > http://lkml.org/lkml/2004/6/18/104 Hmm, convinced. My perl skills were simply not good enough to see through all the tricks. Patch is accepted, I'll integrate and forward after the weekend. Jörn -- "Error protection by error detection and correction." -- from a university class ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2004-06-18 16:09 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <200406161930.VAA16618@pfultra.phil.uni-sb.de>
2004-06-17 8:43 ` Subject: Re: make checkstack on m68k Finn Thain
2004-06-17 18:36 ` Jörn Engel
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
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®