summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/x86/machine/pmu_intel.c23
1 files changed, 1 insertions, 22 deletions
diff --git a/arch/x86/machine/pmu_intel.c b/arch/x86/machine/pmu_intel.c
index c1ee3885..6e3f946e 100644
--- a/arch/x86/machine/pmu_intel.c
+++ b/arch/x86/machine/pmu_intel.c
@@ -143,27 +143,6 @@ pmu_intel_ack_status(uint64_t status)
return cpu_set_msr64(PMU_INTEL_MSR_GLOBAL_OVF_CTRL, status);
}
-/*
- * TODO Use the compiler built-in once libgcc is linked again.
- */
-static unsigned int
-pmu_popcount(unsigned int bits)
-{
- unsigned int count;
-
- count = 0;
-
- while (bits) {
- if (bits & 1) {
- count++;
- }
-
- bits >>= 1;
- }
-
- return count;
-}
-
static int
pmu_intel_translate(unsigned int *raw_event_idp, unsigned event_id)
{
@@ -380,7 +359,7 @@ pmu_intel_setup(void)
perfmon_register(&pmu_intel_dev);
log_info("pmu: intel v%d, nr_pmcs:%u pmc_width:%u events:%#x nr_events:%u",
pmu->version, pmu->nr_pmcs, pmu->pmc_width, pmu->events,
- pmu_popcount(pmu->events));
+ __builtin_popcount(pmu->events));
return 0;
}