This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 1/5] Add gcc-auto-profile script
- From: Bernhard Reutner-Fischer <rep dot dot dot nop at gmail dot com>
- To: Andi Kleen <andi at firstfloor dot org>,gcc-patches at gcc dot gnu dot org
- Cc: Andi Kleen <ak at linux dot intel dot com>
- Date: Sat, 21 May 2016 19:58:02 +0200
- Subject: Re: [PATCH 1/5] Add gcc-auto-profile script
- Authentication-results: sourceware.org; auth=none
- References: <1463848586-19259-1-git-send-email-andi at firstfloor dot org> <1463848586-19259-2-git-send-email-andi at firstfloor dot org>
On May 21, 2016 6:36:22 PM GMT+02:00, Andi Kleen <andi@firstfloor.org> wrote:
>From: Andi Kleen <ak@linux.intel.com>
>+if [ "$1" = "--kernel" ] ; then
>+ FLAGS=k
>+ shift
>+fi
>+if [ "$1" == "--all" ] ; then
== is legacy, s/==/=/
>+ FLAGS=uk
>+ shift
>+fi
>+
>+if ! grep -q Intel /proc/cpuinfo ] ; then
>+ echo >&2 "Only Intel CPUs supported"
>+ exit 1
>+fi
>+
>+if grep -q hypervisor /proc/cpuinfo ; then
>+ echo >&2 "Warning: branch profiling may not be functional in VMs"
>+fi
grep && echo would do but OK.
>+
>+case `egrep -q "^cpu family\s*: 6" /proc/cpuinfo &&
>+ egrep "^model\s*:" /proc/cpuinfo | head -1` in'''
head and tail both require -n nowadays (in fact since susv2, IIRC), so please head -n1
thanks,