On Fri, 2007-12-21 at 11:29 -0500, Chad Mynhier wrote: > On 12/21/07, Chad Mynhier <[EMAIL PROTECTED]> wrote: > > On 12/21/07, Richard L. Hamilton <[EMAIL PROTECTED]> wrote: > > > [...] > > > > That, however, doesn't really help in solving the > > > > problem that I have > > > > n my hands -- how do I determine the lifetime of the > > > > process that > > > > was started before the D script? Granted, I'm not a > > > > kernel developer > > > > so it could be that there's such a way and I would > > > > love to be educated > > > > on what it is. > > > > > > Is curpsinfo->pr_start of any use (assuming I read the docs right, never > > > tried this)? You may have to convert it to something more useful, > > > i.e. multiply the tv_sec by a billion and then add the tv_nsec. > > > See proc(4) for more info on struct psinfo (aka psinfo_t). > > > > It seems like that should be useful. If you look at ptime, it does > > something similar, but it's using the pr_create field of the prusage_t > > structure (pr_term - pr_create (subtracted as timestruct_t's) for a > > process started by ptime or gethrtime() (converted to a timestruct_t) > > - pr_create for an extant process with the "-p <pid>" option which > > should soon be putback into OpenSoalris.) > > Doh! I should have paid more attention to the start of this thread. > Using curpsinfo->pr_start is what the OP (Roman) did. > > I guess the ideal thing in this case would be if we exposed the > prusage structure (curprusage?) so that we could use timestamp and > curprusage->pr_create. (I'm just throwing this out there, I haven't > looked yet to see if there's some way to access that or if it would be > reasonable or practical to expose that structure.)
<me showing that I'm not a kernel engineer> My ideal scenario would be to get a hold of exactly the same variable from which curpsinfo->pr_start gets initialized by the kernel. </me showing that I'm not a kernel engineer> Thoughts? Thanks, Roman. _______________________________________________ dtrace-discuss mailing list [email protected]
