Ejemplo n.º 1
0
static void collect_pmc(struct stats_type *type)
{
  int i;
  for (i = 0; i < nr_cpus; i++) {
    char cpu[80];
    snprintf(cpu, sizeof(cpu), "%d", i);

    if (cpu_is_nehalem(cpu))
      collect_pmc_cpu(type, cpu);
  }
}
Ejemplo n.º 2
0
static int intel_pmc3_begin(struct stats_type *type)
{
  int nr = 0;

  uint64_t events[] = {
    MEM_UNCORE_RETIRED_REMOTE_DRAM,
    MEM_UNCORE_RETIRED_LOCAL_DRAM,
    FP_COMP_OPS_EXE_X87,
    MEM_LOAD_RETIRED_L1D_HIT,
  };

  int i;
  for (i = 0; i < nr_cpus; i++) {
    char cpu[80];
    snprintf(cpu, sizeof(cpu), "%d", i);

    if (cpu_is_nehalem(cpu))
      if (intel_pmc3_begin_cpu(cpu, events, 4) == 0)
	nr++; /* HARD */
  }

  return nr > 0 ? 0 : -1;
}