The Android Open Source Project | 10e23ee | 2009-03-03 19:30:30 -0800 | [diff] [blame] | 1 | /** |
| 2 | * @file opd_perfmon.h |
| 3 | * perfmonctl() handling |
| 4 | * |
| 5 | * @remark Copyright 2003 OProfile authors |
| 6 | * @remark Read the file COPYING |
| 7 | * |
| 8 | * @author John Levon |
| 9 | */ |
| 10 | |
| 11 | #ifndef OPD_PERFMON_H |
| 12 | #define OPD_PERFMON_H |
| 13 | |
| 14 | #ifdef __ia64__ |
| 15 | |
| 16 | #include <stdlib.h> |
| 17 | |
| 18 | void perfmon_init(void); |
| 19 | void perfmon_exit(void); |
| 20 | void perfmon_start(void); |
| 21 | void perfmon_stop(void); |
| 22 | |
| 23 | /* The following is from asm/perfmon.h. When it's installed on |
| 24 | * enough boxes, we can remove this and include the platform |
| 25 | * perfmon.h |
| 26 | */ |
| 27 | |
| 28 | typedef unsigned char pfm_uuid_t[16]; /* custom sampling buffer identifier type */ |
| 29 | |
| 30 | /* |
| 31 | * Request structure used to define a context |
| 32 | */ |
| 33 | typedef struct { |
| 34 | pfm_uuid_t ctx_smpl_buf_id; /* which buffer format to use (if needed) */ |
| 35 | unsigned long ctx_flags; /* noblock/block */ |
| 36 | unsigned short ctx_nextra_sets; /* number of extra event sets (you always get 1) */ |
| 37 | unsigned short ctx_reserved1; /* for future use */ |
| 38 | int ctx_fd; /* return arg: unique identification for context */ |
| 39 | void *ctx_smpl_vaddr; /* return arg: virtual address of sampling buffer, is used */ |
| 40 | unsigned long ctx_reserved2[11];/* for future use */ |
| 41 | } pfarg_context_t; |
| 42 | |
| 43 | /* |
| 44 | * Request structure used to write/read a PMC or PMD |
| 45 | */ |
| 46 | typedef struct { |
| 47 | unsigned int reg_num; /* which register */ |
| 48 | unsigned short reg_set; /* event set for this register */ |
| 49 | unsigned short reg_reserved1; /* for future use */ |
| 50 | |
| 51 | unsigned long reg_value; /* initial pmc/pmd value */ |
| 52 | unsigned long reg_flags; /* input: pmc/pmd flags, return: reg error */ |
| 53 | |
| 54 | unsigned long reg_long_reset; /* reset after buffer overflow notification */ |
| 55 | unsigned long reg_short_reset; /* reset after counter overflow */ |
| 56 | |
| 57 | unsigned long reg_reset_pmds[4]; /* which other counters to reset on overflow */ |
| 58 | unsigned long reg_random_seed; /* seed value when randomization is used */ |
| 59 | unsigned long reg_random_mask; /* bitmask used to limit random value */ |
| 60 | unsigned long reg_last_reset_val;/* return: PMD last reset value */ |
| 61 | |
| 62 | unsigned long reg_smpl_pmds[4]; /* which pmds are accessed when PMC overflows */ |
| 63 | unsigned long reg_smpl_eventid; /* opaque sampling event identifier */ |
| 64 | |
| 65 | unsigned long reg_reserved2[3]; /* for future use */ |
| 66 | } pfarg_reg_t; |
| 67 | |
| 68 | typedef struct { |
| 69 | pid_t load_pid; /* process to load the context into */ |
| 70 | unsigned short load_set; /* first event set to load */ |
| 71 | unsigned short load_reserved1; /* for future use */ |
| 72 | unsigned long load_reserved2[3]; /* for future use */ |
| 73 | } pfarg_load_t; |
| 74 | |
| 75 | #define PFM_WRITE_PMCS 0x01 |
| 76 | #define PFM_WRITE_PMDS 0x02 |
| 77 | #define PFM_STOP 0x04 |
| 78 | #define PFM_START 0x05 |
| 79 | #define PFM_CREATE_CONTEXT 0x08 |
| 80 | #define PFM_LOAD_CONTEXT 0x10 |
| 81 | #define PFM_FL_SYSTEM_WIDE 0x02 |
| 82 | |
| 83 | #else |
| 84 | |
| 85 | void perfmon_init(void) |
| 86 | { |
| 87 | } |
| 88 | |
| 89 | |
| 90 | void perfmon_exit(void) |
| 91 | { |
| 92 | } |
| 93 | |
| 94 | |
| 95 | void perfmon_start(void) |
| 96 | { |
| 97 | } |
| 98 | |
| 99 | |
| 100 | void perfmon_stop(void) |
| 101 | { |
| 102 | } |
| 103 | |
| 104 | #endif /* __ia64__ */ |
| 105 | |
| 106 | #endif /* OPD_PERFMON_H */ |