linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Adrian Hunter <adrian.hunter@intel.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>,
	Ian Rogers <irogers@google.com>,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH RFC 1/5] perf: Add ioctl to emit sideband events
Date: Tue, 18 Apr 2023 09:29:59 +0300	[thread overview]
Message-ID: <d6a66fd3-b70a-3649-e13e-b3bd891de853@intel.com> (raw)
In-Reply-To: <20230417105727.GG83892@hirez.programming.kicks-ass.net>

On 17/04/23 13:57, Peter Zijlstra wrote:
> On Fri, Apr 14, 2023 at 11:22:56AM +0300, Adrian Hunter wrote:
>> perf tools currently read /proc to get this information, but that
>> races with changes made by the kernel.
>>
>> Add an ioctl to output status-only sideband events for a currently
>> active event on the current CPU. Using timestamps, these status-only
>> sideband events will be correctly ordered with respect to "real"
>> sideband events.
>>
>> The assumption is a user will:
>> 	- open and enable a dummy event to track sideband events
>> 	- call the new ioctl to get sideband information for currently
>> 	  running processes as needed
>> 	- enable the remaining selected events
>>
>> The initial sideband events to be supported will be: fork, namespaces, comm
>> and mmap.
>>
>> Add a new misc flag PERF_RECORD_MISC_STATUS_ONLY to differentiate "real"
>> sideband events from status-only sideband events.
>>
>> The limitation that the event must be active is significant. The ioctl
>> caller must either:
>> 	i)  For a CPU context, set CPU affinity to the correct CPU.
>> 	    Note, obviously that would not need to be done for system-wide
>> 	    tracing on all CPUs. It would also only need to be done for the
>> 	    period of tracing when the ioctl is to be used.
>> 	ii) Use an event opened for the current process on all CPUs.
>> 	    Note, if such an additional event is needed, it would also use
>> 	    additional memory from the user's perf_event_mlock_kb /
>> 	    RLIMIT_MEMLOCK limit.
> 
> Why would a single per-task event not work? I see nothing in the code
> that would require a per-task-per-cpu setup. Or am I just having trouble
> reading again?

Sorry, "all CPUS" should have been "cpu=-1"


  reply	other threads:[~2023-04-18  6:30 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-14  8:22 [PATCH RFC 0/5] perf: Add ioctl to emit sideband events Adrian Hunter
2023-04-14  8:22 ` [PATCH RFC 1/5] " Adrian Hunter
2023-04-17 10:57   ` Peter Zijlstra
2023-04-18  6:29     ` Adrian Hunter [this message]
2023-04-14  8:22 ` [PATCH RFC 2/5] perf: Add fork to the sideband ioctl Adrian Hunter
2023-04-14  8:22 ` [PATCH RFC 3/5] perf: Add namespaces " Adrian Hunter
2023-04-14  8:22 ` [PATCH RFC 4/5] perf: Add comm " Adrian Hunter
2023-04-14  8:23 ` [PATCH RFC 5/5] perf: Add mmap " Adrian Hunter
2023-04-17 11:02 ` [PATCH RFC 0/5] perf: Add ioctl to emit sideband events Peter Zijlstra
2023-04-17 16:37   ` Ian Rogers
2023-04-18  7:03     ` Adrian Hunter
2023-04-18  6:18   ` Adrian Hunter
2023-04-18 13:36     ` Adrian Hunter
2023-04-18 15:51       ` 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=d6a66fd3-b70a-3649-e13e-b3bd891de853@intel.com \
    --to=adrian.hunter@intel.com \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --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).