[PATCH] PPC64 collect and export low-level cpu usage statistics
Manish Ahuja
ahuja at austin.ibm.com
Wed Feb 1 06:11:54 EST 2006
Yes,
It probably is a good idea to have #define for it, but since purr is
only available on power5 architecture, none
of the other architecture's really need this code and maybe I should
enclose this for power5 setup only.
>>+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).
>
>
>
Yes, the original was FTR_SMT. I overlooked it. Thanks for pointing it out.
+/* 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
>
>
Okay, I can move it around, if its okay with everyone else.
Thanks for the comments.
More information about the Linuxppc64-dev
mailing list