lkml.org 
[lkml]   [2010]   [Mar]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC][PATCH 2/3] perf: Take a hot regs snapshot for trace events
From
Date
On Wed, 2010-03-03 at 11:06 -0500, Steven Rostedt wrote:
> 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()?

Well, no, this is the stuff that transforms TRACE_EVENT() into perf
software events ;-)



\
 
 \ /
  Last update: 2010-03-03 17:41    [W:0.083 / U:7.856 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site