public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Eugene Rozenfeld <Eugene.Rozenfeld@microsoft.com>
To: Eugene Rozenfeld <Eugene.Rozenfeld@microsoft.com>,
	Sam James <sam@gentoo.org>,
	Richard Biener <richard.guenther@gmail.com>
Cc: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: RE: [EXTERNAL] Re: [PATCH] Collect both user and kernel events for autofdo tests and autoprofiledbootstrap
Date: Fri, 30 Jun 2023 22:05:48 +0000	[thread overview]
Message-ID: <DS7PR21MB347987686498DBEA5D1E2E42912AA@DS7PR21MB3479.namprd21.prod.outlook.com> (raw)
In-Reply-To: <DS7PR21MB3479A2D2BED61B40252B3A55912AA@DS7PR21MB3479.namprd21.prod.outlook.com>

I also set /proc/sys/kernel/perf_event_paranoid to 1 instead of the default 2.

-----Original Message-----
From: Gcc-patches <gcc-patches-bounces+erozen=microsoft.com@gcc.gnu.org> On Behalf Of Eugene Rozenfeld via Gcc-patches
Sent: Friday, June 30, 2023 2:44 PM
To: Sam James <sam@gentoo.org>; Richard Biener <richard.guenther@gmail.com>
Cc: gcc-patches@gcc.gnu.org
Subject: RE: [EXTERNAL] Re: [PATCH] Collect both user and kernel events for autofdo tests and autoprofiledbootstrap

I don't run this with elevated privileges but I set /proc/sys/kernel/kptr_restrict to 0. Setting that does require elevated privileges.

If that's not acceptable, the only fix I can think of is to make that event mapping threshold percentage a parameter to create_gcov and pass something low enough. 80% instead of the current threshold of 95% should work, although it's a bit fragile.

Eugene

-----Original Message-----
From: Sam James <sam@gentoo.org>
Sent: Friday, June 30, 2023 1:59 AM
To: Richard Biener <richard.guenther@gmail.com>
Cc: Eugene Rozenfeld <Eugene.Rozenfeld@microsoft.com>; gcc-patches@gcc.gnu.org
Subject: [EXTERNAL] Re: [PATCH] Collect both user and kernel events for autofdo tests and autoprofiledbootstrap

[You don't often get email from sam@gentoo.org. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]

Richard Biener via Gcc-patches <gcc-patches@gcc.gnu.org> writes:

> On Fri, Jun 30, 2023 at 7:28 AM Eugene Rozenfeld via Gcc-patches 
> <gcc-patches@gcc.gnu.org> wrote:
>>
>> When we collect just user events for autofdo with lbr we get some 
>> events where branch sources are kernel addresses and branch targets 
>> are user addresses. Without kernel MMAP events create_gcov can't make 
>> sense of kernel addresses. Currently create_gcov fails if it can't 
>> map at least 95% of events. We sometimes get below this threshold with just user events. The change is to collect both user events and kernel events.
>
> Does this require elevated privileges?  Can we instead "fix" create_gcov here?

Right, requiring privileges for this is going to be a no-go for a lot of builders. In a distro context, for example, it means we can't consider autofdo at all.

  reply	other threads:[~2023-06-30 22:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-30  5:27 Eugene Rozenfeld
2023-06-30  8:51 ` Richard Biener
2023-06-30  8:59   ` Sam James
2023-06-30 21:44     ` [EXTERNAL] " Eugene Rozenfeld
2023-06-30 22:05       ` Eugene Rozenfeld [this message]
2023-07-03  7:46         ` Richard Biener
2023-07-05 21:15           ` Eugene Rozenfeld
2023-07-06  6:23             ` Richard Biener

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=DS7PR21MB347987686498DBEA5D1E2E42912AA@DS7PR21MB3479.namprd21.prod.outlook.com \
    --to=eugene.rozenfeld@microsoft.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=richard.guenther@gmail.com \
    --cc=sam@gentoo.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).