> Hi Tuma, Hi Jon, thanks for the response.
>> Anyone knows about the vtrace provider? When I was reading the code, I >> find some traces like TRACE_1, TRACE_2, etc. The comments says they're >> now replaced by Dtrace's vtrace provider, but I couldn't find any >> documents about this vtrace provider. I googled and searched on >> docs.sun, and found nothing. >> >> >> I also saw the definitions: >> >> #define TRACE_1(fac, tag, name, d1) { \ >> extern void __dtrace_probe___vtrace_##tag(ulong_t); \ >> __dtrace_probe___vtrace_##tag((ulong_t)(d1)); \ >> } >> >> But I couldn't find any __dtrace_probe___vtrace_* definitions in the >> code. Can anyone give some hints? > > Not quite sure what you mean. The TRACE_() definitions that you > cite in sys/vtrace.h are used in DEBUG kernels only. Every time you find > a TRACE_() call in the source it will be replaced with the above SDT based > probes - do a `dtrace -l -P vtrace` on a debug kernel to see the probes. On > regular, non debug kernel you won't see any vtrace probes. > > I would have thought the comment at the top of sys/vtrace.h explains > what the vtrace provider is and what its purpose is. Does this not do > it for you? > > Jon. The comments at the top of sys/vtrace.h explains the background, but doesn't state in detail how to use it. In particular, what the type and the format of the arguments are. For example, to monitor this (in uts/common/inet/ip/ip.c) TRACE_1(TR_FAC_IP, TR_IP_RPUT_START, "ip_input_start: q %p", q); I tried this script: #!/usr/sbin/dtrace -s vtrace:ip:ip_input:TR_IP_RPUT_START { trace("__ called\n"); trace(arg0); trace(arg1); trace(arg2); trace(arg3); trace(arg4); } And got: $ ./vtrace.d dtrace: script './vtrace.d' matched 1 probe CPU ID FUNCTION:NAME 16 1055 ip_input:TR_IP_RPUT_START __ called 3299361532608 2074207392 3299406004288 20289536 33554432 16 1055 ip_input:TR_IP_RPUT_START __ called 3299361532608 2074207392 3299406004288 20289536 33554432 16 1055 ip_input:TR_IP_RPUT_START __ called 3299361532608 2074207392 3299406004288 20289536 33554432 16 1055 ip_input:TR_IP_RPUT_START __ called 3299361532608 2074207392 3299406004288 20289536 33554432 16 1055 ip_input:TR_IP_RPUT_START __ called 3299361532608 2074207392 3299406004288 20289536 33554432 16 1055 ip_input:TR_IP_RPUT_START __ called 3299361532608 2074207392 3299406004288 20289536 33554432 How can I get the "q", which is queue_t? How many arguments does it have? I guess 1 or 2, but as you can see, I tried arg3 and arg4 but didn't get error or warning. Etc. Maybe experienced guys can figure out them easily, but not for me. Also, where can I find these __dtrace_probe___vtrace_* definitions? Thanks. -- Tuma _______________________________________________ dtrace-discuss mailing list dtrace-discuss@opensolaris.org