Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753330AbbEKJsa (ORCPT ); Mon, 11 May 2015 05:48:30 -0400 Received: from mail-wi0-f178.google.com ([209.85.212.178]:34816 "EHLO mail-wi0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752539AbbEKJs0 (ORCPT ); Mon, 11 May 2015 05:48:26 -0400 Date: Mon, 11 May 2015 11:48:21 +0200 From: Ingo Molnar To: Andy Lutomirski Cc: Len Brown , Peter Zijlstra , "linux-kernel@vger.kernel.org" , Paul Mackerras , Ingo Molnar , Arnaldo Carvalho de Melo Subject: Re: [RFC] x86, perf: Add an aperfmperf driver Message-ID: <20150511094821.GA7027@gmail.com> References: <2c37309d20afadf88ad4a82cf0ce02b9152801e2.1430256154.git.luto@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2c37309d20afadf88ad4a82cf0ce02b9152801e2.1430256154.git.luto@kernel.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1032 Lines: 27 * Andy Lutomirski wrote: > + event->hw.idx = -1; > + event->hw.event_base = (event->attr.config == APERFMPERF_EVENT_APERF ? > + MSR_IA32_APERF : MSR_IA32_MPERF); So instead of having a separate driver per MSR, I think it might be more useful to have a generic 'MSR as counters' PMU driver, for such really simple cases where MSR contents represent an interesting hardware metric, and have a table that enumerates the MSRs we allow to be measured, and a sysfs list of them, to allow easy discovery. APERF/MPERF would be one such MSR, MSR_SMI_COUNT another one - but there are also other interesting ones. Some of these are per CPU, some are system wide. Such an approach would be far more robust than tooling poking around in /dev/msr (!). Thanks, Ingo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/