mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: "Enderborg, Peter" <Peter.Enderborg@sony.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@redhat.com>
Subject: Re: [PATCH] trace: Return ENOTCONN instead of EBADF
Date: Mon, 12 Oct 2020 10:45:09 -0400	[thread overview]
Message-ID: <20201012104509.6ae404d5@gandalf.local.home> (raw)
In-Reply-To: <55b99d8d-f75a-e095-63fa-3d5df8b77f1b@sony.com>

On Mon, 12 Oct 2020 14:26:48 +0000
"Enderborg, Peter" <Peter.Enderborg@sony.com> wrote:

> On 10/12/20 3:53 PM, Steven Rostedt wrote:
> > On Mon, 12 Oct 2020 10:26:42 +0200
> > Peter Enderborg <peter.enderborg@sony.com> wrote:
> >  
> >> When there is no clients listening on event the trace return
> >> EBADF. The file is not a bad file descriptor and to get the
> >> userspace able to do a proper error handling it need a different
> >> error code that separate a bad file descriptor from a empty listening.  
> > I have no problem with this patch, but your description is incorrect. And
> > before making this change, I want to make sure that what you think is
> > happening is actually happening.
> >
> > This has nothing to do with "clients listening". This happens when the ring
> > buffer is disabled for some reason. The most likely case of this happening
> > is if someone sets /sys/kernel/tracing/tracing_on to zero.  
> 
> I see that as no one is listening. You start to listen by setting this tracing on
> some instance, but that is for trace_pipe. Is it the same flag for raw access and all ways you
> can invoke a trace?

I don't know what you mean by "setting this tracing on some instance".

When you boot up, who is listening? tracing_on is enabled. But there's no
listener.


> 
> Would
> 
> "When there is no instances listening on events the trace return

What instance are you talking about? What do you think needs to be
listening. And no, trace_pipe plays zero role in this.

> EBADF, it is when the tracing_on is off globally. The file is not a bad file
> descriptor and to get the userspace able to do a proper error handling it need a different
> error code that separate a bad file descriptor from a empty listening."
> 
> be a ok?
> 

No. Because I don't understand any of the above!

There's no a producer / consumer here. It's a read / write enabled or
disabled. If the ring buffer is disabled from write, and you try to write
to the ring buffer, you get an error.

Basically, it's the same analogy as trying to write to a read-only file.
Perhaps the proper error is EPERM.

-- Steve

      reply	other threads:[~2020-10-12 14:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-12  8:26 Peter Enderborg
2020-10-12 13:53 ` Steven Rostedt
2020-10-12 14:26   ` Enderborg, Peter
2020-10-12 14:45     ` Steven Rostedt [this message]

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=20201012104509.6ae404d5@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=Peter.Enderborg@sony.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    /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®