event_buffer.h 860 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /**
  2. * @file event_buffer.h
  3. *
  4. * @remark Copyright 2002 OProfile authors
  5. * @remark Read the file COPYING
  6. *
  7. * @author John Levon <[email protected]>
  8. */
  9. #ifndef EVENT_BUFFER_H
  10. #define EVENT_BUFFER_H
  11. #include <linux/types.h>
  12. #include <linux/mutex.h>
  13. int alloc_event_buffer(void);
  14. void free_event_buffer(void);
  15. /**
  16. * Add data to the event buffer.
  17. * The data passed is free-form, but typically consists of
  18. * file offsets, dcookies, context information, and ESCAPE codes.
  19. */
  20. void add_event_entry(unsigned long data);
  21. /* wake up the process sleeping on the event file */
  22. void wake_up_buffer_waiter(void);
  23. #define INVALID_COOKIE ~0UL
  24. #define NO_COOKIE 0UL
  25. extern const struct file_operations event_buffer_fops;
  26. /* mutex between sync_cpu_buffers() and the
  27. * file reading code.
  28. */
  29. extern struct mutex buffer_mutex;
  30. #endif /* EVENT_BUFFER_H */