perfmon_v2.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008 #ifndef __PERFMON_V2_H__
00009 #define __PERFMON_V2_H__
00010
00011 #ifndef __PERFMON_H__
00012 #error "this file should never be included directly, use perfmon.h instead"
00013 #endif
00014
00015
00016
00017
00018 typedef struct {
00019 uint32_t ctx_flags;
00020 uint32_t ctx_reserved1;
00021 uint64_t ctx_reserved3[7];
00022 } pfarg_ctx_t;
00023
00024
00025
00026
00027 typedef struct {
00028 uint16_t reg_num;
00029 uint16_t reg_set;
00030 uint32_t reg_flags;
00031 uint64_t reg_value;
00032 uint64_t reg_reserved2[4];
00033 } pfarg_pmc_t;
00034
00035
00036
00037
00038 typedef struct {
00039 uint16_t reg_num;
00040 uint16_t reg_set;
00041 uint32_t reg_flags;
00042 uint64_t reg_value;
00043 uint64_t reg_long_reset;
00044 uint64_t reg_short_reset;
00045 uint64_t reg_last_reset_val;
00046 uint64_t reg_ovfl_switch_cnt;
00047 uint64_t reg_reset_pmds[PFM_PMD_BV];
00048 uint64_t reg_smpl_pmds[PFM_PMD_BV];
00049 uint64_t reg_smpl_eventid;
00050 uint64_t reg_random_mask;
00051 uint32_t reg_random_seed;
00052 uint32_t reg_reserved2[7];
00053 } pfarg_pmd_t;
00054
00055
00056
00057
00058 typedef struct {
00059 uint16_t start_set;
00060 uint16_t start_reserved1;
00061 uint32_t start_reserved2;
00062 uint64_t reserved3[3];
00063 } pfarg_start_t;
00064
00065
00066
00067
00068 typedef struct {
00069 uint32_t load_pid;
00070 uint16_t load_set;
00071 uint16_t load_reserved1;
00072 uint64_t load_reserved2[3];
00073 } pfarg_load_t;
00074
00075 #ifndef PFMLIB_OLD_PFMV2
00076 typedef struct {
00077 uint16_t set_id;
00078 uint16_t set_reserved1;
00079 uint32_t set_flags;
00080 uint64_t set_timeout;
00081 uint64_t reserved[6];
00082 } pfarg_setdesc_t;
00083
00084 typedef struct {
00085 uint16_t set_id;
00086 uint16_t set_reserved1;
00087 uint32_t set_flags;
00088 uint64_t set_ovfl_pmds[PFM_PMD_BV];
00089 uint64_t set_runs;
00090 uint64_t set_timeout;
00091 uint64_t set_act_duration;
00092 uint64_t set_avail_pmcs[PFM_PMC_BV];
00093 uint64_t set_avail_pmds[PFM_PMD_BV];
00094 uint64_t set_reserved3[6];
00095 } pfarg_setinfo_t;
00096 #endif
00097
00098
00099 #ifdef PFMLIB_OLD_PFMV2
00100
00101
00102
00103
00104 typedef struct {
00105 uint16_t set_id;
00106 uint16_t set_id_next;
00107 uint32_t set_flags;
00108 uint64_t set_timeout;
00109 uint64_t set_mmap_offset;
00110 uint64_t reserved[5];
00111 } pfarg_setdesc_t;
00112
00113
00114
00115
00116 typedef struct {
00117 uint16_t set_id;
00118 uint16_t set_id_next;
00119 uint32_t set_flags;
00120 uint64_t set_ovfl_pmds[PFM_PMD_BV];
00121 uint64_t set_runs;
00122 uint64_t set_timeout;
00123 uint64_t set_act_duration;
00124 uint64_t set_mmap_offset;
00125 uint64_t set_avail_pmcs[PFM_PMC_BV];
00126 uint64_t set_avail_pmds[PFM_PMD_BV];
00127 uint64_t reserved[4];
00128 } pfarg_setinfo_t;
00129
00130 #ifdef __crayx2
00131 #define PFM_MAX_HW_PMDS 512
00132 #else
00133 #define PFM_MAX_HW_PMDS 256
00134 #endif
00135 #define PFM_HW_PMD_BV PFM_BVSIZE(PFM_MAX_HW_PMDS)
00136
00137 typedef struct {
00138 uint32_t msg_type;
00139 uint32_t msg_ovfl_pid;
00140 uint64_t msg_ovfl_pmds[PFM_HW_PMD_BV];
00141 uint16_t msg_active_set;
00142 uint16_t msg_ovfl_cpu;
00143 uint32_t msg_ovfl_tid;
00144 uint64_t msg_ovfl_ip;
00145 } pfarg_ovfl_msg_t;
00146
00147 #endif
00148
00149 extern os_err_t pfm_create_context(pfarg_ctx_t *ctx, char *smpl_name,
00150 void *smpl_arg, size_t smpl_size);
00151 extern os_err_t pfm_write_pmcs(int fd, pfarg_pmc_t *pmcs, int count);
00152 extern os_err_t pfm_write_pmds(int fd, pfarg_pmd_t *pmds, int count);
00153 extern os_err_t pfm_read_pmds(int fd, pfarg_pmd_t *pmds, int count);
00154 extern os_err_t pfm_load_context(int fd, pfarg_load_t *load);
00155 extern os_err_t pfm_start(int fd, pfarg_start_t *start);
00156 extern os_err_t pfm_stop(int fd);
00157 extern os_err_t pfm_restart(int fd);
00158 extern os_err_t pfm_create_evtsets(int fd, pfarg_setdesc_t *setd, int count);
00159 extern os_err_t pfm_getinfo_evtsets(int fd, pfarg_setinfo_t *info, int count);
00160 extern os_err_t pfm_delete_evtsets(int fd, pfarg_setdesc_t *setd, int count);
00161 extern os_err_t pfm_unload_context(int fd);
00162
00163 #endif