On 2019/4/2 下午5:34, Johannes Thumshirn wrote: > On 02/04/2019 10:45, Qu Wenruo wrote: >> OK, after some though, the overhead for a new tracepoint is pretty small. >> The only overhead when the tracepoint is disabled is, a ktimer_get_ns() >> call at the beginning of btrfs_tree_lock() and btrfs_tree_read_lock(). > > If you only need the ktime_get_ns() call for the tracepoint, you can > wrap it in sth. like this IIRC: > > if (trace_btrfs_tree_lock_enabled()) > start_time = ktime_get_ns(); > > [...] > > trace_btrfs_tree_lock(start_time, end_time); Oh, I just get your email seconds after I send out my initial patch. This helps a lot! I'll update the patch. Thanks, Qu > > Byte, > Johannes >
