Linux Kernel
3.7.1
|
#include <linux/types.h>
#include <linux/sched.h>
#include <linux/timer.h>
#include <linux/wait.h>
#include <linux/list.h>
#include <linux/bug.h>
#include <linux/fs.h>
#include <linux/poll.h>
#include <linux/kref.h>
Go to the source code of this file.
Data Structures | |
struct | rchan_buf |
struct | rchan |
struct | rchan_callbacks |
Macros | |
#define | FIX_SIZE(x) ((((x) - 1) & PAGE_MASK) + PAGE_SIZE) |
#define | RELAYFS_CHANNEL_VERSION 7 |
Functions | |
struct rchan * | relay_open (const char *base_filename, struct dentry *parent, size_t subbuf_size, size_t n_subbufs, struct rchan_callbacks *cb, void *private_data) |
int | relay_late_setup_files (struct rchan *chan, const char *base_filename, struct dentry *parent) |
void | relay_close (struct rchan *chan) |
void | relay_flush (struct rchan *chan) |
void | relay_subbufs_consumed (struct rchan *chan, unsigned int cpu, size_t consumed) |
void | relay_reset (struct rchan *chan) |
int | relay_buf_full (struct rchan_buf *buf) |
size_t | relay_switch_subbuf (struct rchan_buf *buf, size_t length) |
Variables | |
struct rchan_buf | ____cacheline_aligned |
struct file_operations | relay_file_operations |
int relay_late_setup_files | ( | struct rchan * | chan, |
const char * | base_filename, | ||
struct dentry * | parent | ||
) |
relay_late_setup_files - triggers file creation : channel to operate on : base name of files to create : dentry of parent directory, NULL for root directory
Returns 0 if successful, non-zero otherwise.
Use to setup files for a previously buffer-only channel. Useful to do early tracing in kernel, before VFS is up, for example.
|
read |
relay_open - create a new relay channel : base name of files to create, NULL for buffering only : dentry of parent directory, NULL for root directory or buffer : size of sub-buffers : number of sub-buffers : client callback functions : user-defined data
Returns channel pointer if successful, NULL otherwise.
Creates a channel buffer for each cpu using the sizes and attributes specified. The created channel buffer files will be named base_filename0...base_filenameN-1. File permissions will be S_IRUSR.
relay_reset - reset the channel : the channel
This has the effect of erasing all data from all channel buffers and restarting the channel in its initial state. The buffers are not freed, so any mappings are still in effect.
NOTE. Care should be taken that the channel isn't actually being used by anything when this call is made.
relay_subbufs_consumed - update the buffer's sub-buffers-consumed count : the channel : the cpu associated with the channel buffer to update : number of sub-buffers to add to current buf's count
Adds to the channel buffer's consumed sub-buffer count. subbufs_consumed should be the number of sub-buffers newly consumed, not the total consumed.
NOTE. Kernel clients don't need to call this function if the channel mode is 'overwrite'.
struct file_operations relay_file_operations |