From mboxrd@z Thu Jan 1 00:00:00 1970 From: Robert Richter Subject: Re: [PATCH 4/7] ARM: oprofile: Move non-ARM code into separate init/exit Date: Wed, 6 Oct 2010 16:59:03 +0200 Message-ID: <20101006145903.GR13563@erda.amd.com> References: <74092b0d162aafc21e408033cec6146e227363b5.1286222593.git.matt@console-pimps.org> <20101006133309.GP13563@erda.amd.com> <20101006144921.GQ13563@erda.amd.com> <20101006145311.GA3754@linux-sh.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Return-path: Content-Disposition: inline In-Reply-To: <20101006145311.GA3754@linux-sh.org> Sender: linux-sh-owner@vger.kernel.org To: Paul Mundt Cc: Matt Fleming , Will Deacon , 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" , "linux-kernel@vger.kernel.org" , Deng-Cheng Zhu , Grant Likely List-Id: linux-arch.vger.kernel.org On 06.10.10 10:53:11, Paul Mundt wrote: > On Wed, Oct 06, 2010 at 04:49:21PM +0200, Robert Richter wrote: > > On 06.10.10 15:33:09, Robert Richter wrote: > > > On 04.10.10 16:44:22, Matt Fleming wrote: > > > > -void __exit oprofile_arch_exit(void) > > > > +int __init oprofile_arch_init(struct oprofile_operations *ops) > > > > +{ > > > > > > We should do here a: > > > > > > memset(ops, 0, sizeof(*ops)); > > > > Matt, > > > > an alternative would be to move this to oprofile_perf_init() and > > modify ops->backtrace afterwards, but then we will lose the function's > > tail call. Not sure that is better. Paul, what do you think? > > > I'm a bit confused as to why we just don't do: > > --- > > diff --git a/drivers/oprofile/oprof.c b/drivers/oprofile/oprof.c > index b336cd9..76d97a5 100644 > --- a/drivers/oprofile/oprof.c > +++ b/drivers/oprofile/oprof.c > @@ -252,6 +252,8 @@ static int __init oprofile_init(void) > { > int err; > > + memset(&oprofile_ops, 0, sizeof(struct oprofile_operations)); > + Yes, this looks much better. Thanks Paul. -Robert > err = oprofile_arch_init(&oprofile_ops); > if (err < 0 || timer) { > printk(KERN_INFO "oprofile: using timer interrupt.\n"); > -- Advanced Micro Devices, Inc. Operating System Research Center From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from tx2ehsobe003.messaging.microsoft.com ([65.55.88.13]:46460 "EHLO TX2EHSOBE005.bigfish.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755829Ab0JFO7Q (ORCPT ); Wed, 6 Oct 2010 10:59:16 -0400 Date: Wed, 6 Oct 2010 16:59:03 +0200 From: Robert Richter Subject: Re: [PATCH 4/7] ARM: oprofile: Move non-ARM code into separate init/exit Message-ID: <20101006145903.GR13563@erda.amd.com> References: <74092b0d162aafc21e408033cec6146e227363b5.1286222593.git.matt@console-pimps.org> <20101006133309.GP13563@erda.amd.com> <20101006144921.GQ13563@erda.amd.com> <20101006145311.GA3754@linux-sh.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20101006145311.GA3754@linux-sh.org> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Paul Mundt Cc: Matt Fleming , Will Deacon , 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" , "linux-kernel@vger.kernel.org" , Deng-Cheng Zhu , Grant Likely Message-ID: <20101006145903.J6NBhxde5s5R2dZW6HPWd0tH9bG0nZx5MQaVAPy2maE@z> On 06.10.10 10:53:11, Paul Mundt wrote: > On Wed, Oct 06, 2010 at 04:49:21PM +0200, Robert Richter wrote: > > On 06.10.10 15:33:09, Robert Richter wrote: > > > On 04.10.10 16:44:22, Matt Fleming wrote: > > > > -void __exit oprofile_arch_exit(void) > > > > +int __init oprofile_arch_init(struct oprofile_operations *ops) > > > > +{ > > > > > > We should do here a: > > > > > > memset(ops, 0, sizeof(*ops)); > > > > Matt, > > > > an alternative would be to move this to oprofile_perf_init() and > > modify ops->backtrace afterwards, but then we will lose the function's > > tail call. Not sure that is better. Paul, what do you think? > > > I'm a bit confused as to why we just don't do: > > --- > > diff --git a/drivers/oprofile/oprof.c b/drivers/oprofile/oprof.c > index b336cd9..76d97a5 100644 > --- a/drivers/oprofile/oprof.c > +++ b/drivers/oprofile/oprof.c > @@ -252,6 +252,8 @@ static int __init oprofile_init(void) > { > int err; > > + memset(&oprofile_ops, 0, sizeof(struct oprofile_operations)); > + Yes, this looks much better. Thanks Paul. -Robert > err = oprofile_arch_init(&oprofile_ops); > if (err < 0 || timer) { > printk(KERN_INFO "oprofile: using timer interrupt.\n"); > -- Advanced Micro Devices, Inc. Operating System Research Center