On 02/17/2011 02:46 AM, Deng-Cheng Zhu wrote:
Hi, David
[...]
And here's a general comment: You are putting the majority of the implementation in perf_event_mipsxx.c. This will require other CPUs like Loongson2 to replicate quite a lot code in their corresponding files.
There is no such implementation. But if someone were to create one, I would suggest they move common code to a separate file that would be shared among the implementations that need it.
I personally think the original "skeleton + #include perf_event_$cpu.c" is a better choice. I understand you prefer not using code like "#if defined(CONFIG_CPU_MIPS32)" on the top of perf_event_$cpu.c, but that is what other architectures (X86/ARM etc) are doing.
Existing poor practice is not a good reason to do this. David Daney