From b987a78abf4f1bc07ae93230ebf08cba76a8a1c3 Mon Sep 17 00:00:00 2001 From: Tom Zanussi Date: Sun, 8 Jan 2006 01:02:30 -0800 Subject: [PATCH] --- yaml --- r: 16943 b: refs/heads/master c: df49af8f3392e96ddbc9cf6dd81fbdc0496e1b44 h: refs/heads/master i: 16941: 78950a8ce9f4eabc0cf18b80e659263b07e6f70b 16939: 3ee000a48268c183e4de866aff24652b828df751 16935: ed5ee832781002ddfbfb4624b5ba884ef26685d5 16927: f2b74e9b7868e01f696e1dd4043e67b9ccec6fea v: v3 --- [refs] | 2 +- trunk/Documentation/filesystems/relayfs.txt | 21 ++++++++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 7cca8c809d4a..f7e190163bbd 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e6c08367b8fc6dce6dfd1106f53f6ef28215b313 +refs/heads/master: df49af8f3392e96ddbc9cf6dd81fbdc0496e1b44 diff --git a/trunk/Documentation/filesystems/relayfs.txt b/trunk/Documentation/filesystems/relayfs.txt index 4221b3a52e25..d9693cb8602e 100644 --- a/trunk/Documentation/filesystems/relayfs.txt +++ b/trunk/Documentation/filesystems/relayfs.txt @@ -143,7 +143,7 @@ Here's a summary of the API relayfs provides to in-kernel clients: subbuf_start(buf, subbuf, prev_subbuf, prev_padding) buf_mapped(buf, filp) buf_unmapped(buf, filp) - create_buf_file(filename, parent, mode, buf) + create_buf_file(filename, parent, mode, buf, is_global) remove_buf_file(dentry) helper functions: @@ -367,6 +367,25 @@ create_buf_file() is defined, remove_buf_file() must also be defined; it's responsible for deleting the file(s) created in create_buf_file() and is called during relay_close(). +The create_buf_file() implementation can also be defined in such a way +as to allow the creation of a single 'global' buffer instead of the +default per-cpu set. This can be useful for applications interested +mainly in seeing the relative ordering of system-wide events without +the need to bother with saving explicit timestamps for the purpose of +merging/sorting per-cpu files in a postprocessing step. + +To have relay_open() create a global buffer, the create_buf_file() +implementation should set the value of the is_global outparam to a +non-zero value in addition to creating the file that will be used to +represent the single buffer. In the case of a global buffer, +create_buf_file() and remove_buf_file() will be called only once. The +normal channel-writing functions e.g. relay_write() can still be used +- writes from any cpu will transparently end up in the global buffer - +but since it is a global buffer, callers should make sure they use the +proper locking for such a buffer, either by wrapping writes in a +spinlock, or by copying a write function from relayfs_fs.h and +creating a local version that internally does the proper locking. + See the 'exported-relayfile' examples in the relay-apps tarball for examples of creating and using relay files in debugfs.