Changeset View
Changeset View
Standalone View
Standalone View
lib/libpmc/libpmc_pmu_util.c
Show First 20 Lines • Show All 536 Lines • ▼ Show 20 Lines | if (pmu_parse_event(&ped, pe->event)) | ||||
return (ENOENT); | return (ENOENT); | ||||
if (mfr == PMU_INTEL) | if (mfr == PMU_INTEL) | ||||
return (pmc_pmu_intel_pmcallocate(event_name, pm, &ped)); | return (pmc_pmu_intel_pmcallocate(event_name, pm, &ped)); | ||||
else | else | ||||
return (pmc_pmu_amd_pmcallocate(event_name, pm, &ped)); | return (pmc_pmu_amd_pmcallocate(event_name, pm, &ped)); | ||||
} | } | ||||
/* | |||||
* Ultimately rely on AMD calling theirs the same | |||||
*/ | |||||
static const char *stat_mode_cntrs[] = { | |||||
"cpu_clk_unhalted.thread", | |||||
"inst_retired.any", | |||||
"br_inst_retired.all_branches", | |||||
"br_misp_retired.all_branches", | |||||
"longest_lat_cache.reference", | |||||
"longest_lat_cache.miss", | |||||
}; | |||||
int | |||||
pmc_pmu_stat_mode(const char ***cntrs) | |||||
{ | |||||
if (pmc_pmu_enabled()) { | |||||
*cntrs = stat_mode_cntrs; | |||||
return (0); | |||||
} | |||||
return (EOPNOTSUPP); | |||||
} | |||||
#else | #else | ||||
uint64_t | uint64_t | ||||
pmc_pmu_sample_rate_get(const char *event_name __unused) | pmc_pmu_sample_rate_get(const char *event_name __unused) | ||||
{ | { | ||||
return (DEFAULT_SAMPLE_COUNT); | return (DEFAULT_SAMPLE_COUNT); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 52 Lines • Show Last 20 Lines |