linux-mips
[Top] [All Lists]

Re: [Perfctr-devel] 2.6.19-rc6-git10 new perfmon code base + libpfm + pf

To: "Philip J. Mucci" <phil@sicortex.com>
Subject: Re: [Perfctr-devel] 2.6.19-rc6-git10 new perfmon code base + libpfm + pfmon
From: Ralf Baechle <ralf@linux-mips.org>
Date: Tue, 28 Nov 2006 18:20:49 +0000
Cc: eranian@hpl.hp.com, perfmon@napali.hpl.hp.com, linux-mips@linux-mips.org
In-reply-to: <1164725427.2316.109.camel@localhost.localdomain>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20061127143705.GC24980@frankl.hpl.hp.com> <1164725427.2316.109.camel@localhost.localdomain>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.4.2.2i
On Tue, Nov 28, 2006 at 03:50:27PM +0100, Philip J. Mucci wrote:

> Linux-MIPS users will need the following patch to add the 'cpu'
> directories to sysfs.

This patch is to some file which doesn't even exist in standard
kernels.  Nor should it be done in the perfmon code if it did exist in
the stock kernel.

> Index: perfmon/perfmon_sysfs.c
> ===================================================================
> --- perfmon/perfmon_sysfs.c   (.../perfmon2-post-sf-pre-fixup)        
> (revision 27882)
> +++ perfmon/perfmon_sysfs.c   (.../perfmon2-post-sf-post-fixup)       
> (revision 27882)
> @@ -79,6 +79,10 @@
>  
>  static struct kobject pfm_kernel_kobj, pfm_kernel_fmt_kobj;
>  
> +/* Remove this after mips get topology.c files */

Why should there be one?  I guess you were looking for topology_init
which exists since Febuary 20 / linux-2.6.16-rc5 and does register all
CPUs.

> +struct cpu sysfs_cpus[NR_CPUS];
> +
>  static void pfm_reset_stats(int cpu)
>  {
>       struct pfm_stats *st;
> @@ -400,6 +404,19 @@
>       int done_kobj_fmt = 0, done_kobj_kernel = 0;
>       int i, cpu = -1;
>       
> +     /* This is a hack to be removed */
> +
> +        for_each_present_cpu(i) {
> +          ret = register_cpu(&sysfs_cpus[i],i,NULL);
> +          if (ret)
> +            {
> +              PFM_INFO("cannot register cpu %d: %d\n",i,ret);
> +              goto error;
> +            }
> +        }
> +
> +     /* End hack */

Formatting style, see Documentation/CodingStyle.

  Ralf

<Prev in Thread] Current Thread [Next in Thread>