245{
248 int strErr;
249 char events_dir[128];
250 char event_path[128];
251 char *strCpy;
253
256
262 goto fn_fail;
263 }
264
265 int ret = snprintf(events_dir, sizeof(events_dir), "/sys/firmware/opal/exports/");
267 if (NULL == (
events = opendir(events_dir))) {
269 "%s:%i Could not open events_dir='%s'.", __FILE__, __LINE__, events_dir);
273 goto fn_fail;
274 }
275
276 ret = snprintf(event_path,
sizeof(event_path),
"%s%s", events_dir,
pkg_sys_name);
278 if (-1 == access(event_path, F_OK)) {
280 "%s:%i Could not access event_path='%s'.", __FILE__, __LINE__, event_path);
284 goto fn_fail;
285 }
286
290 "%s:%i Could not open event_path='%s'.", __FILE__, __LINE__, event_path);
294 goto fn_fail;
295 }
296
307 goto fn_fail;
308 }
309
311
313
315
318 if (!
rc ||
rc < 0)
break;
319 }
320
322
326 continue;
327 }
328
331
332
335
336
337
338
339
341
342 ping[
s] = (uint32_t*)malloc(buff_size);
343 if (
ping[
s] == NULL) {
345 "%s:%i Failed to alloc %i bytes for ping[%i].", __FILE__, __LINE__, buff_size,
s);
349 goto fn_fail;
350 }
351
355 "%s:%i Failed to alloc %i bytes for double_ping[%i].", __FILE__, __LINE__, buff_size,
s);
359 goto fn_fail;
360 }
361
363
365
366
368
370
371
373 }
374
375
379
380
382
383
385
386 fn_exit:
389 fn_fail:
390 goto fn_exit;
391}
int open(const char *pathname, int flags, mode_t mode)
off_t lseek(int fd, off_t offset, int whence)
ssize_t read(int fd, void *buf, size_t count)
const char * names[NUM_EVENTS]
static const PAPI_hw_info_t * hw_info
struct papi_vectors * _papi_hwd[]
volatile int buf[CACHE_FLUSH_BUFFER_SIZE_INTS]
char events[MAX_EVENTS][BUFSIZ]
static void refresh_data(int occ_id, int forced)
Refresh_data locks in write and update ping and pong at the same time for OCC occ_id....
papi_vector_t _sensors_ppc_vector
#define HANDLE_STRING_ERROR
static char * pkg_sys_name
#define OCC_SENSOR_DATA_BLOCK_SIZE
uint32_t reading_pong_offset
static mode_t pkg_sys_flag
struct occ_sensor_data_header_s * occ_hdr[MAX_OCCS]
uint32_t reading_ping_offset
static uint32_t * double_pong[MAX_OCCS]
#define OCC_PING_DATA_BLOCK_SIZE
static int occ_num_events[MAX_OCCS+1]
struct occ_sensor_name_s * occ_names[MAX_OCCS]
static uint32_t * ping[MAX_OCCS]
static uint32_t * double_ping[MAX_OCCS]
papi_mdi_t _papi_hwi_system_info
char disabled_reason[PAPI_HUGE_STR_LEN]
PAPI_component_info_t cmp_info