Gary wrote:
My aim is to log all volume read writes.
(sorry I didn’t see this earlier)
I guess it depends on what “log” means. You mean you need the disk, the
offset, and the length of the operation? Or you mean you want the data,
too.
a WMI client to access this data. My requirement is that the log should
contain all the blocks that were read or written without skipping *any* of
the
info.
Without skipping *any*, *anytime*, *ever*?? Hmmmm (read on)…
As I understand, kernel event logging is for reporting purposes - so can
I use it for this purpose ? Is it reliable enough to give me all the info ?
Or is the volume level filter driver approach better ? I am new to drivers
world
so would like to evaluate all user mode methods before I get into the kernel
world :).
Good choice.
Kernel Event Logging works extrodinarily well in this circumstance.
I’ve personally used it quite extensively. There are a couple of things
about which you need to be aware, however, which impact the data you
receive:
a) Event logging collects the data before the disk class driver. Thus,
the data is as sent by the file system, before it’s been divided into
chunks that are small enough for the adapter to handle. So, let’s say
the disk adapter on the system is capable of reading or writing only 64K
chunks at a time… if the user sends down a 1MB read, you’ll see the
1MB read, not a series of 64K reads. That either matters or it doesn’t,
depending on what you need to do.
b) On some systems, items in the event log can be passed to you out of
order. If order is critically important, you’ll need to consider this.
c) By default, the timestamp used for event logging is systemtime. If
you want better granularity, you’ll need to be sure to specify that you
want the high precision timer to be used.
d) Without *ever* skipping *any* write *ever*?? Hmmmm… You’ll need to
size your event collection buffers carefully.
To be clear: I am not trying to dissuade you from using kernel tracing.
It’s a great feature, and I recommend it highly. When we at OSR
considered writing a filter driver versus using kernel event logging for
this purpose, we decided to use tracing… even though for us writing a
disk filter was merely a matter of get some existing code out of source
control.
But like anything else in life, if you want ultimate control, you’ll
need to do it yourself.
Peter
OSR