Hi Cni:
You may be able to use the strstr() subroutine (or any of its
siblings) to get what you want. Something like
#!/usr/sbin/dtrace -qs
#pragma D option destructive
syscall::write:entry
/execname == "syslogd" && (self->class = copyinstr(arg1)) != NULL &&
strstr(self->class,"nxge_ipp_eccue_valid_check") != NULL /
{
self->addr = arg1;
copyoutstr("Clear nxge_ipp_eccue_valid_check messages", self-
>addr, 100);
}
I'm sure there are more elegant methods. For example instead of
intercepting write() you may be able to set probes in syslogd itself.
-Angelo
On Aug 18, 2009, at 5:13 AM, Juhasz Balint wrote:
Hy!
I receive an nxge driver messages on console:
Aug 18 11:08:42 [hostname] nxge: NOTICE: nxge_ipp_eccue_valid_check:
rd_ptr = XXX wr_ptr = YYY
I find the bug description/correction at sun web page, and i know i
can ignore it.
I thinking about how can i delete from console only these messages
(here is my first version, what is not (so) elegant):
#!/usr/sbin/dtrace -qs
#pragma D option destructive
syscall::write:entry
/ execname == "syslogd" && (self->class = copyinstr(arg1)) != NULL &&
90 < strlen(self->class) /
{
self->addr = arg1;
copyoutstr("Clear nxge_ipp_eccue_valid_check messages",
self->addr, 100);
}
Problems with this script:
1. It change all syslog messages what is longer then 90 character.
I can't use regexp to make some check on the string, for example if
the arg1 contain nxge_ipp_eccue_valid_check then do it
2. I need to ignore this syslog messages not, rewrite the string. I
want to ignore only this message that is why i don't want to modify
syslog.conf
If somebody have any idea please write it.
Thanks a lot.
Cni
_______________________________________________
dtrace-discuss mailing list
[email protected]
_______________________________________________
dtrace-discuss mailing list
[email protected]