Re: [RFC][PATCH 2/3] perf: Take a hot regs snapshot for traceevents

From: Steven Rostedt
Date: Wed Mar 03 2010 - 11:06:36 EST


On Wed, 2010-03-03 at 07:55 +0100, Frederic Weisbecker wrote:

> +/*
> * Output
> */
> static bool perf_output_space(struct perf_mmap_data *data, unsigned long tail,
> @@ -4337,6 +4347,8 @@ static const struct pmu perf_ops_task_clock = {
> void perf_tp_event(int event_id, u64 addr, u64 count, void *record,
> int entry_size)
> {
> + struct pt_regs regs;
> +
> struct perf_raw_record raw = {
> .size = entry_size,
> .data = record,
> @@ -4347,14 +4359,11 @@ void perf_tp_event(int event_id, u64 addr, u64 count, void *record,
> .raw = &raw,
> };
>
> - struct pt_regs *regs = get_irq_regs();
> -
> - if (!regs)
> - regs = task_pt_regs(current);
> + PERF_SAVE_REGS(&regs);
>
> /* Trace events already protected against recursion */
> do_perf_sw_event(PERF_TYPE_TRACEPOINT, event_id, count, 1,
> - &data, regs);
> + &data, &regs);

Off-topic: Why is the above a perf sw event? Couldn't that also be a
normal TRACE_EVENT()?

-- Steve

> }
> EXPORT_SYMBOL_GPL(perf_tp_event);
>


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/