linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vladislav Valtchev <vladislav.valtchev@gmail.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: y.karadz@gmail.com, linux-trace-devel@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/3] trace-cmd: Remove the die() call from read_proc()
Date: Tue, 16 Jan 2018 17:04:50 +0200	[thread overview]
Message-ID: <1516115090.12026.24.camel@gmail.com> (raw)
In-Reply-To: <20180112104355.01ea2c86@gandalf.local.home>

On Fri, 2018-01-12 at 10:43 -0500, Steven Rostedt wrote:
> 
> But you need to handle the error cases for the users of read_proc().
> From the previous patch:
> 
>  static void change_stack_tracer_status(int new_status)
>  {
> 	char buf[1];
> 	int status;
> 	int fd;
> 	int n;
>  
> 	if (read_proc(&status) > 0 && status == new_status)
> 		return; /* nothing to do */
> 
> We should not continue if read_proc() fails. Should move the die here:
> 
> 	ret = read_proc(&status);
> 	if (ret < 0)
> 		die("error reading %s", PROC_FILE);
> 
> 	if (ret > 0 && status == new_status)
> 		return; /* nothing to do */
> 
> -- Steve
> 

You're totally right. I overlooked at this detail.

-- 
Vladislav Valtchev
VMware Open Source Technology Center

  reply	other threads:[~2018-01-16 15:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-21 15:25 [PATCH v2 0/3] trace-cmd: Integrate stack tracer status in 'stat' Vladislav Valtchev (VMware)
2017-12-21 15:25 ` [PATCH v2 1/3] trace-cmd: Make read_proc() to return int status via OUT arg Vladislav Valtchev (VMware)
2018-01-12 15:13   ` Steven Rostedt
2018-01-16 14:47     ` Vladislav Valtchev
2018-01-16 16:27       ` Steven Rostedt
2018-01-16 18:49         ` Vladislav Valtchev
2018-01-16 19:34           ` Steven Rostedt
2017-12-21 15:25 ` [PATCH v2 2/3] trace-cmd: Remove the die() call from read_proc() Vladislav Valtchev (VMware)
2018-01-12 15:43   ` Steven Rostedt
2018-01-16 15:04     ` Vladislav Valtchev [this message]
2017-12-21 15:25 ` [PATCH v2 3/3] trace-cmd: Making stat to report when the stack tracer is ON Vladislav Valtchev (VMware)
2018-01-12 15:47   ` Steven Rostedt

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=1516115090.12026.24.camel@gmail.com \
    --to=vladislav.valtchev@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=y.karadz@gmail.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;
as well as URLs for NNTP newsgroup(s).