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
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 > dtrace-discuss at opensolaris.org
Hy Angelo! Yes strstr is perfect for me, now i can identify the syscall. The only problem arg1 is a fixed length string arg2 contain the length. Now i can only change the text in arg2 but only with the same length string. That is why my original problem not solved yet. Becuse i need to delete this message from the console. I consult with one of my friend and he said maybe if i can set arg2 to 0 then it can solve our problem. I probe to change arg2 to zero (many ways :) ), for exmaple: newi = 0; copyout( newi, arg2, sizeof(newi)); Error message: dtrace: failed to compile script ./mod_syscall.d: line 19: copyout( ) argument #1 is incompatible with prototype: prototype: void * argument: int Do you have any idea about how can i set it to zero? Thanks a lot. Cni 2009/8/18 Angelo Rajadurai <Angelo.Rajadurai at sun.com>:> 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 >> dtrace-discuss at opensolaris.org > >