Thank you all for your advice.
I will try to use cmn_err.
Also i tried using systemtap - but  i dont know why it is not probing to
some of the functions.

e.g:
i tried following command : stap -d spl -e 'probe
module("z*").function("*[*.c]") {printf("Called ## %s ##\n", probefunc());
print_backtrace();}'

it printed many probes - but it didnt say that it called important
functions like : dmu_read_uio() (printk says it does call)
I am trying to understand how zfs pipeline works and how taskq_thread gets
work

Thanks a lot for help

Regards
Punit



On Wed, Dec 11, 2013 at 10:15 AM, Ned Bass <[email protected]> wrote:

> I think those errors must come from the user-space build, which doesn't
> know about printk.  In source that is built in both kernel and user
> space you generally need to surround printk's with
>
> #ifdef _KERNEL
> #endif
>
> As Saso points out, cmn_err() is the appropriate debug message interface
> if you wanted to get your patch merged.  But for a throw-away debug
> patch, printk may be more convenient on Linux because it avoids having
> to deal with the SPL debug log infrastructure.
>
> Ned
>
> On Tue, Dec 10, 2013 at 01:47:28PM -0800, Punit Mutha wrote:
> > hello,
> > i have a naive doubt about adding printk in zfs module.
> >
> >
> > i am trying to add debug statements in zfs code and
> >
> > facing this weird compiler error.
> >
> > .../../module/zfs/dmu.c: In function ?dmu_object_size_from_db?:
> > .../../module/zfs/dmu.c:2006: error: ?KERN_INFO? undeclared (first use
> in this
> > function)
> > .../../module/zfs/dmu.c:2006: error: expected ?)? before string constant
> > .../../module/zfs/dmu.c:2018: error: expected ?)? before string constant
> >
> > so it is complaining about usage of printk in dmu.c
> >
> > but it didnt complained about printk usage in zvol.c
> >
> > as far as i see there are no difference in compilation flags.
> >
> > google search tells that i need to include /lib/modules in makefile..
> >
> > but i think all arguments are same for zvol.c and that for dmu.c
> >
> > Regards
> > Punit
>
> > _______________________________________________
> > developer mailing list
> > [email protected]
> > http://lists.open-zfs.org/mailman/listinfo/developer
>
>
_______________________________________________
developer mailing list
[email protected]
http://lists.open-zfs.org/mailman/listinfo/developer

Reply via email to