* [PATCH 1/1] trace: use the more accurate parameter.
@ 2009-02-10 0:30 Wenji Huang
2009-02-10 15:26 ` Frederic Weisbecker
0 siblings, 1 reply; 4+ messages in thread
From: Wenji Huang @ 2009-02-10 0:30 UTC (permalink / raw)
To: linux-kernel; +Cc: rostedt, Wenji Huang
Pass tsk to __update_max_tr instead of current to avoid latent hazard.
Impact: clean up
Signed-off-by: Wenji Huang <wenji.huang@oracle.com>
---
kernel/trace/trace.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 5b1e9a9..c1592f1 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -335,7 +335,7 @@ __update_max_tr(struct trace_array *tr, struct task_struct *tsk, int cpu)
data->rt_priority = tsk->rt_priority;
/* record this tasks comm */
- tracing_record_cmdline(current);
+ tracing_record_cmdline(tsk);
}
static void
--
1.5.6
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] trace: use the more accurate parameter.
2009-02-10 0:30 [PATCH 1/1] trace: use the more accurate parameter Wenji Huang
@ 2009-02-10 15:26 ` Frederic Weisbecker
2009-02-11 12:05 ` Ingo Molnar
0 siblings, 1 reply; 4+ messages in thread
From: Frederic Weisbecker @ 2009-02-10 15:26 UTC (permalink / raw)
To: Wenji Huang; +Cc: linux-kernel, rostedt, Ingo Molnar
On Mon, Feb 09, 2009 at 07:30:04PM -0500, Wenji Huang wrote:
> Pass tsk to __update_max_tr instead of current to avoid latent hazard.
>
> Impact: clean up
>
> Signed-off-by: Wenji Huang <wenji.huang@oracle.com>
> ---
> kernel/trace/trace.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
> index 5b1e9a9..c1592f1 100644
> --- a/kernel/trace/trace.c
> +++ b/kernel/trace/trace.c
> @@ -335,7 +335,7 @@ __update_max_tr(struct trace_array *tr, struct task_struct *tsk, int cpu)
> data->rt_priority = tsk->rt_priority;
>
> /* record this tasks comm */
> - tracing_record_cmdline(current);
> + tracing_record_cmdline(tsk);
> }
Indeed. At this stage, tsk is the next task in the middle of a context
switch. So I guess current is right, but this is more proper to use tsk.
> static void
> --
> 1.5.6
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] trace: use the more accurate parameter.
2009-02-10 15:26 ` Frederic Weisbecker
@ 2009-02-11 12:05 ` Ingo Molnar
2009-02-13 5:56 ` Steven Rostedt
0 siblings, 1 reply; 4+ messages in thread
From: Ingo Molnar @ 2009-02-11 12:05 UTC (permalink / raw)
To: Frederic Weisbecker; +Cc: Wenji Huang, linux-kernel, rostedt
* Frederic Weisbecker <fweisbec@gmail.com> wrote:
> On Mon, Feb 09, 2009 at 07:30:04PM -0500, Wenji Huang wrote:
> > Pass tsk to __update_max_tr instead of current to avoid latent hazard.
> >
> > Impact: clean up
> >
> > Signed-off-by: Wenji Huang <wenji.huang@oracle.com>
> > ---
> > kernel/trace/trace.c | 2 +-
> > 1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
> > index 5b1e9a9..c1592f1 100644
> > --- a/kernel/trace/trace.c
> > +++ b/kernel/trace/trace.c
> > @@ -335,7 +335,7 @@ __update_max_tr(struct trace_array *tr, struct task_struct *tsk, int cpu)
> > data->rt_priority = tsk->rt_priority;
> >
> > /* record this tasks comm */
> > - tracing_record_cmdline(current);
> > + tracing_record_cmdline(tsk);
> > }
>
>
> Indeed. At this stage, tsk is the next task in the middle of a context
> switch. So I guess current is right, but this is more proper to use tsk.
Rename it to 'next' then please.
Ingo
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] trace: use the more accurate parameter.
2009-02-11 12:05 ` Ingo Molnar
@ 2009-02-13 5:56 ` Steven Rostedt
0 siblings, 0 replies; 4+ messages in thread
From: Steven Rostedt @ 2009-02-13 5:56 UTC (permalink / raw)
To: Ingo Molnar; +Cc: Frederic Weisbecker, Wenji Huang, linux-kernel
On Wed, 11 Feb 2009, Ingo Molnar wrote:
>
> * Frederic Weisbecker <fweisbec@gmail.com> wrote:
>
> > On Mon, Feb 09, 2009 at 07:30:04PM -0500, Wenji Huang wrote:
> > > Pass tsk to __update_max_tr instead of current to avoid latent hazard.
> > >
> > > Impact: clean up
> > >
> > > Signed-off-by: Wenji Huang <wenji.huang@oracle.com>
> > > ---
> > > kernel/trace/trace.c | 2 +-
> > > 1 files changed, 1 insertions(+), 1 deletions(-)
> > >
> > > diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
> > > index 5b1e9a9..c1592f1 100644
> > > --- a/kernel/trace/trace.c
> > > +++ b/kernel/trace/trace.c
> > > @@ -335,7 +335,7 @@ __update_max_tr(struct trace_array *tr, struct task_struct *tsk, int cpu)
> > > data->rt_priority = tsk->rt_priority;
> > >
> > > /* record this tasks comm */
> > > - tracing_record_cmdline(current);
> > > + tracing_record_cmdline(tsk);
> > > }
> >
> >
> > Indeed. At this stage, tsk is the next task in the middle of a context
> > switch. So I guess current is right, but this is more proper to use tsk.
>
> Rename it to 'next' then please.
I'm sorry, I missed this comment, and only notice it because of Wenji's
latest patches.
For the __update_max_tr used by irqsoff, this is not the case. The
update_max_tr is just to make a snapshot of the latest max. The
irq/preempt latency tracers do not use the sched switch to record comms,
especially since it only cares when a new max happens. There is no concept
of a 'next' task.
I think the proper name is 'task'.
-- Steve
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-02-13 5:56 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-10 0:30 [PATCH 1/1] trace: use the more accurate parameter Wenji Huang
2009-02-10 15:26 ` Frederic Weisbecker
2009-02-11 12:05 ` Ingo Molnar
2009-02-13 5:56 ` Steven Rostedt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox