From: Mathieu Desnoyers Date: Mon, 27 Jun 2011 16:06:28 +0000 (-0400) Subject: Merge LTTng commit 5c0552665e4d152e97edc995650711d4f6ac418d X-Git-Tag: v1.9.1~330 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=529b552a3dfa44c5ca717add7919c33d00a3f3db;p=lttng-ust.git Merge LTTng commit 5c0552665e4d152e97edc995650711d4f6ac418d Signed-off-by: Mathieu Desnoyers --- diff --git a/libringbuffer/ring_buffer_vfs.c b/libringbuffer/ring_buffer_vfs.c index 3aa3acaa..c105fe00 100644 --- a/libringbuffer/ring_buffer_vfs.c +++ b/libringbuffer/ring_buffer_vfs.c @@ -240,6 +240,9 @@ long lib_ring_buffer_ioctl(struct file *filp, unsigned int cmd, unsigned long ar return put_ulong(buf->backend.array[sb_bindex]->mmap_offset, arg); } + case RING_BUFFER_FLUSH: + lib_ring_buffer_switch_slow(buf, SWITCH_ACTIVE); + return 0; default: return -ENOIOCTLCMD; } @@ -350,6 +353,9 @@ long lib_ring_buffer_compat_ioctl(struct file *filp, unsigned int cmd, return -EINVAL; return put_ulong(read_offset, arg); } + case RING_BUFFER_FLUSH: + lib_ring_buffer_switch_slow(buf, SWITCH_ACTIVE); + return 0; default: return -ENOIOCTLCMD; } diff --git a/libringbuffer/vfs.h b/libringbuffer/vfs.h index a27f8c50..00404a31 100644 --- a/libringbuffer/vfs.h +++ b/libringbuffer/vfs.h @@ -80,5 +80,7 @@ long lib_ring_buffer_compat_ioctl(struct file *filp, unsigned int cmd, #define RING_BUFFER_GET_MMAP_LEN _IOR(0xF6, 0x0A, unsigned long) /* returns the offset of the subbuffer belonging to the mmap reader. */ #define RING_BUFFER_GET_MMAP_READ_OFFSET _IOR(0xF6, 0x0B, unsigned long) +/* flush the current sub-buffer */ +#define RING_BUFFER_FLUSH _IO(0xF6, 0x0C) #endif /* _LINUX_RING_BUFFER_VFS_H */