Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(291)

Issue 4601050: [pph] New script to reproduce failures from a .log file (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 11 months ago by Diego Novillo
Modified:
12 years, 10 months ago
Reviewers:
aoliva
CC:
Gabriel Charette, Lawrence Crowl, gcc-patches_gcc.gnu.org
Visibility:
Public.

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+49 lines, -0 lines) Patch
A contrib/repro_fail View 1 chunk +49 lines, -0 lines 0 comments Download

Messages

Total messages: 4
Diego Novillo
This small script searches for the spawn line corresponding to a given grep pattern inside ...
12 years, 11 months ago (2011-06-09 17:49:13 UTC) #1
Lawrence Crowl
On 6/9/11, Diego Novillo <dnovillo@google.com> wrote: > This small script searches for the spawn line ...
12 years, 11 months ago (2011-06-09 20:48:46 UTC) #2
Diego Novillo
On Thu, Jun 9, 2011 at 13:48, Lawrence Crowl <crowl@google.com> wrote: > > line=$(sed -e ...
12 years, 11 months ago (2011-06-09 21:27:35 UTC) #3
aoliva_redhat.com
12 years, 11 months ago (2011-06-10 04:45:43 UTC) #4
On Jun  9, 2011, Lawrence Crowl <crowl@google.com> wrote:

> On 6/9/11, Diego Novillo <dnovillo@google.com> wrote:
>> +args="$@"

I'd keep args in "$@" and use "$@" instead of $args, so as to avoid
quoting issues.

>> +line=$(grep "^spawn .*$pattern" $logf | sed -e "s:^spawn ::")

> line=$(sed -e "/^spawn .*$pattern/ ! d ; s/^spawn //" $logf)

> Has one fewer process and one fewer pipe.  Sed is your friend.

I'd have written sed -n "s/^spawn \(.*$pattern\)/\1/p", but I'm not sure
it's more efficient.

It would be wise to first quote slashes in the pattern:

pattern=`echo "$pattern" | sed 's:/:\\/:g'`

>> +if [ "$line" = "" ] ; then

[ -z "$line" ]

Thanks, Diego,

-- 
Alexandre Oliva, freedom fighter    http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/   FSF Latin America board member
Free Software Evangelist      Red Hat Brazil Compiler Engineer
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b