NAME

PAPI_enum_event - enumerate PAPI preset or native events

CONTENTS

Synopsis
Description
Arguments
Pentium 4
Power 4
Return Values
Errors
Examples
Authors
Bugs
See Also

SYNOPSIS

C Interface

#include <papi.h> 

int PAPI_enum_event(int *EventCode,int modifer); 

Fortran Interface

#include fpapi.h 

PAPIF_enum_event(C_INT EventCode, C_INT modifier, C_INT check) 

DESCRIPTION

Given a preset or native event code, PAPI_enum_event() replaces the event code with the next available event in either the preset or native table. The modifier argument affects which events are returned. For all platforms and event types, a value of PAPI_ENUM_ALL (zero) directs the function to return all possible events. For preset events, a TRUE (non-zero) value currently directs the function to return event codes only for PAPI preset events available on this platform. This may change in the future. For native events, the effect of the modifier argument is different on each platform. See the discussion below for platform-specific definitions.

ARGUMENTS

EventCode -- a defined preset or native event such as PAPI_TOT_INS.

modifier -- modifies the search logic. For preset events, TRUE specifies available events only. For native events, each platform behaves differently. See platform-specific documentation for details

PENTIUM 4

The following values are implemented for modifier on Pentium 4: PAPI_PENT4_ENUM_GROUPS - 45 groups + custom + user event types PAPI_PENT4_ENUM_COMBOS - all combinations of mask bits for given group PAPI_PENT4_ENUM_BITS - all individual bits for a given group

POWER 4

The following values are implemented for modifier on POWER 4: PAPI_PWR4_ENUM_GROUPS - Enumerate groups to which an event belongs

RETURN VALUES

On success, this function returns PAPI_OK , and on error, a non-zero error code is returned.

ERRORS

PAPI_EINVAL
  One or more of the arguments (typically modifier) is invalid.
PAPI_ENOEVNT
  The next requested PAPI preset or native event is not available on the underlying hardware.

EXAMPLES


   int i = 0 | NATIVE_MASK;
   int retval;
   PAPI_event_info_t info;

/* Initialize the library */

retval = PAPI_library_init(PAPI_VER_CURRENT);

if (retval != PAPI_VER_CURRENT) { fprintf(stderr,"PAPI library init error!\n"); exit(1); }

/* Scan for all supported native events on this platform */

printf("Name                  Code      Description0); do { retval = PAPI_get_event_info(i, &info); if (retval == PAPI_OK) { printf("%-30s 0x%-10x0s0, info.symbol, info.event_code, info.long_descr); } } while (PAPI_enum_event(&i, PAPI_ENUM_ALL) == PAPI_OK);

AUTHORS

The PAPI Team. See them at the PAPI Web Site: http://icl.cs.utk.edu/projects/papi

BUGS

This function has no known bugs.

SEE ALSO

PAPI_preset (3), PAPI_native (3), PAPI_get_event_info (3), PAPI_library_init (3)


PAPI Programmer’s Reference PAPI_enum_event (3) November, 2003

  Innovative Computing Laboratory
2001 R&D Winner  
Contact PAPI: papi@cs.utk.edu Computer Science Department
  University of Tennessee