mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pekka Paalanen <pq@iki.fi>
To: "Steven Rostedt" <rostedt@goodmis.org>
Cc: "Frédéric Weisbecker" <fweisbec@gmail.com>,
	"Ingo Molnar" <mingo@elte.hu>,
	"Linux Kernel" <linux-kernel@vger.kernel.org>
Subject: Re: Tracing/ftrace: trouble with trace_entries and trace_pipe
Date: Wed, 17 Sep 2008 20:36:09 +0300	[thread overview]
Message-ID: <20080917203609.71470e4b@daedalus.pq.iki.fi> (raw)
In-Reply-To: <c62985530809170541p5bdcbfb4xf21232842e7b8b9@mail.gmail.com>

On Wed, 17 Sep 2008 14:41:29 +0200
"Frédéric Weisbecker" <fweisbec@gmail.com> wrote:

> 2008/9/16 Pekka Paalanen <pq@iki.fi>:
> > Ok, so the problem is probably the commit I mentioned. It makes the
> > no_tracer tracer to set tracer_enabled to 0, and I can't find where
> > it would be set to 1 for mmiotrace. And this interferes with
> > tracing_read_pipe(), making it quit when iter->pos is non-zero.
> > See no_trace_init() in trace.c. According to this, the cat-quit
> > occurs when the buffer gets empty after first data, but this isn't
> > totally in agreement with what I recall from my experiments. And it
> > does happen also on other times than injecting markers.
> >
> > So either it is wrong to check tracer_enabled in tracing_read_pipe(),
> > or no_trace_init() should not touch it.
> 
> Indeed that could be the problem.
> None_tracer is chosen as the default tracer when the tracer engine
> loads. But actually no_trace_init is not called at this time.
> 
> But if you set another tracer and reset current_tracer to none, you
> will call no_trace_init. Since tracer_enabled is not reset to 1 with
> other tracer's init functions, the problem occurs when you choose one
> more time another tracer.

Ah, this would explain the "non-deterministic" behaviour I saw.

> I think that mmiotrace receives a smaller flow of entries (depends on
> the debugged module) whereas sched_switch or function's tracer, as an
> example, are continuously fed and never enter the "while
> (trace_empty(iter))" block. That's why I only see this bug in
> mmiotrace.

Mmiotrace does see times, when there are a small number of events
coming, even when tracing a graphics driver. Sounds plausible.

> Perhaps it would be a good idea to reenable tracer_enabled on
> tracing_set_trace_write() just before calling the init callback of the
> tracer chosen.

That's a third option, yes.

Steven, what is the correct fix?

Frederic, thank you very much for testing this!

-- 
Pekka Paalanen
http://www.iki.fi/pq/

  reply	other threads:[~2008-09-17 17:36 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-24 21:42 [Patch] Tracing/ftrace: Adds a marker to allow user comments Frédéric Weisbecker
2008-08-25  8:44 ` Ingo Molnar
2008-08-25 13:59   ` Frédéric Weisbecker
2008-08-25 16:38     ` Steven Rostedt
2008-08-25 17:52       ` Frédéric Weisbecker
2008-08-27  9:59 ` Frédéric Weisbecker
2008-08-27 18:21   ` Pekka Paalanen
2008-08-28  9:44     ` Ingo Molnar
2008-08-28 16:03       ` Frédéric Weisbecker
2008-08-28 10:04     ` Frédéric Weisbecker
2008-08-28 18:42       ` Pekka Paalanen
2008-09-04 16:20         ` Frédéric Weisbecker
2008-09-04 17:30           ` Pekka Paalanen
2008-09-04 18:11             ` Steven Rostedt
2008-09-06 11:39               ` Frédéric Weisbecker
2008-09-06 13:49                 ` Pekka Paalanen
2008-09-15 19:47               ` Tracing/ftrace: trouble with trace_entries and trace_pipe Pekka Paalanen
2008-09-15 21:14                 ` Steven Rostedt
2008-09-16 18:01                   ` Pekka Paalanen
2008-09-17 12:41                     ` Frédéric Weisbecker
2008-09-17 17:36                       ` Pekka Paalanen [this message]
2008-09-16 18:54                   ` [PATCH 1/7] x86 mmiotrace: fix a rare memory leak Pekka Paalanen
2008-09-16 18:56                     ` [PATCH 2/7] ftrace: move mmiotrace functions out of trace.c Pekka Paalanen
2008-09-16 18:58                     ` [PATCH 3/7] ftrace: add trace_vprintk() Pekka Paalanen
2008-09-16 20:06                       ` Steven Rostedt
2008-09-17 11:42                         ` Ingo Molnar
2008-09-16 19:00                     ` [PATCH 4/7] x86 mmiotrace: implement mmiotrace_printk() Pekka Paalanen
2008-09-16 19:02                     ` [PATCH 5/7] mmiotrace: handle TRACE_PRINT entries Pekka Paalanen
2008-09-16 20:11                       ` Steven Rostedt
2008-09-16 21:24                         ` Pekka Paalanen
2008-09-16 19:03                     ` [PATCH 6/7] mmiotrace: remove left-over marker cruft Pekka Paalanen
2008-09-16 19:06                     ` [PATCH 7/7] ftrace: inject markers via trace_marker file Pekka Paalanen
2008-09-16  8:57                 ` Tracing/ftrace: trouble with trace_entries and trace_pipe Frédéric Weisbecker
2008-09-07 14:11             ` [Patch] Tracing/ftrace: Adds a marker to allow user comments Pekka Paalanen
2008-09-07 17:29               ` Steven Rostedt
2008-09-08 17:19                 ` Pekka Paalanen

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=20080917203609.71470e4b@daedalus.pq.iki.fi \
    --to=pq@iki.fi \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rostedt@goodmis.org \
    /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

all inboxes | Powered by JetHome®