From: Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>
To: Jiri Olsa <jolsa@redhat.com>
Cc: Ian Rogers <irogers@google.com>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Namhyung Kim <namhyung@kernel.org>,
Andi Kleen <ak@linux.intel.com>,
linux-kernel@vger.kernel.org,
Stephane Eranian <eranian@google.com>
Subject: Re: [PATCH v2] perf tools: avoid sample_reg_masks being const + weak
Date: Mon, 30 Sep 2019 07:39:09 -0300 [thread overview]
Message-ID: <20190930103909.GA9622@kernel.org> (raw)
In-Reply-To: <20190929210514.GC602@krava>
Em Sun, Sep 29, 2019 at 11:05:14PM +0200, Jiri Olsa escreveu:
> On Fri, Sep 27, 2019 at 02:43:41PM -0700, Ian Rogers wrote:
> > Being const + weak breaks with some compilers that constant-propagate
> > from the weak symbol. This behavior is outside of the specification, but
> > in LLVM is chosen to match GCC's behavior.
> >
> > LLVM's implementation was set in this patch:
> > https://github.com/llvm/llvm-project/commit/f49573d1eedcf1e44893d5a062ac1b72c8419646
> > A const + weak symbol is set to be weak_odr:
> > https://llvm.org/docs/LangRef.html
> > ODR is one definition rule, and given there is one constant definition
> > constant-propagation is possible. It is possible to get this code to
> > miscompile with LLVM when applying link time optimization. As compilers
> > become more aggressive, this is likely to break in more instances.
> >
> > Move the definition of sample_reg_masks to the conditional part of
> > perf_regs.h and guard usage with HAVE_PERF_REGS_SUPPORT. This avoids the
> > weak symbol.
> >
> > Fix an issue when HAVE_PERF_REGS_SUPPORT isn't defined from patch v1.
> >
> > Signed-off-by: Ian Rogers <irogers@google.com>
>
> Acked-by: Jiri Olsa <jolsa@kernel.org>
Thanks, applied.
- Arnaldo
next prev parent reply other threads:[~2019-09-30 10:39 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-27 21:10 [PATCH] perf tools: avoid sample_reg_masks being const + weak Ian Rogers
2019-09-27 21:43 ` [PATCH v2] " Ian Rogers
2019-09-29 21:05 ` Jiri Olsa
2019-09-30 10:39 ` Arnaldo Carvalho de Melo [this message]
2019-09-30 12:23 ` Arnaldo Carvalho de Melo
2019-09-30 12:42 ` Jiri Olsa
2019-10-01 0:36 ` Ian Rogers
2019-10-01 0:36 ` [PATCH v3] " Ian Rogers
2019-10-07 20:49 ` Nick Desaulniers
2019-10-08 12:31 ` Jiri Olsa
2019-10-09 23:07 ` Ian Rogers
2019-10-10 12:29 ` Arnaldo Carvalho de Melo
2019-10-15 5:31 ` [tip: perf/core] perf tools: Avoid 'sample_reg_masks' " tip-bot2 for Ian Rogers
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=20190930103909.GA9622@kernel.org \
--to=arnaldo.melo@gmail.com \
--cc=ak@linux.intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=eranian@google.com \
--cc=irogers@google.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
/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).