@@ -32,15 +32,15 @@ functions in the relay interface code - please see that for details.
32
32
Semantics
33
33
=========
34
34
35
- Each relay channel has one buffer per CPU, each buffer has one or more
35
+ Each relay channel has one buffer per CPU; each buffer has one or more
36
36
sub-buffers. Messages are written to the first sub-buffer until it is
37
37
too full to contain a new message, in which case it is written to
38
38
the next (if available). Messages are never split across sub-buffers.
39
39
At this point, userspace can be notified so it empties the first
40
40
sub-buffer, while the kernel continues writing to the next.
41
41
42
42
When notified that a sub-buffer is full, the kernel knows how many
43
- bytes of it are padding i.e. unused space occurring because a complete
43
+ bytes of it are padding, i.e., unused space occurring because a complete
44
44
message couldn't fit into a sub-buffer. Userspace can use this
45
45
knowledge to copy only valid data.
46
46
@@ -71,7 +71,7 @@ klog and relay-apps example code
71
71
================================
72
72
73
73
The relay interface itself is ready to use, but to make things easier,
74
- a couple simple utility functions and a set of examples are provided.
74
+ a couple of simple utility functions and a set of examples are provided.
75
75
76
76
The relay-apps example tarball, available on the relay sourceforge
77
77
site, contains a set of self-contained examples, each consisting of a
@@ -91,7 +91,7 @@ registered will data actually be logged (see the klog and kleak
91
91
examples for details).
92
92
93
93
It is of course possible to use the relay interface from scratch,
94
- i.e. without using any of the relay-apps example code or klog, but
94
+ i.e., without using any of the relay-apps example code or klog, but
95
95
you'll have to implement communication between userspace and kernel,
96
96
allowing both to convey the state of buffers (full, empty, amount of
97
97
padding). The read() interface both removes padding and internally
@@ -119,7 +119,7 @@ mmap() results in channel buffer being mapped into the caller's
119
119
must map the entire file, which is NRBUF * SUBBUFSIZE.
120
120
121
121
read() read the contents of a channel buffer. The bytes read are
122
- 'consumed' by the reader, i.e. they won't be available
122
+ 'consumed' by the reader, i.e., they won't be available
123
123
again to subsequent reads. If the channel is being used
124
124
in no-overwrite mode (the default), it can be read at any
125
125
time even if there's an active kernel writer. If the
@@ -138,7 +138,7 @@ poll() POLLIN/POLLRDNORM/POLLERR supported. User applications are
138
138
notified when sub-buffer boundaries are crossed.
139
139
140
140
close() decrements the channel buffer's refcount. When the refcount
141
- reaches 0, i.e. when no process or kernel client has the
141
+ reaches 0, i.e., when no process or kernel client has the
142
142
buffer open, the channel buffer is freed.
143
143
=========== ============================================================
144
144
@@ -149,7 +149,7 @@ host filesystem must be mounted. For example::
149
149
150
150
.. Note ::
151
151
152
- the host filesystem doesn't need to be mounted for kernel
152
+ The host filesystem doesn't need to be mounted for kernel
153
153
clients to create or use channels - it only needs to be
154
154
mounted when user space applications need access to the buffer
155
155
data.
@@ -325,7 +325,7 @@ section, as it pertains mainly to mmap() implementations.
325
325
In 'overwrite' mode, also known as 'flight recorder' mode, writes
326
326
continuously cycle around the buffer and will never fail, but will
327
327
unconditionally overwrite old data regardless of whether it's actually
328
- been consumed. In no-overwrite mode, writes will fail, i.e. data will
328
+ been consumed. In no-overwrite mode, writes will fail, i.e., data will
329
329
be lost, if the number of unconsumed sub-buffers equals the total
330
330
number of sub-buffers in the channel. It should be clear that if
331
331
there is no consumer or if the consumer can't consume sub-buffers fast
@@ -344,7 +344,7 @@ initialize the next sub-buffer if appropriate 2) finalize the previous
344
344
sub-buffer if appropriate and 3) return a boolean value indicating
345
345
whether or not to actually move on to the next sub-buffer.
346
346
347
- To implement 'no-overwrite' mode, the userspace client would provide
347
+ To implement 'no-overwrite' mode, the userspace client provides
348
348
an implementation of the subbuf_start() callback something like the
349
349
following::
350
350
@@ -364,9 +364,9 @@ following::
364
364
return 1;
365
365
}
366
366
367
- If the current buffer is full, i.e. all sub-buffers remain unconsumed,
367
+ If the current buffer is full, i.e., all sub-buffers remain unconsumed,
368
368
the callback returns 0 to indicate that the buffer switch should not
369
- occur yet, i.e. until the consumer has had a chance to read the
369
+ occur yet, i.e., until the consumer has had a chance to read the
370
370
current set of ready sub-buffers. For the relay_buf_full() function
371
371
to make sense, the consumer is responsible for notifying the relay
372
372
interface when sub-buffers have been consumed via
@@ -400,7 +400,7 @@ consulted.
400
400
401
401
The default subbuf_start() implementation, used if the client doesn't
402
402
define any callbacks, or doesn't define the subbuf_start() callback,
403
- implements the simplest possible 'no-overwrite' mode, i.e. it does
403
+ implements the simplest possible 'no-overwrite' mode, i.e., it does
404
404
nothing but return 0.
405
405
406
406
Header information can be reserved at the beginning of each sub-buffer
@@ -467,7 +467,7 @@ rather than open and close a new channel for each use. relay_reset()
467
467
can be used for this purpose - it resets a channel to its initial
468
468
state without reallocating channel buffer memory or destroying
469
469
existing mappings. It should however only be called when it's safe to
470
- do so, i.e. when the channel isn't currently being written to.
470
+ do so, i.e., when the channel isn't currently being written to.
471
471
472
472
Finally, there are a couple of utility callbacks that can be used for
473
473
different purposes. buf_mapped() is called whenever a channel buffer
0 commit comments