From: Prakash Surya Date: Wed, 22 Aug 2012 19:30:59 +0000 (-0700) Subject: Wrap trace_set_debug_header in trace_[get|put]_tcd X-Git-Tag: zfs-0.8.0-rc1~152^2~366 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9baf44bc17ddbc01dae4feacda32e04aac73f730;p=zfs Wrap trace_set_debug_header in trace_[get|put]_tcd To properly support CONFIG_PREEMPT enabled kernels, we must refrain from using a CPU index when preemption is enabled. As a result, this change moves the trace_set_debug_header call (which calls smp_processor_id) within trace_get_tcd and trace_put_tcd (which disable and enable preemption respectively). Signed-off-by: Prakash Surya Signed-off-by: Brian Behlendorf Closes #160 --- diff --git a/module/spl/spl-debug.c b/module/spl/spl-debug.c index 4bcc34a8e..0dd59db56 100644 --- a/module/spl/spl-debug.c +++ b/module/spl/spl-debug.c @@ -686,9 +686,8 @@ spl_debug_msg(void *arg, int subsys, int mask, const char *file, if (strchr(file, '/')) file = strrchr(file, '/') + 1; - trace_set_debug_header(&header, subsys, mask, line, 0); - tcd = trace_get_tcd(); + trace_set_debug_header(&header, subsys, mask, line, 0); if (tcd == NULL) goto console;