kernprof
[Top] [All Lists]

Help! about PMC domain

To: kernprof@xxxxxxxxxxx, owner-kernprof@xxxxxxxxxxx
Subject: Help! about PMC domain
From: "laohu" <greatfox@xxxxxxxx>
Date: 8 Dec 2003 09:55:36 +0800
Cc: dave.jiang@xxxxxxxxx, yshi7@xxxxxxx, hawkes@xxxxxxx, usf_sai@xxxxxxxxx, castor@xxxxxxxxxxxx
Reply-to: "laohu" <greatfox@xxxxxxxx>
Sender: kernprof-bounce@xxxxxxxxxxx
Hi all:
  I am a newbie, and i am employing KERNPROF to evaluate
something, but a problem is obsessing me.
when i tried to run it on a 2-way Xeon machine, some
troubles occurred.
In time domain it has no any problem, but in PMC domain kernprof
reports as follows:
kernel does not support PMC domain.

My kernel is 2.4.20.
i found there are several lines in smpboot.c:

#if defined(CONFIG_KERNPROF)
        /*
         * Set up all local APIC performance counter overflow vectors,
         * if available:
         */
        if (cpu_has_msr && boot_cpu_data.x86 == 6) 
                setup_APIC_perfctr();
#endif

but my system reported CPU family is 15, that's say, 
boot_cpu_data.x86 !=6, so i think this maybe lead to problem.
In another file: drivers/char/kernprof.c, 

        case PROF_SET_DOMAIN:
                if (arg != prof_domain)  /* changing domains stops profiling
*/
                        prof_stop();
                if (arg == PROF_DOMAIN_TIME) {
                        prof_domain = arg;
                        prof_intr_hook = &prof_timer_hook;
                } else if (arg == PROF_DOMAIN_PERFCTR && have_perfctr()) {
                                                         ~~~~~~~~~~~~~~~
                         prof_domain = arg;
                        prof_intr_hook = &prof_perfctr_aux_hook;
                } else
                        err = -EINVAL;
                break;
have_perfctr() return 0, 
i found have_perfctr() in include/asm/kernprof.h:
#ifdef CONFIG_X86_LOCAL_APIC
#define have_perfctr() (cpu_has_msr && boot_cpu_data.x86 == 6)
...

i modified include/asm/kernprof.h to:
#define have_perfctr() (cpu_has_msr && boot_cpu_data.x86 >= 6)

and modified smpboot.c as follows:

        if (cpu_has_msr && boot_cpu_data.x86 >= 6) 
                setup_APIC_perfctr();

then compiled kernel and rebooted with new kernel,
this time, when running kernprof with "-d pmc", kernel panic.

who can give me some advices?
any comments are welcome.

Best regards.


 





--http://www.eyou.com
--Îȶ¨¿É¿¿µÄµç×ÓÐÅÏä  ÓïÒôÓʼþ  ÒÆ¶¯ÊéÇ©  ÈÕÀú·þÎñ  ÍøÂç´æ´¢...ÒÚÓÊδ¾¡

--http://vip.eyou.com
--¿ì¿ìµÇ¼ÒÚÓÊVIPÐÅÏä  ×¢²áÄúÖÐÒâµÄÓû§Ãû



<Prev in Thread] Current Thread [Next in Thread>
  • Help!&nbsp;about&nbsp;PMC&nbsp;domain, laohu <=