lib ring buffer frontend: add missing lock initialization
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 21 Sep 2011 14:08:34 +0000 (10:08 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 21 Sep 2011 14:08:34 +0000 (10:08 -0400)
[...]
while enabling the events, I get following output:

[ 4304.827819] BUG: spinlock bad magic on CPU#1, ltt-sessiond/1305
[ 4304.841735]  lock: 81453c00, .magic: 00000000, .owner: <none>/-1,
.owner_cpu: 0
[ 4304.857421] [<800110ad>] (unwind_backtrace+0x1/0x90) from
[<8022c847>] (do_raw_spin_lock+0x17/0xfc)
[ 4304.875213] [<8022c847>] (do_raw_spin_lock+0x17/0xfc) from
[<7f97c30f>] (channel_create+0xd6/0x158 [lib_ring_buffer])
[ 4304.894866] [<7f97c30f>] (channel_create+0xd6/0x158
[lib_ring_buffer]) from [<7f99856b>] (_channel_create+0x28/0x32
[ltt_ring_buffer_client_discard])
[ 4304.917755] [<7f99856b>] (_channel_create+0x28/0x32
[ltt_ring_buffer_client_discard]) from [<7f98b507>]
(ltt_channel_create+0x12a/0x190 [ltt_relay])
[ 4304.940551] [<7f98b507>] (ltt_channel_create+0x12a/0x190 [ltt_relay])
from [<7f98c34b>] (lttng_abi_create_channel+0xba/0x158 [ltt_relay])
[ 4304.962341] [<7f98c34b>] (lttng_abi_create_channel+0xba/0x158
[ltt_relay]) from [<7f98c43f>] (lttng_session_ioctl+0x56/0x64 [ltt_relay])
[ 4304.984436] [<7f98c43f>] (lttng_session_ioctl+0x56/0x64 [ltt_relay])
from [<800baa49>] (do_vfs_ioctl+0x1a5/0x1dc)
[ 4305.004394] [<800baa49>] (do_vfs_ioctl+0x1a5/0x1dc) from [<800baab3>]
(sys_ioctl+0x33/0x4c)
[ 4305.022369] [<800baab3>] (sys_ioctl+0x33/0x4c) from [<8000c2c1>]
(ret_fast_syscall+0x1/0x50)
All kernel events are enabled in channel channel0

Reported-by: Avik Sil <avik.sil@linaro.org>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
lib/ringbuffer/ring_buffer_frontend.c

index 3003dd8324458ee62c8e99460b295bc3ab8e481d..a45373b062d4bd5ae95b0519170b0c9e51224961 100644 (file)
@@ -1702,3 +1702,11 @@ int lib_ring_buffer_reserve_slow(struct lib_ring_buffer_ctx *ctx)
        return 0;
 }
 EXPORT_SYMBOL_GPL(lib_ring_buffer_reserve_slow);
+
+void __init init_lib_ring_buffer_frontend(void)
+{
+       int cpu;
+
+       for_each_possible_cpu(cpu)
+               spin_lock_init(&per_cpu(ring_buffer_nohz_lock, cpu));
+}
This page took 0.027999 seconds and 4 git commands to generate.