Re: [PATCH v7 03/17] tracing: add MIPS specific trace_clock_local()

From: David Daney
Date: Tue Nov 10 2009 - 12:49:43 EST


Wu Zhangjin wrote:
[...]
+ * trace_clock_local(): the simplest and least coherent tracing clock.
+ *
+ * Useful for tracing that does not cross to other CPUs nor
+ * does it go through idle events.
+ */
+u64 trace_clock_local(void)
+{
+ unsigned long flags;
+ u64 clock;
+
+ raw_local_irq_save(flags);
+
+ clock = mips_timecounter_read();
+
+ raw_local_irq_restore(flags);
+
+ return clock;
+}

Why disable interrupts?

Also you call the new function mips_timecounter_read(). Since sched_clock() is a weak function, you can override the definition with a more accurate version when possible. Then you could just directly call it here, instead of adding the new mips_timecounter_read() that the '[PATCH v7 02/17] tracing: add mips_timecounter_read() for MIPS' adds.

David Daney
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/