Go to the source code of this file.
|
| int | mpx_check (int EventSet) |
| |
| int | mpx_init (int) |
| |
| int | mpx_add_event (MPX_EventSet **, int EventCode, int domain, int granularity) |
| |
| int | mpx_remove_event (MPX_EventSet **, int EventCode) |
| |
| int | MPX_add_events (MPX_EventSet **mpx_events, int *event_list, int num_events, int domain, int granularity) |
| |
| int | MPX_stop (MPX_EventSet *mpx_events, long long *values) |
| |
| int | MPX_cleanup (MPX_EventSet **mpx_events) |
| |
| void | MPX_shutdown (void) |
| |
| int | MPX_reset (MPX_EventSet *mpx_events) |
| |
| int | MPX_read (MPX_EventSet *mpx_events, long long *values, int called_by_stop) |
| |
| int | MPX_start (MPX_EventSet *mpx_events) |
| |
◆ PAPI_MAX_SW_MPX_EVENTS
| #define PAPI_MAX_SW_MPX_EVENTS 32 |
◆ MPX_status
| Enumerator |
|---|
| MPX_STOPPED | |
| MPX_RUNNING | |
Definition at line 9 of file sw_multiplex.h.
◆ mpx_add_event()
| int mpx_add_event |
( |
MPX_EventSet ** |
, |
|
|
int |
EventCode, |
|
|
int |
domain, |
|
|
int |
granularity |
|
) |
| |
Definition at line 305 of file sw_multiplex.c.
309 int retval, alloced_newset = 0;
314 MPXDBG(
"Adding %p %#x\n",newset,EventCode);
334 MPXDBG(
"New thread at %p\n", t );
337 MPXDBG(
"New process at %p\n", t );
338 t->
tid = (
unsigned long ) getpid( );
358 if ( t->
tid == tid ) {
369 MPXDBG(
"New thread %lx\n", tid );
378 if ( newset == NULL ) {
380 if ( newset == NULL ) {
400 domain, granularity );
402 if ( alloced_newset ) {
412 *mpx_events = newset;
unsigned long int(* _papi_hwi_thread_id_fn)(void)
inline_static void mpx_hold(void)
static Threadlist * tlist
inline_static int _papi_hwi_lock(int lck)
inline_static int _papi_hwi_unlock(int lck)
static int mpx_insert_events(MPX_EventSet *, int *event_list, int num_events, int domain, int granularity)
#define MPXDBG(format, args...)
static MPX_EventSet * mpx_malloc(Threadlist *t)
struct _threadlist * next
inline_static void mpx_release(void)
◆ MPX_add_events()
| int MPX_add_events |
( |
MPX_EventSet ** |
mpx_events, |
|
|
int * |
event_list, |
|
|
int |
num_events, |
|
|
int |
domain, |
|
|
int |
granularity |
|
) |
| |
Definition at line 676 of file sw_multiplex.c.
int mpx_add_event(MPX_EventSet **mpx_events, int EventCode, int domain, int granularity)
◆ mpx_check()
| int mpx_check |
( |
int |
EventSet | ) |
|
Definition at line 1121 of file sw_multiplex.c.
1133 if ( strstr(
_papi_hwd[ESI->
CmpIdx]->cmp_info.name,
"perfctr.c" ) == NULL )
1137 unsigned int chk_domain =
1140 if ( ( ESI->
domain.
domain & chk_domain ) != chk_domain ) {
1142 (
"This platform requires PAPI_DOM_USER+PAPI_DOM_KERNEL+PAPI_DOM_SUPERVISOR\n" 1143 "to be set in the domain when using multiplexing. Instead, found %#x\n",
EventSetDomainInfo_t domain
EventSetInfo_t * _papi_hwi_lookup_EventSet(int eventset)
#define PAPI_DOM_SUPERVISOR
char model_string[PAPI_MAX_STR_LEN]
void PAPIERROR(char *format,...)
papi_mdi_t _papi_hwi_system_info
struct papi_vectors * _papi_hwd[]
◆ MPX_cleanup()
Definition at line 1069 of file sw_multiplex.c.
1075 if ( mpx_events == NULL )
1078 if ( *mpx_events == NULL )
inline_static void mpx_hold(void)
inline_static void mpx_release(void)
static void mpx_delete_events(MPX_EventSet *)
◆ mpx_init()
Definition at line 1152 of file sw_multiplex.c.
1154 #if defined(PTHREADS) || defined(_POWER6)
inline_static void mpx_hold(void)
static void mpx_shutdown_itimer(void)
static Threadlist * tlist
int PAPI_event_name_to_code(const char *in, int *out)
static void mpx_init_timers(int interval)
◆ MPX_read()
| int MPX_read |
( |
MPX_EventSet * |
mpx_events, |
|
|
long long * |
values, |
|
|
int |
called_by_stop |
|
) |
| |
Definition at line 823 of file sw_multiplex.c.
827 long long last_value[2];
828 long long cycles_this_slice = 0;
837 thread_data = mpx_events->
mythr;
845 ? last_value[0] : last_value[1];
859 #ifdef MPX_NONDECR_HYBRID 867 if (called_by_stop) {
876 ( cycles_this_slice +
880 (
"%s:%d:: Inactive %d, stop values=%lld (est. %lld, rate %g, cycles %lld)\n",
883 cycles_this_slice + thread_data->
total_c -
891 (
"%s:%d:: -Active- %d, stop values=%lld (est. %lld, rate %g, cycles %lld)\n",
901 mpx_events->
stop_c = thread_data->
total_c + cycles_this_slice;
910 long long elapsed_slices = 0;
924 elapsed_slices ? ( elapsed_values / elapsed_slices ) : 0;
926 MPXDBG(
"%s:%d:: event %d, values=%lld ( %lld - %lld), cycles %lld\n",
927 __FILE__, __LINE__,
i,
inline_static void mpx_hold(void)
long long stop_values[PAPI_MAX_SW_MPX_EVENTS]
long long start_hc[PAPI_MAX_SW_MPX_EVENTS]
struct _masterevent * mev[PAPI_MAX_SW_MPX_EVENTS]
struct _threadlist * mythr
#define MPXDBG(format, args...)
int PAPI_read(int EventSet, long long *values)
inline_static void mpx_release(void)
static long long values[NUM_EVENTS]
long long start_values[PAPI_MAX_SW_MPX_EVENTS]
◆ mpx_remove_event()
Definition at line 418 of file sw_multiplex.c.
inline_static void mpx_hold(void)
static void mpx_delete_one_event(MPX_EventSet *mpx_events, int Event)
inline_static void mpx_release(void)
◆ MPX_reset()
Definition at line 937 of file sw_multiplex.c.
inline_static void mpx_hold(void)
#define PAPI_MAX_SW_MPX_EVENTS
long long start_hc[PAPI_MAX_SW_MPX_EVENTS]
int MPX_read(MPX_EventSet *mpx_events, long long *values, int called_by_stop)
struct _masterevent * mev[PAPI_MAX_SW_MPX_EVENTS]
inline_static void mpx_release(void)
static long long values[NUM_EVENTS]
long long start_values[PAPI_MAX_SW_MPX_EVENTS]
◆ MPX_shutdown()
| void MPX_shutdown |
( |
void |
| ) |
|
Definition at line 1102 of file sw_multiplex.c.
1104 MPXDBG(
"%d\n", getpid( ) );
static void mpx_shutdown_itimer(void)
static Threadlist * tlist
static void mpx_restore_signal(void)
#define MPXDBG(format, args...)
struct _threadlist * next
◆ MPX_start()
Definition at line 692 of file sw_multiplex.c.
697 long long cycles_this_slice, current_thread_mpx_c = 0;
700 t = mpx_events->
mythr;
705 current_thread_mpx_c += t->
total_c;
713 cycles_this_slice = 0;
718 cycles_this_slice = 0;
738 #ifdef MPX_NONDECR_HYBRID 742 ( cycles_this_slice + t->
total_c -
747 ( (
values[0] / (
double ) cycles_this_slice ) *
802 MPXDBG(
"%s:%d:: start_c=%lld thread->total_c=%lld\n", __FILE__,
806 (
"%s:%d:: start_values[%d]=%lld estimate=%lld rate=%g last active=%lld\n",
808 mpx_events->
mev[
i]->count_estimate,
809 mpx_events->
mev[
i]->rate_estimate,
810 mpx_events->
mev[
i]->prev_total_c );
inline_static void mpx_hold(void)
long long stop_values[PAPI_MAX_SW_MPX_EVENTS]
long long start_hc[PAPI_MAX_SW_MPX_EVENTS]
struct _masterevent * mev[PAPI_MAX_SW_MPX_EVENTS]
static unsigned int randomseed
static int mpx_startup_itimer(void)
struct _threadlist * mythr
#define MPXDBG(format, args...)
int PAPI_read(int EventSet, long long *values)
inline_static void mpx_release(void)
int PAPI_start(int EventSet)
static long long values[NUM_EVENTS]
long long start_values[PAPI_MAX_SW_MPX_EVENTS]
◆ MPX_stop()
| int MPX_stop |
( |
MPX_EventSet * |
mpx_events, |
|
|
long long * |
values |
|
) |
| |
Definition at line 974 of file sw_multiplex.c.
976 int i, cur_mpx_event;
978 long long dummy_value[2];
984 if ( mpx_events == NULL )
1017 --mpx_events->
mev[
i]->active;
1018 if ( mpx_events->
mev[
i] == cur_event )
1026 if ( cur_mpx_event > -1 ) {
1029 if ( mev->
active == 0 ) {
1040 for (
tmp = ( cur_event->
next == NULL ) ? head : cur_event->
next;
1042 tmp = (
tmp->next == NULL ) ? head :
tmp->next ) {
1043 if (
tmp->active ) {
int PAPI_stop(int EventSet, long long *values)
inline_static void mpx_hold(void)
static void mpx_shutdown_itimer(void)
#define PAPI_MAX_SW_MPX_EVENTS
int MPX_read(MPX_EventSet *mpx_events, long long *values, int called_by_stop)
struct _masterevent * mev[PAPI_MAX_SW_MPX_EVENTS]
struct _masterevent * next
#define MPXDBG(format, args...)
static MasterEvent * get_my_threads_master_event_list(void)
inline_static void mpx_release(void)
int PAPI_start(int EventSet)
static long long values[NUM_EVENTS]