| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /** | 
|  | 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 Richter | 6a18037 | 2008-10-16 15:01:40 +0200 | [diff] [blame] | 13 | #include <linux/types.h> | 
| Markus Armbruster | 59cc185 | 2006-06-25 05:47:33 -0700 | [diff] [blame] | 14 | #include <asm/mutex.h> | 
| Robert Richter | 6a18037 | 2008-10-16 15:01:40 +0200 | [diff] [blame] | 15 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 16 | int alloc_event_buffer(void); | 
|  | 17 |  | 
|  | 18 | void free_event_buffer(void); | 
| Robert Richter | 6a18037 | 2008-10-16 15:01:40 +0200 | [diff] [blame] | 19 |  | 
| Carl Love | a5598ca | 2008-10-14 23:37:01 +0000 | [diff] [blame] | 20 | /** | 
|  | 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 | */ | 
|  | 25 | void add_event_entry(unsigned long data); | 
|  | 26 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 27 | /* wake up the process sleeping on the event file */ | 
|  | 28 | void wake_up_buffer_waiter(void); | 
| Bob Nelson | 1474855 | 2007-07-20 21:39:53 +0200 | [diff] [blame] | 29 |  | 
| John Levon | 0c0a400 | 2005-06-23 22:02:47 -0700 | [diff] [blame] | 30 | #define INVALID_COOKIE ~0UL | 
|  | 31 | #define NO_COOKIE 0UL | 
|  | 32 |  | 
| Arjan van de Ven | d54b1fd | 2007-02-12 00:55:34 -0800 | [diff] [blame] | 33 | extern const struct file_operations event_buffer_fops; | 
| Robert Richter | 6a18037 | 2008-10-16 15:01:40 +0200 | [diff] [blame] | 34 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 35 | /* mutex between sync_cpu_buffers() and the | 
|  | 36 | * file reading code. | 
|  | 37 | */ | 
| Markus Armbruster | 59cc185 | 2006-06-25 05:47:33 -0700 | [diff] [blame] | 38 | extern struct mutex buffer_mutex; | 
| Robert Richter | 6a18037 | 2008-10-16 15:01:40 +0200 | [diff] [blame] | 39 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 40 | #endif /* EVENT_BUFFER_H */ |