On Thu, 2010-04-29 at 11:29 +0800, Deng-Cheng Zhu wrote: > > And then you need to compile the user-space tools/perf with the following steps > > if want to local-compile it: > > And if you want to cross compile it, besides changing > tools/perf/perf.h, tools/perf/Makefile also needs to have proper > CFLAGS/LDFLAGS for headers and libs. Then it's OK to fire "make > CROSS_COMPILE=$toolchain_prefix". > > > Currently, seems "./perf record" and lots of software events not work, anybody > > have interest in playing with it can refer to {tools/perf/Documentation, > > arch/mips/kernel/perf_event*, arch/mips/include/asm/pmu.h, > > arch/x86/kernel/cpu/perf_event*, arch/arm/kernel/perf_event* ...}. > > "perf record" works fine on 24K/34K/74K cores. In addition, If you are > seeing the message "Couldn't record kernel reference relocation > symbol", and your kernel symbols only have _stext (without _text), > then search "_text" in builtin-record.c and replace with "_stext". > Here is the link: http://lkml.org/lkml/2010/1/18/177 Yeah, I have seen the message but have not looked into it, thanks! > > For software events, it should be able to work without specific > changes for loongson, I suppose. Because changes have been done to > common MIPS code to support software events. > Perhaps need to enable some related kernel options for the "kmem:..." is not in the result of "./perf list", I will check it later. > > config HW_PERF_EVENTS > > bool "Enable hardware performance counter support for perf events" > > - depends on PERF_EVENTS && !MIPS_MT_SMTC && OPROFILE=n && CPU_MIPS32 > > + depends on PERF_EVENTS && !MIPS_MT_SMTC && OPROFILE=n > > default y > > help > > Enable hardware performance counter support for perf events. If > > How about adding CPU_LOONGSON2* instead of deleting CPU_MIPS32? > Because we want the perf functionality to be available when we are > able to choose it.. Okay, will apply it in the next revision. BTW: After comparing this patch and your arch/mips/kernel/perf_event_mipsxx.c, perhaps we can share more common functions, such as hw_perf_event_destroy(), hw_perf_enable(), hw_perf_disable() and handle_associated_event()... Thanks & Regards, Wu Zhangjin