On 03/21/2012 10:05 PM, John P. Rouillard wrote:
>
>> There is one crucial difference
>> between the number of processed lines and file position, though. The
>> former reflects lines successfully read and processed from a given file.
>> However, it is possible that the file position is located beyond the end
>> of the last processed line, since SEC implements line buffering layer on
>> top of read(2) system calls. For example, we could have a very long line
>> for which read(2) hasn't seen a terminating newline yet. Therefore, the
>> reported file position does not necessarily mean that all the data
>> before it have been processed by SEC -- it merely indicates the data
>> have been read (but could still reside in a buffer).
>
> Hmm, maybe add an indication of how many characters are in the line
> buffer? Something like:
>
>     /var/log/messages (status: Open, type: regular file,
>      device/inode: 64774/833 9528, received data: 180797 lines,
>      file position: 321992882 bytes, buffered: 1024 bytes,
>      context: _FILE_EVENT_messages)
>
> where the number of bytes is reported as buffered?

that's another opportunity. Through the file name which acts as a key to 
input source hash table, it is very easy to print the number of buffered 
bytes into the dump file.

 > (Also IIUC this
> works for both --nojointbuf and --jointbuf as the line buffering layer
> is per input stream correct?)

yes, line buffering is associated with input streams. The 
--jointbuf/--nojointbuf options influence match buffers which are the 
next layer above line buffers.


> Is there a way in perl to have the compile of the script remove lines?
> Sort of like how python optimizes out __debug__ lines if optimization
> is requested. That would make the profiler have 0 effect unless
> enabled since it would not show up in the perl bytecode.
>
> Maybe a perl source filter (ugly but...) could work? It may require
> a second source file though.
>
> http://perldoc.perl.org/perlfilter.html look for
>
>    USING CONTEXT: THE DEBUG FILTER
>
> for an idea.

Here the problem is that SEC supports altering command line options at 
runtime. Through the resource file, it is possible to introduce new 
options, and remove or change existing options. Of course, the debug 
option might be defined as an exception which can not be changed, but 
that would make the perl source filter even less elegant :(

kind regards,
risto

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Simple-evcorr-users mailing list
Simple-evcorr-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/simple-evcorr-users

Reply via email to