[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150109141248.GO3337@twins.programming.kicks-ass.net>
Date: Fri, 9 Jan 2015 15:12:48 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Cc: Ingo Molnar <mingo@...hat.com>, linux-kernel@...r.kernel.org,
Robert Richter <rric@...nel.org>,
Frederic Weisbecker <fweisbec@...il.com>,
Mike Galbraith <efault@....de>,
Paul Mackerras <paulus@...ba.org>,
Stephane Eranian <eranian@...gle.com>,
Andi Kleen <ak@...ux.intel.com>, kan.liang@...el.com,
adrian.hunter@...el.com, markus.t.metzger@...el.com,
mathieu.poirier@...aro.org, acme@...radead.org
Subject: Re: [PATCH v8 14/14] perf: add ITRACE_START record to indicate that
tracing has started
On Fri, Nov 14, 2014 at 03:43:47PM +0200, Alexander Shishkin wrote:
> +++ b/include/uapi/linux/perf_event.h
> @@ -750,6 +750,17 @@ enum perf_event_type {
> */
> PERF_RECORD_AUX = 11,
>
> + /*
> + * Indicates that instruction trace has started
> + *
> + * struct {
> + * struct perf_event_header header;
> + * u32 pid;
> + * u32 tid;
The below function suggests we should have:
struct sample_id sample_id;
> + * };
> + */
> + PERF_RECORD_ITRACE_START = 12,
> +
> PERF_RECORD_MAX, /* non-ABI */
> };
> +static void perf_log_itrace_start(struct perf_event *event)
> +{
> + struct perf_output_handle handle;
> + struct perf_sample_data sample;
> + struct perf_aux_event {
> + struct perf_event_header header;
> + u32 pid;
> + u32 tid;
> + } rec;
> + int ret;
> +
> + if (event->parent)
> + event = event->parent;
> +
> + if (!(event->pmu->capabilities & PERF_PMU_CAP_ITRACE) ||
> + event->hw.itrace_started)
> + return;
> +
> + event->hw.itrace_started = 1;
> +
> + rec.header.type = PERF_RECORD_ITRACE_START;
> + rec.header.misc = 0;
> + rec.header.size = sizeof(rec);
> + rec.pid = perf_event_pid(event, current);
> + rec.tid = perf_event_tid(event, current);
> +
> + perf_event_header__init_id(&rec.header, &sample, event);
> + ret = perf_output_begin(&handle, event, rec.header.size);
> +
> + if (ret)
> + return;
> +
> + perf_output_put(&handle, rec);
> + perf_event__output_id_sample(event, &handle, &sample);
> +
> + perf_output_end(&handle);
> +}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists