From mboxrd@z Thu Jan 1 00:00:00 1970 From: zhaolei@cn.fujitsu.com (Zhaolei) Date: Thu, 16 Oct 2008 15:46:44 +0800 Subject: [ltt-dev] [PATCH] Make ltt_trace_start return error when trace_name not exist In-Reply-To: <48F6BE52.1080202@cn.fujitsu.com> References: <48F6BE52.1080202@cn.fujitsu.com> Message-ID: <48F6F164.4020702@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 --- 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