[prev in list] [next in list] [prev in thread] [next in thread]
List: opensolaris-dtrace-discuss
Subject: Re: [dtrace-discuss] Convert fd into string
From: <Venkateshu.Cherukupalli () ubs ! com>
Date: 2009-08-19 14:15:54
Message-ID: 0B8A16E16B526D429657B2B2C5760AAA063ED580 () NSTMC101PEX1 ! ubsw ! net
[Download RAW message or body]
Great .. Thanks everyone !
-----Original Message-----
From: Adam.Leventhal@Sun.COM [mailto:Adam.Leventhal@Sun.COM] On Behalf
Of Adam Leventhal
Sent: Tuesday, August 18, 2009 8:24 PM
To: Chip Bennett
Cc: Jonathan Adams; Cherukupalli, Venkateshu;
dtrace-discuss@opensolaris.org
Subject: Re: [dtrace-discuss] Convert fd into string
Similar to what Chip mentioned, you can use the built-in DTrace
subroutine lltostr().
Adam
On Aug 18, 2009, at 4:20 PM, Chip Bennett wrote:
> In C this would be done (non-standard) with "itoa", or in a more
> standard way using sprintf, neither of which exist in "D".
>
> Chip
>
>> -----Original Message-----
>> From: dtrace-discuss-bounces@opensolaris.org [mailto:dtrace-discuss-
>> bounces@opensolaris.org] On Behalf Of Jonathan Adams
>> Sent: Tuesday, August 18, 2009 5:54 PM
>> To: Venkateshu.Cherukupalli@ubs.com
>> Cc: dtrace-discuss@opensolaris.org
>> Subject: Re: [dtrace-discuss] Convert fd into string
>>
>> On Tue, Aug 18, 2009 at 06:16:50PM -0400,
>> Venkateshu.Cherukupalli@ubs.com wrote:
>>>
>>> Yup, that will do. But, still I wonder why the typecast fails ?
>>
>> Because the argument is an integer, not a pointer to a kernel string?
>>
>> Typecasting in D is like typecasting in C: almost no work is done.
>> Certainly no lookup of the file descriptor table is done.
>>
>> Cheers,
>> - jonathan
>>
>>> -----Original Message-----
>>> From: Chad Mynhier [mailto:cmynhier@gmail.com]
>>> Sent: Tuesday, August 18, 2009 5:06 PM
>>> To: Cherukupalli, Venkateshu
>>> Cc: Angelo.Rajadurai@sun.com; dtrace-discuss@opensolaris.org
>>> Subject: Re: [dtrace-discuss] Convert fd into string
>>>
>>> Why not just aggregate on the tuple <fd, file name>? Something like
>> this:
>>>
>>> syscall::read:entry
>>> {
>>> @c[arg0, fds[arg0].fi_pathname] = count(); }
>>>
>>> If the output's unsatisfactory, you could always use a printa() in
>>> en
>> END clause to get it into the format you want.
>>>
>>> Chad
>>>
>>> On Tue, Aug 18, 2009 at 4:51 PM, <Venkateshu.Cherukupalli@ubs.com>
>> wrote:
>>>>
>>>> I just need to print the file descriptor number as a string. I
>>>> would like to join fd and file name into one string and then
>>>> aggregate on reads/writes reason I want to do this is, for sockets
>>>> fi_pathname just shows up as "unknown" - instead if I can get fd, I
>>>> can do pfiles and get the socket details ..
>>>>
>>>>
>>> Visit our website at http://www.ubs.com
>>>
>>> This message contains confidential information and is intended only
>>> for the individual named. If you are not the named addressee you
>>> should not disseminate, distribute or copy this e-mail. Please
>> notify
>>> the sender immediately by e-mail if you have received this e-mail by
>>> mistake and delete this e-mail from your system.
>>>
>>> E-mails are not encrypted and cannot be guaranteed to be secure or
>>> error-free as information could be intercepted, corrupted, lost,
>>> destroyed, arrive late or incomplete, or contain viruses. The
>>> sender therefore does not accept liability for any errors or
>>> omissions in
>> the
>>> contents of this message which arise as a result of e-mail
>> transmission.
>>> If verification is required please request a hard-copy version.
>>> This
>>> message is provided for informational purposes and should not be
>>> construed as a solicitation or offer to buy or sell any securities
>>> or related financial instruments.
>>>
>>>
>>> UBS reserves the right to retain all messages. Messages are
>>> protected
>>> and accessed only in legally justified cases.
>>> _______________________________________________
>>> dtrace-discuss mailing list
>>> dtrace-discuss@opensolaris.org
> _______________________________________________
> dtrace-discuss mailing list
> dtrace-discuss@opensolaris.org
--
Adam Leventhal, Fishworks
http://blogs.sun.com/ahl
Visit our website at http://www.ubs.com
This message contains confidential information and is intended only
for the individual named. If you are not the named addressee you
should not disseminate, distribute or copy this e-mail. Please
notify the sender immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system.
E-mails are not encrypted and cannot be guaranteed to be secure or
error-free as information could be intercepted, corrupted, lost,
destroyed, arrive late or incomplete, or contain viruses. The sender
therefore does not accept liability for any errors or omissions in the
contents of this message which arise as a result of e-mail transmission.
If verification is required please request a hard-copy version. This
message is provided for informational purposes and should not be
construed as a solicitation or offer to buy or sell any securities
or related financial instruments.
UBS reserves the right to retain all messages. Messages are protected
and accessed only in legally justified cases.
_______________________________________________
dtrace-discuss mailing list
dtrace-discuss@opensolaris.org
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic