Lines Matching full:channel
11 A 'relay channel' is a kernel->user data relay mechanism implemented
12 as a set of per-cpu kernel buffers ('channel buffers'), each
14 clients write into the channel buffers using efficient write
15 functions; these automatically log into the current cpu's channel
19 are associated with the channel buffers using the API described below.
21 The format of the data logged into the channel buffers is completely
35 Each relay channel has one buffer per CPU, each buffer has one or more
50 A relay channel can operate in a mode where it will overwrite data not
53 The relay channel itself does not provide for communication of such
61 the channel buffers, special-purpose communication between kernel and
85 kernel which allow writing formatted text or raw data to a channel,
86 regardless of whether a channel to write into exists or not, or even
99 used to drain the channel buffers, special-purpose communication
102 some channel though.
111 access to relay channel buffer data. Here are the file operations
115 open() enables user to open an _existing_ channel buffer.
117 mmap() results in channel buffer being mapped into the caller's
121 read() read the contents of a channel buffer. The bytes read are
123 again to subsequent reads. If the channel is being used
126 channel is being used in overwrite mode and there are
127 active channel writers, results may be unpredictable -
128 users should make sure that all logging to the channel has
133 sendfile() transfer data from a channel buffer to an output file
140 close() decrements the channel buffer's refcount. When the refcount
142 buffer open, the channel buffer is freed.
164 channel management functions::
172 channel management typically called on instigation of userspace::
196 Creating a channel
199 relay_open() is used to create a channel, along with its per-cpu
200 channel buffers. Each channel buffer will have an associated file
209 structure they create, when the channel is closed - again the host
213 In order for a channel to be created and the host filesystem's files
214 associated with its channel buffers, the user must provide definitions
218 to represent the corresponding channel buffer. The callback should
219 return the dentry of the file created to represent the channel buffer.
263 If the create_buf_file() callback fails, or isn't defined, channel
278 depending on the channel mode being used.
292 normal channel-writing functions, e.g. relay_write(), can still be
300 user-defined data with a channel, and is immediately available
310 cases, one may open a buffer-only channel and then call
314 Channel 'modes'
322 interface to retrieve channel data, you can ignore the details of this
330 number of sub-buffers in the channel. It should be clear that if
335 As explained above, a relay channel is made of up one or more
336 per-cpu channel buffers, each implemented as a circular buffer
338 the current sub-buffer of the channel's current per-cpu buffer via the
416 also called for the first sub-buffer when the channel is opened, to
422 Writing to a channel
425 Kernel clients write data into the current cpu's channel buffer using
438 relay_reserve() is used to reserve a slot in a channel buffer which
440 that need to write directly into a channel buffer without having to
452 Closing a channel
455 The client calls relay_close() when it's finished using the channel.
456 The channel and its associated buffers are destroyed when there are no
457 longer any references to any of the channel buffers. relay_flush()
458 forces a sub-buffer switch on all the channel buffers, and can be used
459 to finalize and process the last sub-buffers before the channel is
465 Some applications may want to keep a channel around and re-use it
466 rather than open and close a new channel for each use. relay_reset()
467 can be used for this purpose - it resets a channel to its initial
468 state without reallocating channel buffer memory or destroying
470 do so, i.e. when the channel isn't currently being written to.
473 different purposes. buf_mapped() is called whenever a channel buffer
477 the channel.