src/libpfm4/lib/pfmlib_perf_event_pmu.c
/*
 * clone static event table into a  dynamic
 * event table
 *
 * Used for tracepoints
 */
clone static event table into a  dynamic
event table

Used for tracepoints
clone static event table into a dynamic event table Used for tracepoints
static perf_event_t *
perf_table_clone(void)
{
	perf_event_t *addr;
	perf_pe_count = perf_nevents + PERF_ALLOC_EVENT_COUNT;
	addr = calloc(perf_pe_count, sizeof(perf_event_t));
	if (addr) {
		memcpy(addr, perf_static_events, perf_nevents * sizeof(perf_event_t));
		perf_pe_free = addr + perf_nevents;
		perf_pe_end = perf_pe_free + PERF_ALLOC_EVENT_COUNT;
		perf_pe = addr;
	}
	return addr;
}
static perf_event_t * perf_table_clone ( void ) { perf_event_t * addr ; perf_pe_count = perf_nevents + PERF_ALLOC_EVENT_COUNT ; addr = calloc ( perf_pe_count , sizeof ( perf_event_t ) ) ; if ( addr ) { memcpy ( addr , perf_static_events , perf_nevents * sizeof ( perf_event_t ) ) ; perf_pe_free = addr + perf_nevents ; perf_pe_end = perf_pe_free + PERF_ALLOC_EVENT_COUNT ; perf_pe = addr ; } return addr ; }
clone static event table into a  dynamic
 event table
clone static event table into a dynamic event table