From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751963AbdIEOBf (ORCPT ); Tue, 5 Sep 2017 10:01:35 -0400 Received: from mga11.intel.com ([192.55.52.93]:12729 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751031AbdIEOBa (ORCPT ); Tue, 5 Sep 2017 10:01:30 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,480,1498546800"; d="scan'208";a="131894744" From: Alexander Shishkin To: Peter Zijlstra Cc: Ingo Molnar , linux-kernel@vger.kernel.org, acme@redhat.com, kirill.shutemov@linux.intel.com, Borislav Petkov , rric@kernel.org, Alexander Shishkin Subject: [RFC PATCH 17/17] perf/x86/intel/bts: Add PMU info Date: Tue, 5 Sep 2017 16:30:26 +0300 Message-Id: <20170905133026.13689-18-alexander.shishkin@linux.intel.com> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20170905133026.13689-1-alexander.shishkin@linux.intel.com> References: <20170905133026.13689-1-alexander.shishkin@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Signed-off-by: Alexander Shishkin --- arch/x86/events/intel/bts.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/arch/x86/events/intel/bts.c b/arch/x86/events/intel/bts.c index 16076eb346..ce1dac7115 100644 --- a/arch/x86/events/intel/bts.c +++ b/arch/x86/events/intel/bts.c @@ -21,13 +21,22 @@ #include #include #include -#include #include #include #include "../perf_event.h" +#define PMU_NAME "intel_bts" + +static struct intel_bts_pmu_info { + struct pmu_info pi; + u8 x86_family; + u8 x86_model; + u8 x86_step; + u8 __reserved_0[5]; +} bts_pmu_info; + struct bts_ctx { struct perf_output_handle handle; struct debug_store ds_back; @@ -582,6 +591,12 @@ static __init int bts_init(void) if (!boot_cpu_has(X86_FEATURE_DTES64) || !x86_pmu.bts) return -ENODEV; + bts_pmu_info.pi.note_size = sizeof(bts_pmu_info.pi); + bts_pmu_info.pi.pmu_descsz = sizeof(bts_pmu_info) - bts_pmu_info.pi.note_size; + bts_pmu_info.x86_family = boot_cpu_data.x86; + bts_pmu_info.x86_model = boot_cpu_data.x86_model; + bts_pmu_info.x86_step = boot_cpu_data.x86_mask; + bts_pmu.capabilities = PERF_PMU_CAP_AUX_NO_SG | PERF_PMU_CAP_ITRACE | PERF_PMU_CAP_EXCLUSIVE; bts_pmu.task_ctx_nr = perf_sw_context; @@ -593,7 +608,8 @@ static __init int bts_init(void) bts_pmu.read = bts_event_read; bts_pmu.setup_aux = bts_buffer_setup_aux; bts_pmu.free_aux = bts_buffer_free_aux; + bts_pmu.pmu_info = &bts_pmu_info.pi; - return perf_pmu_register(&bts_pmu, "intel_bts", -1); + return perf_pmu_register(&bts_pmu, PMU_NAME, -1); } arch_initcall(bts_init); -- 2.14.1