From: Avi G. <av...@ch...> - 2010-11-07 15:39:03
|
Hi, We need to profile new architectures such as Nehalem. As our systems are based on Linux 2.6.18 sampling data we get is timer interrupt based only. This is obviously not adequate for our performance analysis needs. I saw that support of CPU model 26 (= Nehalem) was added in 2.6.31. I also realized that the relevant OProfile source code was moved from src/linux/arch/i386 to src/linux/arch/x86. This apparently raises migration issues. I tried to patch the 2.6.18 OProfile kernel modules' source code to add support of model 26 (e.g. according to the patch described in this list) yet it seemed that this partial patch was not enough. Is there a way to migrate support of new platforms to the source code of 2.6.18 kernel? Thanks, Avi |
From: Robert R. <rob...@am...> - 2010-11-08 15:41:08
|
On 07.11.10 10:38:53, Avi Gozlan wrote: > Is there a way to migrate support of new platforms to the source code of 2.6.18 kernel? As the kernel versions diverged much, you have to backport the changes manually. Another option would be to take the sources from a RHEL5 kernel (not sure which other distro is still using v2.6.18), but those changes may be incomplete for the model you are using. -Robert -- Advanced Micro Devices, Inc. Operating System Research Center |
From: William C. <wc...@re...> - 2010-11-08 16:04:17
|
On 11/07/2010 10:38 AM, Avi Gozlan wrote: > Hi, > > We need to profile new architectures such as Nehalem. As our systems are based on Linux 2.6.18 sampling data we get is timer interrupt based only. This is obviously not adequate for our performance analysis needs. > > I saw that support of CPU model 26 (= Nehalem) was added in 2.6.31. I also realized that the relevant OProfile source code was moved from src/linux/arch/i386 to src/linux/arch/x86. This apparently raises migration issues. > > I tried to patch the 2.6.18 OProfile kernel modules' source code to add support of model 26 (e.g. according to the patch described in this list) yet it seemed that this partial patch was not enough. > > Is there a way to migrate support of new platforms to the source code of 2.6.18 kernel? > > Thanks, > > Avi Hi Avi, A stopgap would be to use the arch_perfmon if that is available. Is this a kernel that has supports the arch_perfmon? Can you do the following on the machine: opcontrol --deinit modprobe oprofile arch_perfmon=1 opcontrol --init That should give "i386/arch_perfmon" for /dev/oprofile/cpu_type if it works. -Will |
From: John V. <jvi...@re...> - 2010-11-08 16:28:46
|
Robert Richter said the following on 11/08/10 10:40: > On 07.11.10 10:38:53, Avi Gozlan wrote: > >> Is there a way to migrate support of new platforms to the source code of 2.6.18 kernel? > > Another option would be to take the sources from a RHEL5 kernel (not > sure which other distro is still using v2.6.18), but those changes may > be incomplete for the model you are using. I did most of the backport of the Oprofile changes to RHEL 5.5 kernel to support Nehalem. You could look at the RHEL 5 SRPM: ftp://ftp.redhat.com/redhat/linux/enterprise/5Server/en/os/SRPMS/kernel-2.6.18-194.el5.src.rpm I think you would want to take a look at these patches: linux-2.6-misc-support-nehalem-ex-processors-in-oprofile.patch linux-2.6-oprofile-add-support-for-nehalem-ep-processors.patch linux-2.6-x86-make-bare-metal-oprofile-recognize-other-platforms.patch linux-2.6-x86-oprofile-enable-additional-perf-counters.patch linux-2.6-x86-oprofile-fix-k8-core2-on-multiple-cpus.patch linux-2.6-x86-oprofile-support-arch-perfmon.patch linux-2.6-x86-oprofile-utilize-perf-counter-reservation.patch Good luck! John -- John Villalovos Intel Corporation on-site partner engineer at Red Hat, Inc. http://tabasco.usersys.redhat.com/ |
From: Avi G. <av...@ch...> - 2011-03-22 16:58:53
|
Hi, Some time ago I asked about using OProfile on Nehalem assuming vmlinux-2.6.18 kernel (too old for Nehalem supplements). I got some replies one of which suggesting backporting from newer versions. Thanks a lot for your input. I got back to this recently and made some backport effort. I would be thankful if you could feedback whether I have done it correctly or modifications are required. I have patched the below suggested patches, yet I had to cut off some references to functions defined in the perfctr-watchdog. (I tried adding the relevant patch [linux-2.6-x86_64-nmi-add-perfctr-infrastructure.patch] in the first place but I realized that this causes me to add more and more patches). This looks to yield sampling of the 6 arch_perfmon counters. 1. My general question is: Assuming the NMI watchdog is not enabled (e.g. in grub), is it OK to patch OProfile kernel driver but not add the perfctr-watchdog in the kernel module? Is this reliable? Is it stable? (I'm not a kernel/hardware/OS developer) 2. More specifically, are the following cutoffs OK or are they harmful to OProfile kernel driver functionality? a. In arch/i386/oprofile/nmi_int.c comment out: /* if (unlikely(!avail_to_resrv_perfctr_nmi_bit(i))) continue; */ b. In the various arch/i386/oprofile/op_model*.c files comment out calls to: reserve_perfctr_nmi(),reserve_evntsel_nmi(),release_perfctr_nmi(),release_evntsel_nmi() Also, assign the relevant values in the registers, e.g. in op_model_ppro.c: msrs->counters[i].addr = MSR_P6_PERFCTR0 + i; c. Simply copy the definition of cpuid10_eax from the above watchdog patch to op_model_ppro.c Your feedback will let us use OProfile on Nehalem (x86_64) machines while being limited to 2.6.18 kernel. Thanks a lot for your input, Avi -----Original Message----- From: John Villalovos [mailto:jvi...@re...] Sent: Monday, November 08, 2010 6:29 PM To: Robert Richter Cc: Avi Gozlan; 'opr...@li...' Subject: Re: Patching 2.6.18 kernel for supporing Nehalem Robert Richter said the following on 11/08/10 10:40: > On 07.11.10 10:38:53, Avi Gozlan wrote: > >> Is there a way to migrate support of new platforms to the source code of 2.6.18 kernel? > > Another option would be to take the sources from a RHEL5 kernel (not > sure which other distro is still using v2.6.18), but those changes may > be incomplete for the model you are using. I did most of the backport of the Oprofile changes to RHEL 5.5 kernel to support Nehalem. You could look at the RHEL 5 SRPM: ftp://ftp.redhat.com/redhat/linux/enterprise/5Server/en/os/SRPMS/kernel-2.6.18-194.el5.src.rpm I think you would want to take a look at these patches: linux-2.6-misc-support-nehalem-ex-processors-in-oprofile.patch linux-2.6-oprofile-add-support-for-nehalem-ep-processors.patch linux-2.6-x86-make-bare-metal-oprofile-recognize-other-platforms.patch linux-2.6-x86-oprofile-enable-additional-perf-counters.patch linux-2.6-x86-oprofile-fix-k8-core2-on-multiple-cpus.patch linux-2.6-x86-oprofile-support-arch-perfmon.patch linux-2.6-x86-oprofile-utilize-perf-counter-reservation.patch Good luck! John -- John Villalovos Intel Corporation on-site partner engineer at Red Hat, Inc. http://tabasco.usersys.redhat.com/ Scanned by Check Point Total Security Gateway. |
From: Avi G. <av...@ch...> - 2011-03-31 07:46:56
|
Resending. I would be thankful if anyone can relate even briefly to the below questions. Thanks, Avi -----Original Message----- From: Avi Gozlan Sent: Tuesday, March 22, 2011 5:09 PM To: 'John Villalovos'; Robert Richter Cc: 'opr...@li...'; Avi Gozlan Subject: RE: Patching 2.6.18 kernel for supporing Nehalem Hi, Some time ago I asked about using OProfile on Nehalem assuming vmlinux- 2.6.18 kernel (too old for Nehalem supplements). I got some replies one of which suggesting backporting from newer versions. Thanks a lot for your input. I got back to this recently and made some backport effort. I would be thankful if you could feedback whether I have done it correctly or modifications are required. I have patched the below suggested patches, yet I had to cut off some references to functions defined in the perfctr-watchdog. (I tried adding the relevant patch [linux-2.6-x86_64-nmi-add-perfctr-infrastructure.patch] in the first place but I realized that this causes me to add more and more patches). This looks to yield sampling of the 6 arch_perfmon counters. 1. My general question is: Assuming the NMI watchdog is not enabled (e.g. in grub), is it OK to patch OProfile kernel driver but not add the perfctr-watchdog in the kernel module? Is this reliable? Is it stable? (I'm not a kernel/hardware/OS developer) 2. More specifically, are the following cutoffs OK or are they harmful to OProfile kernel driver functionality? a. In arch/i386/oprofile/nmi_int.c comment out: /* if (unlikely(!avail_to_resrv_perfctr_nmi_bit(i))) continue; */ b. In the various arch/i386/oprofile/op_model*.c files comment out calls to: reserve_perfctr_nmi(),reserve_evntsel_nmi(),release_perfctr_nmi(),release_evntsel_nmi() Also, assign the relevant values in the registers, e.g. in op_model_ppro.c: msrs->counters[i].addr = MSR_P6_PERFCTR0 + i; c. Simply copy the definition of cpuid10_eax from the above watchdog patch to op_model_ppro.c Your feedback will let us use OProfile on Nehalem (x86_64) machines while being limited to 2.6.18 kernel. Thanks a lot for your input, Avi -----Original Message----- From: John Villalovos [mailto:jvi...@re...] Sent: Monday, November 08, 2010 6:29 PM To: Robert Richter Cc: Avi Gozlan; 'opr...@li...' Subject: Re: Patching 2.6.18 kernel for supporing Nehalem Robert Richter said the following on 11/08/10 10:40: > On 07.11.10 10:38:53, Avi Gozlan wrote: > >> Is there a way to migrate support of new platforms to the source code of 2.6.18 kernel? > > Another option would be to take the sources from a RHEL5 kernel (not > sure which other distro is still using v2.6.18), but those changes may > be incomplete for the model you are using. I did most of the backport of the Oprofile changes to RHEL 5.5 kernel to support Nehalem. You could look at the RHEL 5 SRPM: ftp://ftp.redhat.com/redhat/linux/enterprise/5Server/en/os/SRPMS/kernel-2.6.18-194.el5.src.rpm I think you would want to take a look at these patches: linux-2.6-misc-support-nehalem-ex-processors-in-oprofile.patch linux-2.6-oprofile-add-support-for-nehalem-ep-processors.patch linux-2.6-x86-make-bare-metal-oprofile-recognize-other-platforms.patch linux-2.6-x86-oprofile-enable-additional-perf-counters.patch linux-2.6-x86-oprofile-fix-k8-core2-on-multiple-cpus.patch linux-2.6-x86-oprofile-support-arch-perfmon.patch linux-2.6-x86-oprofile-utilize-perf-counter-reservation.patch Good luck! John -- John Villalovos Intel Corporation on-site partner engineer at Red Hat, Inc. http://tabasco.usersys.redhat.com/ Scanned by Check Point Total Security Gateway. |