Sumit Gupta
2007-May-10 17:11 UTC
[dtrace-discuss] printf type functionality from kernel sdt probes
Is there any way to get printf type functionality inside the kernel from dtrace probes. Basically I want to dump progress through flow in my device driver. Something like: DTRACE_PRINTF("Inside chip reset, mailboxes %x %x %x %x %x %x %x %x", mb1, mb2, .....); ... ... DTRACE_PRINTF("reset failed: reason %s", failure_reasons[err]); I may have several such probes and they may change very frequently during the development. The dtrace script to enable these probes and dump values can be very simple and will just enable all the probes inside my device driver. Thanks Sumit -- This message posted from opensolaris.org
James Carlson
2007-May-10 17:22 UTC
[dtrace-discuss] printf type functionality from kernel sdt probes
Sumit Gupta writes:> Is there any way to get printf type functionality inside the kernel from dtrace probes. Basically I want to dump progress through flow in my device driver. Something like: > > DTRACE_PRINTF("Inside chip reset, mailboxes %x %x %x %x %x %x %x %x", mb1, mb2, .....); > ... > ... > DTRACE_PRINTF("reset failed: reason %s", failure_reasons[err]); > > I may have several such probes and they may change very frequently during the development. The dtrace script to enable these probes and dump values can be very simple and will just enable all the probes inside my device driver.dtrace != printf You could look into sdt probes, which look like this: DTRACE_PROBE2(chip__reset, mailbox_t *, mb1, mailbox_t *, mb2); ... but it sounds like what you really want is either cmn_err or just plain old printf. Those functions are still there, still work fine, and aren''t going away. I''d suggest that if you''re not planning to embrace the dtrace way of doing things (separating out instrumentation from presentation), then you might be barking up the wrong tree. -- James Carlson, Solaris Networking <james.d.carlson at sun.com> Sun Microsystems / 1 Network Drive 71.232W Vox +1 781 442 2084 MS UBUR02-212 / Burlington MA 01803-2757 42.496N Fax +1 781 442 1677
Michael Schuster
2007-May-10 17:22 UTC
[dtrace-discuss] printf type functionality from kernel sdt probes
Sumit Gupta wrote:> Is there any way to get printf type functionality inside the kernel from dtrace probes. Basically I want to dump progress through flow in my device driver. Something like: > > DTRACE_PRINTF("Inside chip reset, mailboxes %x %x %x %x %x %x %x %x", mb1, mb2, .....); > ... > ... > DTRACE_PRINTF("reset failed: reason %s", failure_reasons[err]); > > I may have several such probes and they may change very frequently during the development. The dtrace script to enable these probes and dump values can be very simple and will just enable all the probes inside my device driver.IMO, you need to do the recording of data in your probes and the printf''ing in your consumer, ie the DTrace script. HTH Michael -- Michael Schuster Recursion, n.: see ''Recursion''
Chip Bennett
2007-May-10 18:50 UTC
[dtrace-discuss] printf type functionality from kernel sdt probes
Sure sounds like to me you''re real question is: "How do I record my own data." and the answer is "USDT probes", which is documented in the manual in chapter .... just a minute .... 34, Statically Defined Tracing for User Applications. Chip Sumit Gupta wrote:> Is there any way to get printf type functionality inside the kernel from dtrace probes. Basically I want to dump progress through flow in my device driver. Something like: > > DTRACE_PRINTF("Inside chip reset, mailboxes %x %x %x %x %x %x %x %x", mb1, mb2, .....); > ... > ... > DTRACE_PRINTF("reset failed: reason %s", failure_reasons[err]); > > I may have several such probes and they may change very frequently during the development. The dtrace script to enable these probes and dump values can be very simple and will just enable all the probes inside my device driver. > > Thanks > Sumit > -- > This message posted from opensolaris.org > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org >