예제 #1
0
#define THOUSAND	(1000.0)
#define MILLION		(THOUSAND * THOUSAND)
#define BILLION		(THOUSAND * MILLION)
#define TRILLION	(THOUSAND * BILLION)
#define QUADRILLION	(THOUSAND * TRILLION)
#define QUINTILLION	(THOUSAND * QUADRILLION)

#define PERF_INVALID     (~0ULL)

#define PERF_INFO(type, config)	\
	{ PERF_ ## config, PERF_TYPE_ ## type, PERF_COUNT_ ## config }

/* perf counters to be read */
static const perf_info_t perf_info[PERF_MAX] = {
	PERF_INFO(HARDWARE, HW_CPU_CYCLES),
	PERF_INFO(HARDWARE, HW_INSTRUCTIONS),
};

int perf_start(perf_t *p, const pid_t pid)
{
	int i;

	memset(p, 0, sizeof(perf_t));
	p->perf_opened = 0;

	for (i = 0; i < PERF_MAX; i++) {
		p->perf_stat[i].fd = -1;
		p->perf_stat[i].counter = 0;
	}
예제 #2
0
#define PERF_COUNT_TP_SIGNAL_DELIVER		UNRESOLVED
#define PERF_COUNT_TP_PAGE_FAULT_USER		UNRESOLVED
#define PERF_COUNT_TP_PAGE_FAULT_KERNEL		UNRESOLVED
#define PERF_COUNT_TP_IRQ_ENTRY			UNRESOLVED
#define PERF_COUNT_TP_IRQ_EXIT			UNRESOLVED
#define PERF_COUNT_TP_SOFTIRQ_ENTRY		UNRESOLVED
#define PERF_COUNT_TP_SOFTIRQ_EXIT		UNRESOLVED
#define PERF_COUNT_TP_RCU_UTILIZATION		UNRESOLVED
#define PERF_COUNT_TP_WRITEBACK_DIRTY_INODE	UNRESOLVED
#define PERF_COUNT_TP_WRITEBACK_DIRTY_PAGE	UNRESOLVED



/* perf counters to be read */
static perf_info_t perf_info[STRESS_PERF_MAX + 1] = {
	PERF_INFO(HARDWARE, HW_CPU_CYCLES,		"CPU Cycles"),
	PERF_INFO(HARDWARE, HW_INSTRUCTIONS,		"Instructions"),
	PERF_INFO(HARDWARE, HW_CACHE_REFERENCES,	"Cache References"),
	PERF_INFO(HARDWARE, HW_CACHE_MISSES,		"Cache Misses"),
	PERF_INFO(HARDWARE, HW_STALLED_CYCLES_FRONTEND,	"Stalled Cycles Frontend"),
	PERF_INFO(HARDWARE, HW_STALLED_CYCLES_BACKEND,	"Stalled Cycles Backend"),
	PERF_INFO(HARDWARE, HW_BRANCH_INSTRUCTIONS,	"Branch Instructions"),
	PERF_INFO(HARDWARE, HW_BRANCH_MISSES,		"Branch Misses"),
	PERF_INFO(HARDWARE, HW_BUS_CYCLES,		"Bus Cycles"),
	PERF_INFO(HARDWARE, HW_REF_CPU_CYCLES,		"Total Cycles"),

	PERF_INFO(SOFTWARE, SW_PAGE_FAULTS_MIN,		"Page Faults Minor"),
	PERF_INFO(SOFTWARE, SW_PAGE_FAULTS_MAJ,		"Page Faults Major"),
	PERF_INFO(SOFTWARE, SW_CONTEXT_SWITCHES,	"Context Switches"),
	PERF_INFO(SOFTWARE, SW_CPU_MIGRATIONS,		"CPU Migrations"),
	PERF_INFO(SOFTWARE, SW_ALIGNMENT_FAULTS,	"Alignment Faults"),