diff options
author | Tom Zanussi <zanussi@us.ibm.com> | 2006-01-08 04:02:30 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-08 23:13:50 -0500 |
commit | df49af8f3392e96ddbc9cf6dd81fbdc0496e1b44 (patch) | |
tree | e4a8ce3657f1148f279623fe6048735de9c15c39 | |
parent | e6c08367b8fc6dce6dfd1106f53f6ef28215b313 (diff) |
[PATCH] relayfs: add Documentation on global relay buffers
Documentation update for creating global buffers.
Signed-off-by: Tom Zanussi <zanussi@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | Documentation/filesystems/relayfs.txt | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/Documentation/filesystems/relayfs.txt b/Documentation/filesystems/relayfs.txt index 4221b3a52e25..d9693cb8602e 100644 --- a/Documentation/filesystems/relayfs.txt +++ b/Documentation/filesystems/relayfs.txt | |||
@@ -143,7 +143,7 @@ Here's a summary of the API relayfs provides to in-kernel clients: | |||
143 | subbuf_start(buf, subbuf, prev_subbuf, prev_padding) | 143 | subbuf_start(buf, subbuf, prev_subbuf, prev_padding) |
144 | buf_mapped(buf, filp) | 144 | buf_mapped(buf, filp) |
145 | buf_unmapped(buf, filp) | 145 | buf_unmapped(buf, filp) |
146 | create_buf_file(filename, parent, mode, buf) | 146 | create_buf_file(filename, parent, mode, buf, is_global) |
147 | remove_buf_file(dentry) | 147 | remove_buf_file(dentry) |
148 | 148 | ||
149 | helper functions: | 149 | helper functions: |
@@ -367,6 +367,25 @@ create_buf_file() is defined, remove_buf_file() must also be defined; | |||
367 | it's responsible for deleting the file(s) created in create_buf_file() | 367 | it's responsible for deleting the file(s) created in create_buf_file() |
368 | and is called during relay_close(). | 368 | and is called during relay_close(). |
369 | 369 | ||
370 | The create_buf_file() implementation can also be defined in such a way | ||
371 | as to allow the creation of a single 'global' buffer instead of the | ||
372 | default per-cpu set. This can be useful for applications interested | ||
373 | mainly in seeing the relative ordering of system-wide events without | ||
374 | the need to bother with saving explicit timestamps for the purpose of | ||
375 | merging/sorting per-cpu files in a postprocessing step. | ||
376 | |||
377 | To have relay_open() create a global buffer, the create_buf_file() | ||
378 | implementation should set the value of the is_global outparam to a | ||
379 | non-zero value in addition to creating the file that will be used to | ||
380 | represent the single buffer. In the case of a global buffer, | ||
381 | create_buf_file() and remove_buf_file() will be called only once. The | ||
382 | normal channel-writing functions e.g. relay_write() can still be used | ||
383 | - writes from any cpu will transparently end up in the global buffer - | ||
384 | but since it is a global buffer, callers should make sure they use the | ||
385 | proper locking for such a buffer, either by wrapping writes in a | ||
386 | spinlock, or by copying a write function from relayfs_fs.h and | ||
387 | creating a local version that internally does the proper locking. | ||
388 | |||
370 | See the 'exported-relayfile' examples in the relay-apps tarball for | 389 | See the 'exported-relayfile' examples in the relay-apps tarball for |
371 | examples of creating and using relay files in debugfs. | 390 | examples of creating and using relay files in debugfs. |
372 | 391 | ||