LOL. Yes. I said it had been a while since I used DTrace. Thanks!
Chip From: H. Mijail [mailto:hmij...@gmail.com] Sent: Monday, August 08, 2016 10:48 AM To: Bennett, Chip <cbenn...@ftdi.com> Cc: DTrace Discuss (dtrace-discuss@lists.dtrace.org) <dtrace-discuss@lists.dtrace.org> Subject: Re: [dtrace-discuss] Problems with string compare 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<mailto: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. ☺ 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/images/feed-icon-10x10.jpgb81cb71.jpg?uri=aHR0cHM6Ly93d3cubGlzdGJveC5jb20vaW1hZ2VzL2ZlZWQtaWNvbi0xMHgxMC5qcGc] <https://www.listbox.com/member/archive/rss/184261/28324307-6b36fa89> | Modify<https://www.listbox.com/member/?&> Your Subscription [https://www.listbox.com/images/listbox-logo-small.pngb81cb71.png?uri=aHR0cHM6Ly93d3cubGlzdGJveC5jb20vaW1hZ2VzL2xpc3Rib3gtbG9nby1zbWFsbC5wbmc]<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