I'm rather a newbie so I hope I'm not missing something, but... aren't your 
predicates commented out? I guess they should be "/ ... /" instead of "/* ... 
*/".

--- Horacio

> On 08 Aug 2016, at 17:33, Bennett, Chip <cbenn...@ftdi.com> wrote:
> 
> I used to do a lot of DTrace work, but it’s been a while, so I’m a little 
> ashamed of having to ask this question, because I figure I’m probably missing 
> something.  J
>  
> Why does the following script not exclude “<unknown>”:
>  
> -bash-3.2# cat iosnoop.d
> #!/usr/sbin/dtrace -s
>  
> #pragma D option quiet
>  
> syscall::*write*:entry
> {
>     self->start = 1;
>     self->fd = arg0;
> }
>  
> syscall::*write*:return
> /* self->start && arg0 > 0 && fds[self->fd].fi_pathname != "<unknown>" */
> {
>     printf("%d %s\n", arg0, fds[self->fd].fi_pathname);
> }
>  
> syscall::*write*:return
> /* self->start */
> {
>     self->start = 0;
>     self->fd = 0;
> }
> -bash-3.2# ./iosnoop.d | grep '<unknown>'
> 627 <unknown>
> 80 <unknown>
> 36 <unknown>
> 64 <unknown>
> 64 <unknown>
> 53 <unknown>
> ^C-bash-3.2#
>  
> Thanks,
> Chip Bennett
> 
> This message is solely for the intended recipient(s) and may contain 
> confidential and privileged information. Any unauthorized review, use, 
> disclosure or distribution is prohibited.  ­­  
> dtrace-discuss | Archives 
> <https://www.listbox.com/member/archive/184261/=now>  
> <https://www.listbox.com/member/archive/rss/184261/28324307-6b36fa89> | 
> Modify <https://www.listbox.com/member/?&;> Your Subscription   
> <http://www.listbox.com/>



-------------------------------------------
dtrace-discuss
Archives: https://www.listbox.com/member/archive/184261/=now
RSS Feed: https://www.listbox.com/member/archive/rss/184261/25769126-e243886f
Modify Your Subscription: 
https://www.listbox.com/member/?member_id=25769126&id_secret=25769126-8d47a7b2
Powered by Listbox: http://www.listbox.com

Reply via email to