blktrace: print human-readable act_mask
authorLi Zefan <lizf@cn.fujitsu.com>
Tue, 24 Mar 2009 09:43:30 +0000 (17:43 +0800)
committerIngo Molnar <mingo@elte.hu>
Tue, 24 Mar 2009 12:09:00 +0000 (13:09 +0100)
commit093419971e03362a00f499960557c119982ea09f
treef355954c6282bc6ee3d67f7ae374408821a216ef
parente0dc81bec0927fa0c8aabc521793161909eef7a5
blktrace: print human-readable act_mask

Impact: new feature, allow symbolic values in /debug/tracing/act_mask

Print stringified act_mask instead of hex value:

 # cat act_mask
 read,write,barrier,sync,queue,requeue,issue,complete,fs,pc,ahead,meta,
 discard,drv_data
 # echo "meta,write" > act_mask
 # cat act_mask
 write,meta

Also:
 - make act_mask accept "ahead", "meta", "discard" and "drv_data"
 - use strsep() instead of strchr() to parse user input
 - return -EINVAL if a token is not found in the mask map
 - fix a bug that 'value' is unsigned, so it can < 0
 - propagate error value of blk_trace_mask2str() to userspace, but not
   always return -ENXIO.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: Jens Axboe <jens.axboe@oracle.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
LKML-Reference: <49C8AB42.1000802@cn.fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/trace/blktrace.c