[PATCH] PPC64 collect and export low-level cpu usage statistics
linas
linas at austin.ibm.com
Fri Jan 27 07:44:32 EST 2006
And another comment:
On Thu, Jan 19, 2006 at 10:38:44AM -0600, Manish Ahuja was heard to remark:
> Index: linux-2.6.15-rc6/arch/powerpc/kernel/sysfs.c
> +static ssize_t show_dispatchedcycles(struct sys_device *, char *);
> +static ssize_t show_offline_cpu_cycles(struct sys_device *, char *);
> +
> +static SYSDEV_ATTR(offline_cpu_cycles, 0444, show_offline_cpu_cycles, NULL);
> +static SYSDEV_ATTR(cpu_dispatched_cycles, 0444, show_dispatchedcycles, NULL);
I think you need a #ifdef CONFIG_PPC64 around the above.
> - if (cpu_has_feature(CPU_FTR_SMT))
> + if (cpu_has_feature(CPU_FTR_SMT)) {
> sysdev_create_file(s, &attr_purr);
> + sysdev_create_file(s, &attr_offline_cpu_cycles);
> + sysdev_create_file(s, &attr_cpu_dispatched_cycles);
> + }
Shouldn't this be CPU_FTR_PURR not FTR_SMT ? (and also in the next
section too).
> +/* Defined in setup.c */
> +extern u64 offline_cpu_total_tb;
> +extern u64 offline_cpu_total_cpu_util;
> +extern u64 offline_cpu_total_krncycles;
> +extern u64 offline_cpu_total_idle;
These should be in a header file, probably arch/powerpc/kernel/setup.h
> +static ssize_t show_offline_cpu_cycles(struct sys_device *dev, char *buf)
#ifdef CONFIG_PPC64 surrounding the above ....
--linas
More information about the Linuxppc64-dev
mailing list