Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 09 Feb 2013 17:27:17 +0200
From:      Andriy Gapon <avg@FreeBSD.org>
To:        Chris Rees <utisoft@gmail.com>
Cc:        freebsd-arch@FreeBSD.org
Subject:   Re: Proposal: Unify printing the function name in panic messages()
Message-ID:  <51166AD5.4090707@FreeBSD.org>
In-Reply-To: <CADLo83_HfA4FGR0xNzHpPNPGee3QHG3PB8ZQVXGci=TvOB6kZQ@mail.gmail.com>
References:  <51141E33.4080103@gmx.de> <511426B8.2070800@FreeBSD.org> <51160E06.1070404@gmx.de> <5116121E.1010601@FreeBSD.org> <511616AC.8080306@gmx.de> <511622A2.2090601@FreeBSD.org> <CADLo83_HfA4FGR0xNzHpPNPGee3QHG3PB8ZQVXGci=TvOB6kZQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
on 09/02/2013 12:46 Chris Rees said the following:
> 
> On 9 Feb 2013 10:19, "Andriy Gapon" <avg@freebsd.org <mailto:avg@freebsd.org>>
> wrote:
>>
>> on 09/02/2013 11:28 Christoph Mallon said the following:
>> > On 09.02.2013 10:08, Andriy Gapon wrote:
>> >> In any case, you just search the code for the message and that's it.
>> >
>> > Often the messages contains parameters (%d, %s, ...) or are split into
> multiple lines to appease the ancient 80 columns god.
>> > These make it harder to grep.
>> > Having the /right/ name makes it easier to get to the right place.
>>
>> Having right tools for the search does that too.
>> And doesn't require any code churn.
> 
> OK, which tool can one find a panic message split across lines in source code? 
> I would find this very useful.

http://grok.x12.su/source/search?q=%22offset+below+first+LBA%22&project=freebsd

Generally, I like opengrok very much.  Pity that we don't have an official
server.  fxr.watson.org is great, but opengrok is superior to glimpse.
E.g. try the same kind of search here: http://fxr.watson.org/fxr/search

BTW, a local version (slower because no index is used):
$ pcregrep -r -M 'offset\W*below\W*first\W*LBA' sys/
sys/geom/part/g_part.c:                 DPRINTF("partition %d has start offset
below first "
                            "LBA: %jd < %jd\n", e1->gpe_index,
pcregrep comes from devel/pcre.

P.S. my first instinct was to try git grep first, git grep seems to support perl
regular expressions in general, but it looks like the port doesn't include the
necessary support:
fatal: cannot use Perl-compatible regexes when not compiled with USE_LIBPCRE

P.P.S. I must say that I use textproc/glimpse (with index weekly updated via
cron) and in 99% of cases glimpse 'something' immediately returns useful
results.  It's quite rare that I have to use other tools for searching the code.
I use vim + ctags too :-)

-- 
Andriy Gapon



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?51166AD5.4090707>