From: zhaolei@cn.fujitsu.com (Zhaolei)
Subject: [ltt-dev] [PATCH] Make ltt_trace_start return error when trace_name not exist
Date: Thu, 16 Oct 2008 15:46:44 +0800 [thread overview]
Message-ID: <48F6F164.4020702@cn.fujitsu.com> (raw)
In-Reply-To: <48F6BE52.1080202@cn.fujitsu.com>
Hi Mathieu,
I find ltt_trace_start don't return error when trace_name is not exist.
So, when we use lttctl -s to start no-exist channel, it will not print
any errormsg:
# ls /mnt/debugfs/ltt/
# lttctl -n zltest -s
Linux Trace Toolkit Trace Control 0.54-10102008
Controlling trace : zltest
# ls /mnt/debugfs/ltt/
#
It can be fixed by following patch, I tested patched kernel with following command:
# ls /mnt/debugfs/ltt/
# lttctl -n zltest -s
Linux Trace Toolkit Trace Control 0.54-10102008
Controlling trace : zltest
Start Trace Error: No such file or directory
#
Signed-off-by: Zhaolei <zhaolei at cn.fujitsu.com>
---
ltt/ltt-tracer.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/ltt/ltt-tracer.c b/ltt/ltt-tracer.c
index 0d0423d..bc8251b 100644
--- a/ltt/ltt-tracer.c
+++ b/ltt/ltt-tracer.c
@@ -641,9 +641,10 @@ static int ltt_trace_start(char *trace_name)
ltt_lock_traces();
trace = _ltt_trace_find(trace_name);
- if (trace == NULL)
- goto no_trace;
err = _ltt_trace_start(trace);
+ if (err) {
+ goto no_trace;
+ }
ltt_unlock_traces();
--
1.5.5.3
prev parent reply other threads:[~2008-10-16 7:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-16 4:08 [ltt-dev] [PATCH] make lttctl select channel_root in debugfs automatically Zhaolei
2008-10-16 7:46 ` Zhaolei [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=48F6F164.4020702@cn.fujitsu.com \
--to=zhaolei@cn.fujitsu.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