From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54817) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c7JUR-0003Dj-CR for qemu-devel@nongnu.org; Thu, 17 Nov 2016 05:00:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c7JUM-0008Fq-Hc for qemu-devel@nongnu.org; Thu, 17 Nov 2016 05:00:19 -0500 Received: from mx1.redhat.com ([209.132.183.28]:38646) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c7JUM-0008FY-9a for qemu-devel@nongnu.org; Thu, 17 Nov 2016 05:00:14 -0500 Date: Thu, 17 Nov 2016 18:00:10 +0800 From: Fam Zheng Message-ID: <20161117100010.GD2058@lemon> References: <147648037766.14770.15179642645810274907.stgit@bahia> <20161018151646.GI12728@redhat.com> <20161018153124.GB15199@redhat.com> <20161018175200.48a2d3cc@bahia> <20161020142520.GB2733@stefanha-x1.localdomain> <20161117080738.GB2058@lemon> <20161117101026.77534496@bahia> <20161117093444.GC2058@lemon> <20161117104834.314dc73d@bahia> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20161117104834.314dc73d@bahia> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] trace: fix group name generation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Greg Kurz Cc: Stefan Hajnoczi , qemu-devel@nongnu.org, Peter Maydell On Thu, 11/17 10:48, Greg Kurz wrote: > On Thu, 17 Nov 2016 17:34:44 +0800 > Fam Zheng wrote: >=20 > > On Thu, 11/17 10:10, Greg Kurz wrote: > > > On Thu, 17 Nov 2016 16:07:38 +0800 > > > Fam Zheng wrote: > > > =20 > > > > On Thu, 10/20 15:25, Stefan Hajnoczi wrote: =20 > > > > > >=20 > > > > > > I have two other patches ready to fix the current situation: > > > > > > - one using os.getcwd() to guess the build directory > > > > > > - one implementing --group as mentioned in my other mail > > > > > >=20 > > > > > > But the one that filters unwanted characters is a less intrus= ive > > > > > > workaround. =20 > > > > >=20 > > > > > If Dan's patches will eliminate the issue then we can take a wo= rkaround. > > > > >=20 > > > > > Any more comments about Greg's patch before I merge it? =20 > > > >=20 > > > > Should we include this in -rc1? I still see a build error today. > > > >=20 > > > > Fam > > > > =20 > > >=20 > > > Hi Fam, > > >=20 > > > My patch was partly superseded by this commit: > > >=20 > > > commit 630b210b9abbf362905a2096c22c5eb1d6224e77 > > > Author: Stefan Weil > > > Date: Thu Oct 13 20:29:30 2016 +0200 > > >=20 > > > Fix build for less common build directories names > > >=20 > > > which does: > > >=20 > > > - return re.sub(r"/|-", "_", dirname) > > > + return re.sub(r"[^A-Za-z0-9]", "_", dirname) > > >=20 > > > What is the build error you're hitting ? =20 > >=20 > > The substracted parts (basedir and dirname) are different paths for o= ut-of-tree > > build, and the "dirname" after the nonsense substraction as fed into = re.sub() > > could still start with a number. In my case the source is at > >=20 > > /var/tmp/aaa-qemu-clone > >=20 > > and the build dir is > >=20 > > /var/tmp/qemu-aio-poll-v2 > >=20 > > Then I get an error as: > >=20 > > trace/generated-tracers.c:15950:13: error: invalid suffix "_trace_eve= nts" on integer constant > > TraceEvent *2_trace_events[] =3D { > > ^ > > trace/generated-tracers.c:15950:13: error: expected identifier or =E2= =80=98(=E2=80=99 before numeric constant > > trace/generated-tracers.c: In function =E2=80=98trace_2_register_even= ts=E2=80=99: > > trace/generated-tracers.c:17949:32: error: invalid suffix "_trace_eve= nts" on integer constant > > trace_event_register_group(2_trace_events); > > ^ > > make: *** [trace/generated-tracers.o] Error 1 >=20 > My patch was addressing this as well... it is unfortunate it got dumped= . :-\ >=20 > I guess the following should be enough to fix your issue... but I'm no = tracetool > expert and I cannot assure it doesn't break anything elsewhere... >=20 > - return re.sub(r"[^A-Za-z0-9]", "_", dirname) > + return "_" + re.sub(r"[^A-Za-z0-9]", "_", dirname) Yes that does make a workaround for me. Fam