linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ian Rogers <irogers@google.com>
To: Tiezhu Yang <yangtiezhu@loongson.cn>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>,
	linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org
Subject: Re: [PATCH] tools: perf: Use "grep -E" instead of "egrep"
Date: Mon, 21 Nov 2022 08:52:47 -0800	[thread overview]
Message-ID: <CAP-5=fWtFktYKch+4Sv4zSHoW8SO96yEsyQgDKApyR20UjXhSA@mail.gmail.com> (raw)
In-Reply-To: <ab41b1fe-4a59-2a6b-ee9f-785c98c48df5@loongson.cn>

On Sun, Nov 20, 2022 at 6:59 PM Tiezhu Yang <yangtiezhu@loongson.cn> wrote:
>
>
>
> On 11/20/2022 02:17 AM, Ian Rogers wrote:
> > On Fri, Nov 18, 2022 at 1:17 AM Tiezhu Yang <yangtiezhu@loongson.cn> wrote:
> >>
> >> The latest version of grep claims the egrep is now obsolete so the build
> >> now contains warnings that look like:
> >>         egrep: warning: egrep is obsolescent; using grep -E
> >> fix this up by moving the related file to use "grep -E" instead.
> >>
> >>   sed -i "s/egrep/grep -E/g" `grep egrep -rwl tools/perf`
> >>
> >> Here are the steps to install the latest grep:
> >>
> >>   wget http://ftp.gnu.org/gnu/grep/grep-3.8.tar.gz
> >>   tar xf grep-3.8.tar.gz
> >>   cd grep-3.8 && ./configure && make
> >>   sudo make install
> >>   export PATH=/usr/local/bin:$PATH
> >>
> >> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
> >
> > Hi Tiezhu,
> >
> > installing a newer grep tool in order to build/test perf is somewhat
> > burdensome, as such I don't think we should merge this change. Looking
> > at my Debian derived distro. I have grep 3.7, so I'd need to do this.
> > I imagine the majority of people are using a grep earlier than 3.8. I
> > agree there is a problem perhaps we can:
> >  - rewrite to just need grep and not egrep;
> >  - rewrite in a stable language with regex support, perhaps python;
> >  - have a grep/egrep wrapper that selects based on version number.
> >
>
> Hi Ian,
>
> I found this issue on Linux From Scratch system which uses grep 3.8 [0],
> we can see the following NEWS in grep-3.8 release announcement [1]:
>
> "The egrep and fgrep commands, which have been deprecated since
>   release 2.5.3 (2007), now warn that they are obsolescent and should
>   be replaced by grep -E and grep -F."
>
> Additionally, the next grep rpm/deb version is 3.8 on Fedora [2]
> and Debian [3], so use "grep -E" instead of "egrep" so we won't see
> the warning for various versions of grep.
>
> [0] https://linuxfromscratch.org/~thomas/multilib/chapter06/grep.html
> [1] https://savannah.gnu.org/forum/forum.php?forum_id=10227
> [2] https://packages.fedoraproject.org/pkgs/grep/grep/fedora-rawhide.html
> [3] https://packages.debian.org/sid/grep
>
> Thanks,
> Tiezhu

Thanks Tiezhu,

My grep is 3.7 and has -E support. In the changelog I see:

```
2021-08-14  Jim Meyering  <meyering@fb.com>

       version 3.7
       * NEWS: Record release date.
```

So I'm guessing 3.8 is newer than is necessary for this change, but
demonstrates the warning issue your change addresses. Arnaldo's build
compatibility scripts should be able to spot further issues.

Acked-by: Ian Rogers <irogers@google.com>

Thanks,
Ian

  reply	other threads:[~2022-11-21 16:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-18  9:16 [PATCH] tools: perf: Use "grep -E" instead of "egrep" Tiezhu Yang
2022-11-19 18:17 ` Ian Rogers
2022-11-21  2:58   ` Tiezhu Yang
2022-11-21 16:52     ` Ian Rogers [this message]
2022-11-21 17:05       ` David Laight
2022-12-14 16:27       ` Arnaldo Carvalho de Melo

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='CAP-5=fWtFktYKch+4Sv4zSHoW8SO96yEsyQgDKApyR20UjXhSA@mail.gmail.com' \
    --to=irogers@google.com \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=yangtiezhu@loongson.cn \
    /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;
as well as URLs for NNTP newsgroup(s).