On Sat, 2010-04-17 at 09:49 +0800, dengcheng.zhu wrote: [...] > > > > I think it will not work on rm9000 and loongson2 for their performance > > counters are different from mipsxx. so suggest you only enable this for > > mipsxxx(refer to arch/mips/oprofile/Makefile) via #ifdef and renaming > > the current perf_event.c to perf_event_mipsxx.c. > OK, I'll try to move the control/count help functions/defines and the > specific mips_pmu stuff into a file called perf_event_mipsxx.c, and leave > the common things in perf_event.c, so that when we implement Perf for > loongson2 or rm9000, we can simply add new files like > perf_event_loongson2.c. > > > And to reduce the source code duplication, perhaps we need a solution to > > share the source code between Oprofile and Perf, and also among mipsxx, > > rm9000 and loongson2. > I think there is almost nothing for the count/control things which can be > shared among mipsxx/rm9000/loongson2. As for sharing between Oprofile and > Perf, how about moving mipsxx/rm9000/loongson2 count/control things into a > new file asm/pmu.h, where we use #ifdef's. > It looks good, based on your work, I will try to add the loongson2 specific perf support, then we can get more details about the common parts. Regards, Wu Zhangjin