]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Wrap trace_set_debug_header in trace_[get|put]_tcd
authorPrakash Surya <surya1@llnl.gov>
Wed, 22 Aug 2012 19:30:59 +0000 (12:30 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 23 Aug 2012 17:01:20 +0000 (10:01 -0700)
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 <surya1@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #160

module/spl/spl-debug.c

index 4bcc34a8ef62ebce56706c64d83077b93ce3400a..0dd59db56e69ab6cbb60d08d154b390c29d4b12b 100644 (file)
@@ -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;