Re: [PATCH RFC 02/30] ext4: snapshot debugging support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 7 Jun 2011, Amir G. wrote:

> >
> >> +#define snapshot_test_delay_progress(i, from, to, max)                       \
> >> +     do {                                                            \
> >> +             if (snapshot_enable_test[i] &&                          \
> >> +                             (max) > snapshot_enable_test[i] &&      \
> >> +                             (from) <= (to) && (to) <= (max)) {      \
> >> +                     unsigned long blocks_per_ms =                   \
> >> +                             do_div((max), snapshot_enable_test[i]); \
> >> +                     unsigned long x = do_div((from), blocks_per_ms);\
> >> +                     unsigned long y = do_div((to), blocks_per_ms);  \
> >> +                     if (y > x)                                      \
> >> +                             msleep_interruptible(y - x);            \
> >> +             }                                                       \
> >> +     } while (0)
> >> +
> >> +#define snapshot_debug_l(n, l, f, a...)                                      \
> >> +     do {                                                            \
> >> +             if ((n) <= snapshot_enable_debug &&                     \
> >> +                 (l) <= SNAPSHOT_INDENT_MAX) {                       \
> >> +                     printk(KERN_DEBUG "snapshot: %s" f,             \
> >> +                            snapshot_indent - (l),                   \
> >> +                                ## a);                               \
> >> +             }                                                       \
> >> +     } while (0)
> >
> > This can be done by tracepoints maybe ?
> 
> can you add a generic string arg to a tracepoint?

Yes, you can print whatever you want with  tracepoint printk. See
include/trace/events/ext4.h, Documentation/trace/tracepoints.txt and
Documentation/trace/tracepoints-analysis.txt

Thanks!
-Lukas

[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux