[Panicsel-developers] About the showsel in Todo List.
Brought to you by:
arcress
|
From: Guo, M. <mi...@in...> - 2003-03-11 09:02:10
|
Hi ,Andy
I don't understand the following TODO list clearly, I think it means
that we should insert the new SEL record plus the last record (has been
written to syslog last time) to syslog,if write_to_syslog,we need not go
so many judgment code to make showsel more efficient,so that customer can
locate the latest SEL log promptly, is that right?
"make showsel scan for syslog more efficient.
Currently reads all SEL records if normal or if write_to_syslog;
then if write_to_syslog, write newer SEL records to syslog.
Change: if write_to_syslog, read last SEL plus new SEL records
only."
If so ,then just apply the following patch,I have tested it on my
langley machine.
----------------------------------------------------------------------------
----------------------------
--- panicsel/panicsel/util/showsel.c Thu Feb 27 22:15:32 2003
+++ panicsel_new/panicsel/util/showsel.c Tue Mar 11 16:38:50 2003
@@ -482,6 +482,7 @@
memset(pSelRecord, 0, sizeof(SEL_RECORD));
if (fwriteit) StartWriting(&savtime);
while( GetSelEntry( &RecordID, pSelRecord) == 0 ) {
+ if (( fwriteit && pSelRecord->timestamp >= savtime ) ||
!fwriteit ){
if (mytype == 0xff || pSelRecord->sensor_type == mytype) {
/* set dtype, used as array index below */
if (pSelRecord->sensor_type > 0x29) dtype = 0;
@@ -568,14 +569,13 @@
pSelRecord->event_data3 );
printf(output);
if (fwriteit) {
- /* Only write newer records */
- if (pSelRecord->timestamp > savtime) {
/* Write the given SEL record to the syslog. */
syslog(LOG_INFO,output);
- savtime = pSelRecord->timestamp;
- }
+ if (pSelRecord->timestamp > savtime)
+ savtime = pSelRecord->timestamp;
}
} /*endif match*/
+ }
if( pSelRecord->record_id == -1 )
break;
if( RecordID == pSelRecord->record_id )
----------------------------------------------------------------------------
--------------
Thanks
Guo Min
The content of this email message solely contains my own personal views,
and not those of my employer.
|