NAME

PAPI_list_events - list the events defined in an event set

CONTENTS

Synopsis
Description
Arguments
Return Values
Errors
Examples
Author
Bugs
See Also

SYNOPSIS

C Interface

#include <papi.h> 

int PAPI_list_events(int EventSet, int *Events, int *number); 

Fortran Interface

#include fpapi.h 

PAPIF_list_events(C_INT EventSet, C_INT(*) Events, C_INT number, C_INT check) 

DESCRIPTION

PAPI_list_events() decomposes an event set into the hardware events it contains.

ARGUMENTS

EventSet -- an integer handle for a PAPI event set as created by PAPI_create_eventset (3)

*Events -- an array of codes for events, such as PAPI_INT_INS. No more than *number codes will be stored into the array.

*number -- On input the variable determines the size of the Events array. On output the variable contains the number of counters in the event set.

Note that if the given array *Events is too short to hold all the counters in the event set the *number variable will be larger than the actually stored number of counter codes.

RETURN VALUES

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

ERRORS

PAPI_EINVAL
  One or more of the arguments is invalid.
PAPI_ENOEVST
  The EventSet specified does not exist.
PAPI_ENOTPRESET
  The hardware event specified is not a PAPI preset for this architecture.

EXAMPLES


  int EventCode, EventSet = PAPI_NULL;
  char EventCodeStr[PAPI_MAX_STR_LEN];
  char EventDescr[PAPI_MAX_STR_LEN];
        
  /* Convert to integer */

if (PAPI_event_name_to_code("PAPI_TOT_INS",&EventCode) != PAPI_OK) handle_error(1);

/* Query Total Instructions Executed to our EventSet */

if (PAPI_query(EventCode) != PAPI_OK) handle_error(1);

/* Describe event from EventCode */

if (PAPI_describe_event(EventCodeStr,&EventCode,EventDescr) != PAPI_OK) handle_error(1);

/* Create the EventSet */

if (PAPI_create_eventset(&EventSet) != PAPI_OK) handle_error(1);

/* Add Total Instructions Executed to our EventSet */

if (PAPI_add_event(&EventSet, EventCode) != PAPI_OK) handle_error(1);

AUTHOR

Philip J. Mucci <mucci@cs.utk.edu>

BUGS

This function has no known bugs.

SEE ALSO

PAPI_preset (3), PAPI_set_opt (3), PAPI_start (3), PAPI_rem_event (3), PAPI_rem_events (3), PAPI_query (3), PAPI_cleanup_eventset (3), PAPI_destroy_eventset (3),
The PAPI Web Site: http://icl.cs.utk.edu/projects/papi


PAPI Function Reference PAPI_list_events (3) December, 2001

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