aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/oprofile.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/oprofile.h')
-rw-r--r--include/linux/oprofile.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/include/linux/oprofile.h b/include/linux/oprofile.h
index 0d514b252454..041bb31100f4 100644
--- a/include/linux/oprofile.h
+++ b/include/linux/oprofile.h
@@ -17,6 +17,26 @@
17#include <linux/spinlock.h> 17#include <linux/spinlock.h>
18#include <asm/atomic.h> 18#include <asm/atomic.h>
19 19
20/* Each escaped entry is prefixed by ESCAPE_CODE
21 * then one of the following codes, then the
22 * relevant data.
23 * These #defines live in this file so that arch-specific
24 * buffer sync'ing code can access them.
25 */
26#define ESCAPE_CODE ~0UL
27#define CTX_SWITCH_CODE 1
28#define CPU_SWITCH_CODE 2
29#define COOKIE_SWITCH_CODE 3
30#define KERNEL_ENTER_SWITCH_CODE 4
31#define KERNEL_EXIT_SWITCH_CODE 5
32#define MODULE_LOADED_CODE 6
33#define CTX_TGID_CODE 7
34#define TRACE_BEGIN_CODE 8
35#define TRACE_END_CODE 9
36#define XEN_ENTER_SWITCH_CODE 10
37#define SPU_PROFILING_CODE 11
38#define SPU_CTX_SWITCH_CODE 12
39
20struct super_block; 40struct super_block;
21struct dentry; 41struct dentry;
22struct file_operations; 42struct file_operations;
@@ -35,6 +55,14 @@ struct oprofile_operations {
35 int (*start)(void); 55 int (*start)(void);
36 /* Stop delivering interrupts. */ 56 /* Stop delivering interrupts. */
37 void (*stop)(void); 57 void (*stop)(void);
58 /* Arch-specific buffer sync functions.
59 * Return value = 0: Success
60 * Return value = -1: Failure
61 * Return value = 1: Run generic sync function
62 */
63 int (*sync_start)(void);
64 int (*sync_stop)(void);
65
38 /* Initiate a stack backtrace. Optional. */ 66 /* Initiate a stack backtrace. Optional. */
39 void (*backtrace)(struct pt_regs * const regs, unsigned int depth); 67 void (*backtrace)(struct pt_regs * const regs, unsigned int depth);
40 /* CPU identification string. */ 68 /* CPU identification string. */
@@ -56,6 +84,13 @@ int oprofile_arch_init(struct oprofile_operations * ops);
56void oprofile_arch_exit(void); 84void oprofile_arch_exit(void);
57 85
58/** 86/**
87 * Add data to the event buffer.
88 * The data passed is free-form, but typically consists of
89 * file offsets, dcookies, context information, and ESCAPE codes.
90 */
91void add_event_entry(unsigned long data);
92
93/**
59 * Add a sample. This may be called from any context. Pass 94 * Add a sample. This may be called from any context. Pass
60 * smp_processor_id() as cpu. 95 * smp_processor_id() as cpu.
61 */ 96 */