From: John M. <jmo...@en...> - 2011-05-26 18:18:13
|
The patch certainly avoids the kernel oops, but it appears that regs is always NULL so I'm not getting events recorded. Any other patches I should try? Moving to 2.6.35 would be a big job that I hope that I can avoid right now, but if 2.6.35 profiling on the arm7 is known to work there and not on 33 then perhaps I have to go there. On May 26, 2011, at 10:41 AM, Robert Richter wrote: > (please keep the mailing list cc'ed) > > On 26.05.11 13:05:44, John Monteschio wrote: >> Thanks for the replies. I've dug down a bit further and it seems that set_irq_regs/get_irq_regs isn't working correctly. Initially I didn't notice that I was getting a kernel oops, and that was causing the hung thread. But the hang was due to oprofile_add_sample using regs which had a value of NULL. I'm pretty sure the call is coming through armv7_pmnc_interrupt, and it appears that the problem is hit upon the very first invocation. > > You probably need to apply the following change: > > http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=9414e99672271adcc661f3c160a30b374179b92f > > or upgrade to v2.6.35. > > -Robert > >> >> I'm a seasoned software engineer but kind of new to Linux as a development environment. I only know that I'm using 2.6.33. You asked about distro, so I'm not sure if you needed anything more specific. I'm pretty sure it was grabbed from kernel.org, so it's not Redhat or something like that. >> >> - John >> >> On May 26, 2011, at 6:32 AM, Robert Richter wrote: >> >>> On 26.05.11 08:30:29, Maynard Johnson wrote: >>>> John Monteschio wrote: >>>>> Trying to use oprofile on an arm7 using 2.6.33. Then I try to shut down the profiler the shell hangs. It gets stuck when trying to write a zero to /dev/oprofile/enable. All I have to do to get this to happen is: >>>> >>>> John, what distro are you running on? Have you checked if there's a kernel update for your distro? >>> >>> Does this only happen with 2.6.33? >>> >>>> >>>> *Robert*, who is the oprofile kernel driver maintainer for ARM? Does this symptom sound familiar to you? >>> >>> No, there are no system hangs known when disabling oprofile. >>> >>>> >>>> -Maynard >>>> >>>>> >>>>> /usr/local/bin/opcontrol --start >>>>> /usr/local/bin/opcontrol --stop >>>>> >>>>> Digging down further I've found that the kernel oprofile stuff eventually calls free_irq, which calls synchronize_irq. It's inside synchronize_irq where I'm getting stuck. It decides that "threaded handlers are active", and calls wait_event to wait for that to complete (which never does). Anyone know why? I'd think that if I did a start followed by a stop that I wouldn't have to do anything else special. I've also tried other options (--shutdown, --reset, --init, etc.) to no avail. >>>>> >>>>> I've looked at more recent kernel code (2.6.39) and it seems like a lot of the oprofile stuff in this area has been re-written, so I'm wondering if there were problems in this area (thus the re-write)? >>> >>> The reason was to use perf as backend for oprofile. There were no >>> known issues with the previous implementation. >>> >>>>> >>>>> Any help much appreciated. >>> >>> Hmm, there is a note in synchronize_irq() that the code may deadlock: >>> >>> * This function waits for any pending IRQ handlers for this interrupt >>> * to complete before returning. If you use this function while >>> * holding a resource the IRQ handler may need you will deadlock. >>> >>> Can you configure a debug kernel to check locking dependencies (should >>> be CONFIG_PROVE_LOCKING or so)? >>> >>> Thanks, >>> >>> -Robert >>> >>> -- >>> Advanced Micro Devices, Inc. >>> Operating System Research Center >>> >> >> >> This email message is for the sole use of the intended recipient(s) and may contain confidential and/or privileged information. If you are not an intended recipient, you may not review, use, copy, disclose or distribute this message. If you received this message in error, please contact the sender by reply email and destroy all copies of the original message. >> >> > > -- > Advanced Micro Devices, Inc. > Operating System Research Center > This email message is for the sole use of the intended recipient(s) and may contain confidential and/or privileged information. If you are not an intended recipient, you may not review, use, copy, disclose or distribute this message. If you received this message in error, please contact the sender by reply email and destroy all copies of the original message. |