mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Pawel Moll <pawel.moll@arm.com>
Cc: Richard Cochran <richardcochran@gmail.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ingo Molnar <mingo@redhat.com>, Paul Mackerras <paulus@samba.org>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	John Stultz <john.stultz@linaro.org>,
	Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
	Christopher Covington <cov@codeaurora.org>,
	Namhyung Kim <namhyung@kernel.org>,
	David Ahern <dsahern@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Tomeu Vizoso <tomeu@tomeuvizoso.net>,
	linux-kernel@vger.kernel.org, linux-api@vger.kernel.org
Subject: Re: [PATCH v4 2/3] perf: Userspace event
Date: Mon, 5 Jan 2015 14:12:37 +0100	[thread overview]
Message-ID: <20150105131237.GR30905@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <1415292718-19785-3-git-send-email-pawel.moll@arm.com>

On Thu, Nov 06, 2014 at 04:51:57PM +0000, Pawel Moll wrote:
> This patch adds a PR_TASK_PERF_UEVENT prctl call which can be used by
> any process to inject custom data into perf data stream as a new
> PERF_RECORD_UEVENT record, if such process is being observed or if it
> is running on a CPU being observed by the perf framework.
> 
> The prctl call takes the following arguments:
> 
>         prctl(PR_TASK_PERF_UEVENT, type, size, data, flags);
> 
> - type: a number meaning to describe content of the following data.
>   Kernel does not pay attention to it and merely passes it further in
>   the perf data, therefore its use must be agreed between the events
>   producer (the process being observed) and the consumer (performance
>   analysis tool). The perf userspace tool will contain a repository of
>   "well known" types and reference implementation of their decoders.
> - size: Length in bytes of the data.
> - data: Pointer to the data.
> - flags: Reserved for future use. Always pass zero.
> 
> Perf context that are supposed to receive events generated with the
> prctl above must be opened with perf_event_attr.uevent set to 1. The
> PERF_RECORD_UEVENT records consist of a standard perf event header,
> 32-bit type value, 32-bit data size and the data itself, followed by
> padding to align the overall record size to 8 bytes and optional,
> standard sample_id field.
> 
> Example use cases:
> 
> - "perf_printf" like mechanism to add logging messages to perf data;
>   in the simplest case it can be just
> 
>         prctl(PR_TASK_PERF_UEVENT, 0, 8, "Message", 0);
> 
> - synchronisation of performance data generated in user space with the
>   perf stream coming from the kernel. For example, the marker can be
>   inserted by a JIT engine after it generated portion of the code, but
>   before the code is executed for the first time, allowing the
>   post-processor to pick the correct debugging information.
> 

The think I remember being raised was a unified means of these msgs
across perf/ftrace/lttng. I am not seeing that mentioned.

Also, I would like a stronger rationale for the @type argument, if it
has no actual meaning why is it separate from the binary msg data?

  reply	other threads:[~2015-01-05 13:12 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-06 16:51 [PATCH v4 0/3] perf: User/kernel time correlation and event generation Pawel Moll
2014-11-06 16:51 ` [PATCH v4 1/3] perf: Use monotonic clock as a source for timestamps Pawel Moll
2014-11-27 15:05   ` Pawel Moll
2014-12-11 13:39     ` Pawel Moll
2015-01-05 13:01       ` Peter Zijlstra
2015-01-21 15:47         ` Pawel Moll
2015-01-05 13:00   ` Peter Zijlstra
2015-01-21 15:52     ` Pawel Moll
2015-01-21 19:48       ` Pawel Moll
2015-01-21 20:07         ` Pawel Moll
2015-01-16 12:41   ` Adrian Hunter
2015-01-21 20:27   ` [PATCH v5] " Pawel Moll
2015-02-02 16:52     ` Pawel Moll
     [not found]       ` <CAN+dfcT_6zZZ4oeyngUE5N0Wtx2B9CvXsfU71m+cuyXpq2KBdw@mail.gmail.com>
2015-02-03  9:20         ` Pawel Moll
2015-02-11 16:12           ` Peter Zijlstra
2015-02-12 10:04             ` Adrian Hunter
2015-02-12 10:28               ` Peter Zijlstra
2015-02-12 15:38                 ` Peter Zijlstra
2015-02-13  0:25                   ` John Stultz
2015-02-13  7:07                 ` Adrian Hunter
2014-11-06 16:51 ` [PATCH v4 2/3] perf: Userspace event Pawel Moll
2015-01-05 13:12   ` Peter Zijlstra [this message]
2015-01-21 16:01     ` Pawel Moll
2014-11-06 16:51 ` [PATCH v4 3/3] perf: Sample additional clock value Pawel Moll
2015-01-05 13:45   ` Peter Zijlstra
2015-01-05 19:17     ` John Stultz
2015-01-21 17:12     ` Pawel Moll
2015-01-21 17:44       ` John Stultz
2015-01-21 17:54         ` Pawel Moll
2015-01-21 18:05           ` John Stultz
2015-01-23 17:06     ` Pawel Moll
2015-01-23 18:05       ` David Ahern

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=20150105131237.GR30905@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=acme@kernel.org \
    --cc=cov@codeaurora.org \
    --cc=dsahern@gmail.com \
    --cc=john.stultz@linaro.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=paulus@samba.org \
    --cc=pawel.moll@arm.com \
    --cc=richardcochran@gmail.com \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=tomeu@tomeuvizoso.net \
    /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

Powered by JetHome