opd_perfmon.h

Go to the documentation of this file.
00001 
00011 #ifndef OPD_PERFMON_H
00012 #define OPD_PERFMON_H
00013 
00014 #ifdef __ia64__
00015 
00016 #include <stdlib.h>
00017 
00018 void perfmon_init(void);
00019 void perfmon_exit(void);
00020 void perfmon_start(void);
00021 void perfmon_stop(void);
00022 
00023 /* The following is from asm/perfmon.h. When it's installed on
00024  * enough boxes, we can remove this and include the platform
00025  * perfmon.h
00026  */
00027 
00028 typedef unsigned char pfm_uuid_t[16];   /* custom sampling buffer identifier type */
00029 
00030 /*
00031  * Request structure used to define a context
00032  */
00033 typedef struct {
00034     pfm_uuid_t     ctx_smpl_buf_id;  /* which buffer format to use (if needed) */
00035     unsigned long  ctx_flags;    /* noblock/block */
00036     unsigned short ctx_nextra_sets;  /* number of extra event sets (you always get 1) */
00037     unsigned short ctx_reserved1;    /* for future use */
00038     int        ctx_fd;       /* return arg: unique identification for context */
00039     void           *ctx_smpl_vaddr;  /* return arg: virtual address of sampling buffer, is used */
00040     unsigned long  ctx_reserved2[11];/* for future use */
00041 } pfarg_context_t;
00042 
00043 /*
00044  * Request structure used to write/read a PMC or PMD
00045  */
00046 typedef struct {
00047     unsigned int    reg_num;       /* which register */
00048     unsigned short  reg_set;       /* event set for this register */
00049     unsigned short  reg_reserved1;     /* for future use */
00050 
00051     unsigned long   reg_value;     /* initial pmc/pmd value */
00052     unsigned long   reg_flags;     /* input: pmc/pmd flags, return: reg error */
00053 
00054     unsigned long   reg_long_reset;    /* reset after buffer overflow notification */
00055     unsigned long   reg_short_reset;   /* reset after counter overflow */
00056 
00057     unsigned long   reg_reset_pmds[4]; /* which other counters to reset on overflow */
00058     unsigned long   reg_random_seed;   /* seed value when randomization is used */
00059     unsigned long   reg_random_mask;   /* bitmask used to limit random value */
00060     unsigned long   reg_last_reset_val;/* return: PMD last reset value */
00061 
00062     unsigned long   reg_smpl_pmds[4];  /* which pmds are accessed when PMC overflows */
00063     unsigned long   reg_smpl_eventid;  /* opaque sampling event identifier */
00064 
00065     unsigned long   reg_reserved2[3];   /* for future use */
00066 } pfarg_reg_t;
00067 
00068 typedef struct {
00069     pid_t       load_pid;      /* process to load the context into */
00070     unsigned short  load_set;      /* first event set to load */
00071     unsigned short  load_reserved1;    /* for future use */
00072     unsigned long   load_reserved2[3]; /* for future use */
00073 } pfarg_load_t;
00074 
00075 #define PFM_WRITE_PMCS      0x01
00076 #define PFM_WRITE_PMDS      0x02
00077 #define PFM_STOP            0x04
00078 #define PFM_START           0x05
00079 #define PFM_CREATE_CONTEXT  0x08
00080 #define PFM_LOAD_CONTEXT    0x10
00081 #define PFM_FL_SYSTEM_WIDE  0x02
00082 
00083 #else
00084 
00085 void perfmon_init(void)
00086 {
00087 }
00088 
00089 
00090 void perfmon_exit(void)
00091 {
00092 }
00093 
00094 
00095 void perfmon_start(void)
00096 {
00097 }
00098 
00099 
00100 void perfmon_stop(void)
00101 {
00102 }
00103 
00104 #endif /* __ia64__ */
00105 
00106 #endif /* OPD_PERFMON_H */

Generated on 8 Nov 2012 for Oprofile by  doxygen 1.6.1