From: zhaolei@cn.fujitsu.com (Zhaolei)
Subject: [ltt-dev] [PATCH v2] Remove ltt-armall/disarmall's unwanted errormessages
Date: Tue, 21 Oct 2008 09:52:37 +0800 [thread overview]
Message-ID: <71884B8733CE4A86A121CC6EB43C9EFB@zhaoleiwin> (raw)
In-Reply-To: <20081020155223.GC28562@Krystal>
Mathieu wrote:
>> > How about :
>> >
>> > echo "connect $a default dynamic $CHANNEL" 2>&1 >/proc/ltt
>> >
>> > and then use $? as error value ?
>> >
>> > (try issuing "echo $?" just after the failing command)
>> Actually, I considered about return value, but if other kind of error
>> happened, I think it is better to show errormsg to user.
>> If we judge on return value, user will see "Already connect" if other
>> error happened.
>>
>> Judge on "write error: File exists" maybe little iffy, but on worst case,
>> it will show whole errormessage to user(maybe the best choose).
>>
>
> Can you have a quick look at other debugfs, sysfs/procfs files to see
> how they handle this kind of situation ? I feel using the text returned
> as error value is not very standard.
>
I tried following commands to see how other proc-based control doing:
#echo AA >/proc/sys/kernel/printk
-bash: echo: write error: Invalid argument
# echo AA > /proc/sys/net/ipv4/ip_forward
-bash: echo: write error: Invalid argument
They are same as lttng when user's input is wrong.
So I think lttng's /proc implement is ok.
But I think it may be difficult to get return value of sys_write in shell-script.
(We can only see $?=1 on any kind of error)
And I haven't find other shell-scripts who handle this kind of situation.
Sorry, but until now, I think we have following choice:
1: use errout string
2: write ltt-armall in C to check return value.
Thanks!
> Thanks,
>
> Mathieu
>
>> Thanks!
>> >
>> > Maybe we could also get rid of the "echo: write error: File exists" by
>> > returning a more appropriate error value from the write system call ?
>>
>>
>> >
>> > Mathieu
>> >
>>
>
> --
> Mathieu Desnoyers
> OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
>
>
prev parent reply other threads:[~2008-10-21 1:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-17 3:28 [ltt-dev] [PATCH v2] Remove ltt-armall/disarmall's unwanted error messages Zhaolei
[not found] ` <20081017040033.GA5067@Krystal>
2008-10-17 4:14 ` [ltt-dev] [PATCH v2] Remove ltt-armall/disarmall's unwanted errormessages Zhaolei
[not found] ` <20081020155223.GC28562@Krystal>
2008-10-21 1:52 ` 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=71884B8733CE4A86A121CC6EB43C9EFB@zhaoleiwin \
--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