Home | History | Annotate | Download | only in libop
      1 /**
      2  * @file op_alloc_counter.h
      3  * hardware counter allocation
      4  *
      5  * You can have silliness here.
      6  *
      7  * @remark Copyright 2002 OProfile authors
      8  * @remark Read the file COPYING
      9  *
     10  * @author John Levon
     11  * @author Philippe Elie
     12  */
     13 
     14 #ifndef OP_ALLOC_COUNTER_H
     15 #define OP_ALLOC_COUNTER_H
     16 
     17 #include <stddef.h>
     18 
     19 #include "op_cpu_type.h"
     20 
     21 struct op_event;
     22 
     23 #ifdef __cplusplus
     24 extern "C" {
     25 #endif
     26 
     27 /**
     28  * @param pev  array of selected event we want to bind to counter
     29  * @param nr_events  size of pev array
     30  * @param cpu_type  cpu type
     31  *
     32  * Try to calculate a binding between passed event in pev and counter number.
     33  * The binding is returned in a size_t * where returned ptr[i] is the counter
     34  * number bound to pev[i]
     35  */
     36 size_t * map_event_to_counter(struct op_event const * pev[], int nr_events,
     37                               op_cpu cpu_type);
     38 
     39 #ifdef __cplusplus
     40 }
     41 #endif
     42 
     43 #endif /* !OP_ALLOC_COUNTER_H */
     44