What determines what struct dtrace knows about by default? I am trying to use dtrace to trace the input and output to the ntp_adjtime call. The ntp_adjtime call takes a single argument, namely a pointer to a timex struct. Even though that struct is the argument to a syscall, dtrace doesn''t seem to know about the struct type. I was a bit surprised by that. -- blu "You''ve added a new disk. Do you want to replace your current drive, protect your data from a drive failure or expand your storage capacity?" - Disk management as it should be. ---------------------------------------------------------------------- Brian Utterback - Solaris RPE, Sun Microsystems, Inc. Ph:877-259-7345, Em:brian.utterback-at-ess-you-enn-dot-kom
I just joined the dtrace discussion group. I am more interested in the Network Provider. Has this been already included in the Solaris kernel by default. Srikant Company name (e.g. ''S.W.I.F.T. SCRL'' for users in BE) This e-mail and any attachments thereto may contain information which is confidential and/or proprietary and intended for the sole use of the recipient(s) named above. If you have received this e-mail in error, please immediately notify the sender and delete the mail. Thank you for your co-operation. SWIFT reserves the right to retain e-mail messages on its systems and, under circumstances permitted by applicable law, to monitor and intercept e-mail messages to and from its systems. Please visit www.swift.com for more information about SWIFT.>-----Original Message----- >From: dtrace-discuss-bounces at opensolaris.org >[mailto:dtrace-discuss-bounces at opensolaris.org] On Behalf Of >Brian Utterback >Sent: Wednesday, December 05, 2007 10:01 AM >To: Solaris Dtrace List >Subject: [dtrace-discuss] Missing struct? > >What determines what struct dtrace knows about by default? > >I am trying to use dtrace to trace the input and output to >the ntp_adjtime call. The ntp_adjtime call takes a single >argument, namely a pointer to a timex struct. Even though >that struct is the argument to a syscall, dtrace doesn''t >seem to know about the struct type. I was a bit surprised >by that. >-- >blu > >"You''ve added a new disk. Do you want to replace your current >drive, protect your data from a drive failure or expand your >storage capacity?" - Disk management as it should be. >---------------------------------------------------------------------- >Brian Utterback - Solaris RPE, Sun Microsystems, Inc. >Ph:877-259-7345, Em:brian.utterback-at-ess-you-enn-dot-kom >_______________________________________________ >dtrace-discuss mailing list >dtrace-discuss at opensolaris.org >-------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 5041 bytes Desc: not available URL: <http://mail.opensolaris.org/pipermail/dtrace-discuss/attachments/20071205/f4ce8ff3/attachment.bin>
> What determines what struct dtrace knows about by default? > > I am trying to use dtrace to trace the input and output to > the ntp_adjtime call. The ntp_adjtime call takes a single > argument, namely a pointer to a timex struct. Even though > that struct is the argument to a syscall, dtrace doesn''t > seem to know about the struct type. I was a bit surprised > by that.How are you trying to reference the struct timex in the syscall? You probably know this but the syscall provider doesn''t provide typed arguments: http://wikis.sun.com/display/DTrace/syscall+Provider#syscallProvider-Arguments That''s something that we''d like to do in the fullness of time :-) . In the meantime the following should do what you need: syscall::ntp_adjtime:entry { this->tx = (struct timex *)copyin(arg0, sizeof(struct timex)); ... } On a more general note around type information usage - we only make use of kernel CTF data and therefore only kernel and intrinsic D types are available for use. Although ON libraries ship with CTF we currently don''t make use of this information but this is something we''d like to get around to doing sometime. Jon.
Further info. It doesn''t look like the syscall::ntp_adjtime: probe has the args array defined. I get out of range index errors even for args[0]. Brian Utterback wrote:> What determines what struct dtrace knows about by default? > > I am trying to use dtrace to trace the input and output to > the ntp_adjtime call. The ntp_adjtime call takes a single > argument, namely a pointer to a timex struct. Even though > that struct is the argument to a syscall, dtrace doesn''t > seem to know about the struct type. I was a bit surprised > by that.-- blu "You''ve added a new disk. Do you want to replace your current drive, protect your data from a drive failure or expand your storage capacity?" - Disk management as it should be. ---------------------------------------------------------------------- Brian Utterback - Solaris RPE, Sun Microsystems, Inc. Ph:877-259-7345, Em:brian.utterback-at-ess-you-enn-dot-kom
I knew the latter and forgot the former. Doesn''t the timex struct count as a kernel structure? And just to make sure, if I want to see the values in the struct when ntp_adjtime returns, I need to do the copyin again, right? Jon Haslam wrote:>> What determines what struct dtrace knows about by default? >> >> I am trying to use dtrace to trace the input and output to >> the ntp_adjtime call. The ntp_adjtime call takes a single >> argument, namely a pointer to a timex struct. Even though >> that struct is the argument to a syscall, dtrace doesn''t >> seem to know about the struct type. I was a bit surprised >> by that. > How are you trying to reference the struct timex in the syscall? > You probably know this but the syscall provider doesn''t provide > typed arguments: > > http://wikis.sun.com/display/DTrace/syscall+Provider#syscallProvider-Arguments > > That''s something that we''d like to do in the fullness of time :-) . > In the meantime the following should do what you need: > > syscall::ntp_adjtime:entry > { > this->tx = (struct timex *)copyin(arg0, sizeof(struct timex)); > ... > } > > On a more general note around type information usage - we only make > use of kernel CTF data and therefore only kernel and intrinsic D > types are available for use. Although ON libraries ship with CTF we > currently don''t make use of this information but this is something > we''d like to get around to doing sometime. > > > Jon. > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org-- blu "You''ve added a new disk. Do you want to replace your current drive, protect your data from a drive failure or expand your storage capacity?" - Disk management as it should be. ---------------------------------------------------------------------- Brian Utterback - Solaris RPE, Sun Microsystems, Inc. Ph:877-259-7345, Em:brian.utterback-at-ess-you-enn-dot-kom
On Wed, Dec 05, 2007 at 12:05:04PM -0500, Brian Utterback wrote:> And just to make sure, if I want to see the values in > the struct when ntp_adjtime returns, I need to do the > copyin again, right?Or use fbt.
> I knew the latter and forgot the former. > > Doesn''t the timex struct count as a kernel structure?It is in the kernel, yes. However, we don''t export the argument types for the syscall providers probes so you can''t reference them through the typed args[] array. You can cast to this type as my example showed and we just "magically" know what a "struct timex" is owing to the CTF.> And just to make sure, if I want to see the values in > the struct when ntp_adjtime returns, I need to do the > copyin again, right?Yes. As has been mentioned though, using fbt may be easier for you. You always have options with DTrace! Jon.> Jon Haslam wrote: > >>> What determines what struct dtrace knows about by default? >>> >>> I am trying to use dtrace to trace the input and output to >>> the ntp_adjtime call. The ntp_adjtime call takes a single >>> argument, namely a pointer to a timex struct. Even though >>> that struct is the argument to a syscall, dtrace doesn''t >>> seem to know about the struct type. I was a bit surprised >>> by that. >>> >> How are you trying to reference the struct timex in the syscall? >> You probably know this but the syscall provider doesn''t provide >> typed arguments: >> >> http://wikis.sun.com/display/DTrace/syscall+Provider#syscallProvider-Arguments >> >> That''s something that we''d like to do in the fullness of time :-) . >> In the meantime the following should do what you need: >> >> syscall::ntp_adjtime:entry >> { >> this->tx = (struct timex *)copyin(arg0, sizeof(struct timex)); >> ... >> } >> >> On a more general note around type information usage - we only make >> use of kernel CTF data and therefore only kernel and intrinsic D >> types are available for use. Although ON libraries ship with CTF we >> currently don''t make use of this information but this is something >> we''d like to get around to doing sometime. >> >> >> Jon. >> _______________________________________________ >> dtrace-discuss mailing list >> dtrace-discuss at opensolaris.org >> > >