public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Szabolcs Nagy <szabolcs.nagy@arm.com>
To: Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org>
Cc: <nd@arm.com>, Torsten Duwe <duwe@suse.de>,
	Li Bin	<huawei.libin@huawei.com>, Jiri Kosina <jkosina@suse.cz>,
	GCC Patches	<gcc-patches@gcc.gnu.org>,
	Marcus Shawcroft <Marcus.Shawcroft@arm.com>,
	Takahiro Akashi <takahiro.akashi@linaro.org>
Subject: Re: [PATCH] add -fprolog-pad=N option to c-family
Date: Thu, 28 Apr 2016 10:58:00 -0000	[thread overview]
Message-ID: <5721ECD1.6090708@arm.com> (raw)
In-Reply-To: <7134BE21-ACFB-4C45-871A-FADFA2973040@linaro.org>

On 28/04/16 09:47, Maxim Kuvyrkov wrote:
>> On Apr 27, 2016, at 7:26 PM, Szabolcs Nagy <szabolcs.nagy@arm.com> wrote:
>>
>> with -mfentry, by default the user only has to
>> implement the fentry call (linux wants nops there, but
>> e.g. glibc could use -pg -mfentry for profiling on
>> aarch64 and the target specific details are easier to
>> document for an -m option than for something general).
> 
> I don't understand your point here, could you elaborate, please?
> 

if we only provide -mfentry then

- the kernel can use it (they have tools to nop patch the binary),

- others who don't want to fiddle with nops, just have the call,
can also use it (e.g. user-space profiling cannot really use
something that needs binary patching in case the user prefers
-pg -mfentry over the current -pg behaviour).

- it's target specific, so the magic abi of the fentry call can
be documented by the target according to the specific instruction
sequence that is used. (with nop-padding there are psabi and
compiler optimization interactions that may be hard to document
in a generic way and letting the user figure it out may cause
problems later in compiler development.. but i'm just speculating
based on the powerpc toc handling and ipa-ra findings.)

>> the nop-padding is more general, but the size and
>> layout of nops and the call abi will be target
>> specific and the user will most likely need to modify
>> the binary (to get the right sequence) which needs
>> additional tooling.  i don't know who might use it
>> other than linux (which already has tools to deal with
>> -mfentry).
> 
> Right, but this tooling will require minimal (if any) changes
> to be adapted to nop-pad approach.  If I remember correctly,
> recent versions of GCC and kernel for x86_64 generate NOPs,
> not the call sequence in the prologs when -mfentry is used.

i'm trying to find where this happens in the kernel, but
i only see scripts/recordmcount.{c,pl} which are based on
nop patching the fentry/mcount call sites.

without such call sites the tools have to be implemented
differently and the way the kernel records the call site
positions might not match the prolog-pad recording.

  reply	other threads:[~2016-04-28 10:58 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-27 15:22 Torsten Duwe
2016-04-27 16:26 ` Szabolcs Nagy
2016-04-28  8:48   ` Maxim Kuvyrkov
2016-04-28 10:58     ` Szabolcs Nagy [this message]
2016-04-28 11:32       ` Torsten Duwe
2016-05-09  5:53       ` AKASHI Takahiro
2016-09-29 15:18     ` [PATCH v2] " Torsten Duwe
2016-09-30  9:59       ` Jose E. Marchesi
2016-09-30 10:22         ` Torsten Duwe
2016-10-03  9:45         ` AKASHI Takahiro
2016-10-04 21:46       ` Maxim Kuvyrkov
2016-12-06 14:02         ` Maxim Kuvyrkov
2016-04-28  8:40 ` [PATCH] " Maxim Kuvyrkov
2016-04-28 11:18   ` Torsten Duwe
2016-04-28 15:07     ` Jeff Law

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=5721ECD1.6090708@arm.com \
    --to=szabolcs.nagy@arm.com \
    --cc=Marcus.Shawcroft@arm.com \
    --cc=duwe@suse.de \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=huawei.libin@huawei.com \
    --cc=jkosina@suse.cz \
    --cc=maxim.kuvyrkov@linaro.org \
    --cc=nd@arm.com \
    --cc=takahiro.akashi@linaro.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 read-only IMAP folder(s) and NNTP newsgroup(s).