From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Fleming Subject: Re: [PATCH 6/6] sh: oprofile: Use perf-events oprofile backend Date: Mon, 27 Sep 2010 21:01:38 +0100 Message-ID: <20100927200138.GG28588@console-pimps.org> References: <20100916143254.GC13563@erda.amd.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20100916143254.GC13563@erda.amd.com> Sender: linux-sh-owner@vger.kernel.org To: Robert Richter Cc: Will Deacon , Paul Mundt , Russell King , "linux-arm-kernel@lists.infradead.org" , "linux-sh@vger.kernel.org" , Peter Zijlstra , Ingo Molnar , Frederic Weisbecker , Arnaldo Carvalho de Melo , "linux-arch@vger.kernel.org" List-Id: linux-arch.vger.kernel.org On Thu, Sep 16, 2010 at 04:32:54PM +0200, Robert Richter wrote: > > diff --git a/arch/sh/kernel/perf_event.c b/arch/sh/kernel/perf_event.c > > index 2cb9ad5..3c3fc9a 100644 > > --- a/arch/sh/kernel/perf_event.c > > +++ b/arch/sh/kernel/perf_event.c > > @@ -59,6 +59,14 @@ static inline int sh_pmu_initialized(void) > > return !!sh_pmu; > > } > > > > +const char *sh_pmu_name(void) > > +{ > > + if (!sh_pmu) > > + return NULL; > > + > > + return sh_pmu->name; > > +} > > Couldn't we make this a generic function like perf_num_counters()? Well, ARM doesn't have names as strings for its pmus currently. What's more, ARM wouldn't use it; SH would be the only user of this function. I don't think this one makes sense to be a generic function. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from arkanian.console-pimps.org ([212.110.184.194]:56478 "EHLO arkanian.console-pimps.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933518Ab0I0UBk (ORCPT ); Mon, 27 Sep 2010 16:01:40 -0400 Date: Mon, 27 Sep 2010 21:01:38 +0100 From: Matt Fleming Subject: Re: [PATCH 6/6] sh: oprofile: Use perf-events oprofile backend Message-ID: <20100927200138.GG28588@console-pimps.org> References: <20100916143254.GC13563@erda.amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100916143254.GC13563@erda.amd.com> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Robert Richter Cc: Will Deacon , Paul Mundt , Russell King , "linux-arm-kernel@lists.infradead.org" , "linux-sh@vger.kernel.org" , Peter Zijlstra , Ingo Molnar , Frederic Weisbecker , Arnaldo Carvalho de Melo , "linux-arch@vger.kernel.org" Message-ID: <20100927200138.zUm6YZlUCFgwHJaJLSefoccHDGbzi2jRMkCffQbEx6Q@z> On Thu, Sep 16, 2010 at 04:32:54PM +0200, Robert Richter wrote: > > diff --git a/arch/sh/kernel/perf_event.c b/arch/sh/kernel/perf_event.c > > index 2cb9ad5..3c3fc9a 100644 > > --- a/arch/sh/kernel/perf_event.c > > +++ b/arch/sh/kernel/perf_event.c > > @@ -59,6 +59,14 @@ static inline int sh_pmu_initialized(void) > > return !!sh_pmu; > > } > > > > +const char *sh_pmu_name(void) > > +{ > > + if (!sh_pmu) > > + return NULL; > > + > > + return sh_pmu->name; > > +} > > Couldn't we make this a generic function like perf_num_counters()? Well, ARM doesn't have names as strings for its pmus currently. What's more, ARM wouldn't use it; SH would be the only user of this function. I don't think this one makes sense to be a generic function.