Blame src/perfctr-2.7.x/examples/global/ppc.c
|
Packit |
577717 |
/* $Id: ppc.c,v 1.2 2004/06/21 22:24:30 mikpe Exp $
|
|
Packit |
577717 |
* PPC32-specific code.
|
|
Packit |
577717 |
*
|
|
Packit |
577717 |
* Copyright (C) 2004 Mikael Pettersson
|
|
Packit |
577717 |
*/
|
|
Packit |
577717 |
#include <stdio.h>
|
|
Packit |
577717 |
#include <stdlib.h>
|
|
Packit |
577717 |
#include <string.h>
|
|
Packit |
577717 |
#include "libperfctr.h"
|
|
Packit |
577717 |
#include "arch.h"
|
|
Packit |
577717 |
|
|
Packit |
577717 |
void setup_control(const struct perfctr_info *info,
|
|
Packit |
577717 |
struct perfctr_cpu_control *control)
|
|
Packit |
577717 |
{
|
|
Packit |
577717 |
memset(control, 0, sizeof *control);
|
|
Packit |
577717 |
control->tsc_on = 1;
|
|
Packit |
577717 |
if (info->cpu_type > PERFCTR_PPC_GENERIC) {
|
|
Packit |
577717 |
control->nractrs = 1;
|
|
Packit |
577717 |
control->pmc_map[0] = 0;
|
|
Packit |
577717 |
control->evntsel[0] = 0x02; /* INSTRUCTIONS_COMPLETED */
|
|
Packit |
577717 |
counting_mips = 1;
|
|
Packit |
577717 |
}
|
|
Packit |
577717 |
}
|