blob: 4e70749f8d16e122a0fab36fa065889e018ef954 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/**
2 * @file event_buffer.h
3 *
4 * @remark Copyright 2002 OProfile authors
5 * @remark Read the file COPYING
6 *
7 * @author John Levon <levon@movementarian.org>
8 */
9
10#ifndef EVENT_BUFFER_H
11#define EVENT_BUFFER_H
12
Robert Richter6a180372008-10-16 15:01:40 +020013#include <linux/types.h>
Markus Armbruster59cc1852006-06-25 05:47:33 -070014#include <asm/mutex.h>
Robert Richter6a180372008-10-16 15:01:40 +020015
Linus Torvalds1da177e2005-04-16 15:20:36 -070016int alloc_event_buffer(void);
17
18void free_event_buffer(void);
Robert Richter6a180372008-10-16 15:01:40 +020019
Carl Lovea5598ca2008-10-14 23:37:01 +000020/**
21 * Add data to the event buffer.
22 * The data passed is free-form, but typically consists of
23 * file offsets, dcookies, context information, and ESCAPE codes.
24 */
25void add_event_entry(unsigned long data);
26
Linus Torvalds1da177e2005-04-16 15:20:36 -070027/* wake up the process sleeping on the event file */
28void wake_up_buffer_waiter(void);
Bob Nelson14748552007-07-20 21:39:53 +020029
John Levon0c0a4002005-06-23 22:02:47 -070030#define INVALID_COOKIE ~0UL
31#define NO_COOKIE 0UL
32
Arjan van de Vend54b1fd2007-02-12 00:55:34 -080033extern const struct file_operations event_buffer_fops;
Robert Richter6a180372008-10-16 15:01:40 +020034
Linus Torvalds1da177e2005-04-16 15:20:36 -070035/* mutex between sync_cpu_buffers() and the
36 * file reading code.
37 */
Markus Armbruster59cc1852006-06-25 05:47:33 -070038extern struct mutex buffer_mutex;
Robert Richter6a180372008-10-16 15:01:40 +020039
Linus Torvalds1da177e2005-04-16 15:20:36 -070040#endif /* EVENT_BUFFER_H */