From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752473AbdLKPez (ORCPT ); Mon, 11 Dec 2017 10:34:55 -0500 Received: from mail-qt0-f182.google.com ([209.85.216.182]:35152 "EHLO mail-qt0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752041AbdLKPew (ORCPT ); Mon, 11 Dec 2017 10:34:52 -0500 X-Google-Smtp-Source: ACJfBosDq2bqa9U1vYN4Es2H5m+XOFPdXFaE5TJCjhCAVhOYykxesXQw7uNsCHhx/RYE3kQEUOi2fw== Date: Mon, 11 Dec 2017 07:34:49 -0800 From: Tejun Heo To: Jiri Olsa Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Alexander Shishkin , Namhyung Kim , linux-kernel@vger.kernel.org, kernel-team@fb.com Subject: Re: [RFC] Sharing PMU counters across compatible events Message-ID: <20171211153449.GJ2421075@devbig577.frc2.facebook.com> References: <20171201141950.GB2421075@devbig577.frc2.facebook.com> <20171206114204.GB10580@krava> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171206114204.GB10580@krava> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, Jiri. On Wed, Dec 06, 2017 at 12:42:04PM +0100, Jiri Olsa wrote: > I see this rather on the hw level, since it concerns HW counters > > I think we could detect same (alias) events at the time counters > are added/removed on/from the cpu and share their HW part like > counter idx, regs and such (struct hw_perf_event_cpu in my changes) > > this way it'd be completely transparent for generic code I don't quite follow why doing this in arch code is better than generic. Doing this in arch means we'd need to do the same thing multiple times for different archs. Why is that better? Thanks. -- tejun