From: Greg Kurz <groug@kaod.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Eric Blake <eblake@redhat.com>,
QEMU Developers <qemu-devel@nongnu.org>,
Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] trace: fix group name generation
Date: Sun, 16 Oct 2016 11:20:52 +0200 [thread overview]
Message-ID: <20161016112052.4942a79e@bahia> (raw)
In-Reply-To: <CAFEAcA8sbF1P38k0b0igqcVtJa=2fVk0vuqH2YwNc6EJyir3CA@mail.gmail.com>
On Sat, 15 Oct 2016 13:03:10 +0100
Peter Maydell <peter.maydell@linaro.org> wrote:
> On 14 October 2016 at 23:06, Greg Kurz <groug@kaod.org> wrote:
> > On Fri, 14 Oct 2016 16:31:01 -0500
> > Eric Blake <eblake@redhat.com> wrote:
> >
> >> On 10/14/2016 04:26 PM, Greg Kurz wrote:
> >> > Since commit "80dd5c4918ab trace: introduce a formal group name for trace
> >> > events", tracetool generates C variable names and macro definitions out
> >> > of the path to the trace-events-all file.
>
> >> > diff --git a/scripts/tracetool.py b/scripts/tracetool.py
> >> > index 629b2593c846..b81b834db924 100755
> >> > --- a/scripts/tracetool.py
> >> > +++ b/scripts/tracetool.py
> >> > @@ -70,7 +70,7 @@ def make_group_name(filename):
> >> >
> >> > if dirname == "":
> >> > return "common"
> >> > - return re.sub(r"/|-", "_", dirname)
> >> > + return "_" + re.sub(r"[^\w]", "_", dirname)
> >>
> >> This STILL doesn't solve the complaint that the build is now dependent
> >> on the location. Why can't we STRIP off any prefix prior to the in-tree
> >> portion of the naming that we know is sane, instead of munging the
> >> prefix but in the process creating source code that generates with
> >> different lengths?
> >>
> >
> > Heh, because the complaint was about the build break :)
> >
> >> Ideally, compiling twice, once in directory 'a', and the second time in
> >> directory 'aaaaaaaaaaaaaaaaaaaaaaaaaaaa', should not make a noticeable
> >> difference in the final size of the executable due to the difference in
> >> lengths of the debugging symbols used to record the longer name of the
> >> second directory being encoded into lots of macro names.
> >>
> >
> > You're right. I'm okay to look for a way to fix the symbol variable size
> > issue, but I think this patch still makes sense as it makes tracetool
> > less fragile in case we add a directory with an illegal character to
> > the QEMU tree... and it fixes annoying build breaks (Paolo also hit
> > this and asked to revert 80dd5c4918ab in another mail).
>
> I agree with Eric that we should just not be putting
> the build directory name in these variables -- this
> looks like it's simply a bug to me, and we should fix it.
>
As I was saying in the previous mail, I also agree with Eric :)
And it isn't even about the variable size of the debugging info,
but rather about the random names of the generated symbols...
> I think the chances of us adding a directory to the QEMU
> tree itself with a silly name are quite low (not least because
> if you do that then you get a handy build failure to tell
> you not to do that ;-))
>
Fair enough, even if the error is a bit obscure at first sight... and
we already have a silly named directory (9pfs), which would be supported
with a leading '_'... but hopefully, it is not at the top level ;)
> thanks
> -- PMM
Cheers.
--
Greg
next prev parent reply other threads:[~2016-10-16 9:21 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-14 21:26 [Qemu-devel] [PATCH] trace: fix group name generation Greg Kurz
2016-10-14 21:31 ` Eric Blake
2016-10-14 22:06 ` Greg Kurz
2016-10-15 12:03 ` Peter Maydell
2016-10-16 9:20 ` Greg Kurz [this message]
2016-10-18 15:16 ` Daniel P. Berrange
2016-10-18 15:31 ` Daniel P. Berrange
2016-10-18 15:52 ` Greg Kurz
2016-10-20 14:25 ` Stefan Hajnoczi
2016-11-17 8:07 ` Fam Zheng
2016-11-17 9:10 ` Greg Kurz
2016-11-17 9:34 ` Fam Zheng
2016-11-17 9:48 ` Greg Kurz
2016-11-17 10:00 ` Fam Zheng
2016-11-17 10:05 ` Stefan Hajnoczi
2016-10-18 15:36 ` Greg Kurz
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=20161016112052.4942a79e@bahia \
--to=groug@kaod.org \
--cc=eblake@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.