diff options
author | Li Zefan <lizf@cn.fujitsu.com> | 2009-03-19 21:48:03 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-03-21 11:16:13 -0400 |
commit | 5006ea73f38caef6065d1136808413813271633f (patch) | |
tree | 296d4f15e625303cdd111f29d990cef3c3be85c5 /kernel/trace/blktrace.c | |
parent | 1a17662ea033674a58bad3603531b0b5d42572f6 (diff) |
blktrace: make blk_tracer_enabled a bool flag
It doesn't have to be a counter, and it can be a bool flag instead.
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <49C2F5D3.8090104@cn.fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/trace/blktrace.c')
-rw-r--r-- | kernel/trace/blktrace.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c index fb3bc53835dd..73845b7968bb 100644 --- a/kernel/trace/blktrace.c +++ b/kernel/trace/blktrace.c | |||
@@ -30,7 +30,7 @@ | |||
30 | static unsigned int blktrace_seq __read_mostly = 1; | 30 | static unsigned int blktrace_seq __read_mostly = 1; |
31 | 31 | ||
32 | static struct trace_array *blk_tr; | 32 | static struct trace_array *blk_tr; |
33 | static int __read_mostly blk_tracer_enabled; | 33 | static bool blk_tracer_enabled __read_mostly; |
34 | 34 | ||
35 | /* Select an alternative, minimalistic output than the original one */ | 35 | /* Select an alternative, minimalistic output than the original one */ |
36 | #define TRACE_BLK_OPT_CLASSIC 0x1 | 36 | #define TRACE_BLK_OPT_CLASSIC 0x1 |
@@ -1111,9 +1111,7 @@ static int blk_tracer_init(struct trace_array *tr) | |||
1111 | { | 1111 | { |
1112 | blk_tr = tr; | 1112 | blk_tr = tr; |
1113 | blk_tracer_start(tr); | 1113 | blk_tracer_start(tr); |
1114 | mutex_lock(&blk_probe_mutex); | 1114 | blk_tracer_enabled = true; |
1115 | blk_tracer_enabled++; | ||
1116 | mutex_unlock(&blk_probe_mutex); | ||
1117 | return 0; | 1115 | return 0; |
1118 | } | 1116 | } |
1119 | 1117 | ||
@@ -1131,11 +1129,7 @@ static void blk_tracer_reset(struct trace_array *tr) | |||
1131 | if (!atomic_read(&blk_probes_ref)) | 1129 | if (!atomic_read(&blk_probes_ref)) |
1132 | return; | 1130 | return; |
1133 | 1131 | ||
1134 | mutex_lock(&blk_probe_mutex); | 1132 | blk_tracer_enabled = false; |
1135 | blk_tracer_enabled--; | ||
1136 | WARN_ON(blk_tracer_enabled < 0); | ||
1137 | mutex_unlock(&blk_probe_mutex); | ||
1138 | |||
1139 | blk_tracer_stop(tr); | 1133 | blk_tracer_stop(tr); |
1140 | } | 1134 | } |
1141 | 1135 | ||