Ejemplo n.º 1
0
int read_data(uint64_t* inst, uint64_t* core, uint64_t* ref) {
    int i;
    get_fixed_ctr_values(&c0, &c1, &c2);
    for(i=0;i<NUM_THREADS;i++) {
        //if(inst != NULL) {
            if(last_inst[i]>c0.value[i]) {
                inst[i] = c0.value[i] + 0xFFFFFFFFFFFF - last_inst[i];
            } else {
                inst[i] = c0.value[i] - last_inst[i];
            }
            last_inst[i] = c0.value[i];
        //}
        //if(core != NULL) {
            if(last_core[i]>c1.value[i]) {
                core[i] = c1.value[i] + 0xFFFFFFFFFFFF - last_core[i];
            } else {
                core[i] = c1.value[i]-last_core[i];
            }
            last_core[i] = c1.value[i];
        //}
        //if(ref != NULL) {
            ref[i] = c2.value[i]-last_ref[i];
            last_ref[i] = c2.value[i];
        //}
    }
    return 0;
}
Ejemplo n.º 2
0
void
dump_fixed_terse(){
	int i;
	get_fixed_ctr_values( &c0, &c1, &c2 );
	for(i=0; i<NUM_THREADS; i++){
		fprintf(stdout, "%lu %lu %lu ", c0.value[i], c1.value[i], c2.value[i]);
	}

}