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

2008/9/15 Pekka Paalanen <pq@iki.fi>:
> My other problem is with trace_pipe. It is again making 'cat' quit too
> early. The condition triggered is
>        if (!tracer_enabled && iter->pos) {
> in tracing_read_pipe(), and it is followed by triggering
>        /* stop when tracing is finished */
>        if (trace_empty(iter)) {
> and then sret=0, so read returns 0 and 'cat' exits.
>
> Now, I am trying my mmiotrace marker patches, but as far as I can tell,
> nothing I modified is the reason for this. I didn't yet explicitly test
> for it, though. I'll send these patches after I hear from Frederic.
>
> The cat-quit problem is not a constant state. After boot, I could play
> with my markers and testmmiotrace without cat quitting. Then something
> happens, and cat starts the quitting behaviour, and won't get to normal
> by disabling and enabling mmiotrace.
>
> I have a couple of wild guesses of what might be related:
> - ring buffer wrap-around
> - ring buffer overflow (at first try I hit these, the second try
> after putting debug-pr_info's in place I don't hit this)
> - ring buffer resize (after playing with trace_entries, cat-quit
> problem was present, though it might have been present before)
>
> After viewing the git history, I have some more guesses, mainly
> related to setting tracer_enabled to 0.
> - commit 2b1bce1787700768cbc87c8509851c6f49d252dc
> I don't see where tracer_enabled would be set to 1, when
> mmiotrace is enabled. It used to default to 1 and mmiotrace was happy.
> - __tracing_open() sets it to 0 (not called for the pipe)
> - tracing_release() sets it to 1
> - tracing_ctrl_write() toggles it
> - tracing_read_pipe() tests it
> - tracer_alloc_buffers() uses it
> And other tracers seem to use it a lot.
>
> Mmiotrace does use the tracer::ctrl_update hook, and allow/disallow
> calls to __trace_mmiotrace_{rw,map}() via enabling/disabling the whole
> mmiotrace core. Is this not enough, or is it inappropriate?
>
> It seems tracer_enabled is used by the trace framework itself to
> enable/disable... what? Hmm, maybe nothing I care about.
>
> Should mmiotrace simply do
>        tracer_enabled = 1;
> in mmio_trace_init()?
>
> Should mmiotrace test tracer_enabled, and if so, when?


As I said to you, I met the same bug of this early quit of the pipe.
But I should give here more details.
This bug occurs with -tip (a version pulled 2 days ago so trace.c
didn't change).
I never saw it with other tracers than mmiotrace. I had no problem
with sched_switch or function tracer.

It happened when I was writing the tracer marker. So I'm not sure if
the origin is here. If I'm not wrong it happened whithout adding mark
messages too.
Can you tell me if your pipe quits when you add a mark or if this bug
occurs on other cases too?

I will try to reproduce the bug this evening.

  parent reply	other threads:[~2008-09-16  8:58 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
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                 ` Frédéric Weisbecker [this message]
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=c62985530809160157n5ca5cfa0m1a4865aeb710a74a@mail.gmail.com \
    --to=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=pq@iki.fi \
    --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®