perf doesn't work with kernel 3.1.0-1002-linaro-lt-mx5

Bug #893653 reported by Paweł Moll
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Linaro Ubuntu
Fix Released
Undecided
Tom Gall

Bug Description

Quickstart board

root@linaro-nano:~# uname -a
Linux linaro-nano 3.1.0-1002-linaro-lt-mx5 #7-Ubuntu PREEMPT Tue Nov 15 13:07:56 UTC 2011 armv7l armv7l armv7l GNU/Linux
root@linaro-nano:~# perf stat sleep 1
[ 28.489709] Unable to handle kernel NULL pointer dereference at virtual address 0000008c
[ 28.502323] pgd = d9534000
[ 28.507638] [0000008c] *pgd=c96cd831, *pte=00000000, *ppte=00000000
[ 28.517243] Internal error: Oops: 17 [#1] PREEMPT
[ 28.524366] Modules linked in: mma8450 input_polldev rtc_da9052 leds_da9052 da9052_onkey da9052_wdt
[ 28.536057] CPU: 0 Not tainted (3.1.0-1002-linaro-lt-mx5 #7-Ubuntu)
[ 28.545226] PC is at armpmu_event_init+0xc0/0x328
[ 28.552497] LR is at reserve_pmu+0x1c/0x2c
[ 28.559155] pc : [<80016e14>] lr : [<800164e8>] psr: 600f0013
[ 28.559161] sp : d966de18 ip : 00000000 fp : d966de84
[ 28.575828] r10: 00000000 r9 : 00000000 r8 : d9647d30
[ 28.583623] r7 : 00000000 r6 : 8084fca4 r5 : 8084fc18 r4 : d9647c00
[ 28.592759] r3 : 00000001 r2 : 00000001 r1 : 808aa324 r0 : 00000000
[ 28.601897] Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
[ 28.611702] Control: 10c5387d Table: c9534019 DAC: 00000015
[ 28.620138] Process perf_3.1.0-1002 (pid: 1146, stack limit = 0xd966c2f0)
[ 28.629659] Stack: (0xd966de18 to 0xd966e000)
[ 28.636740] de00: 8085e028 00000000
[ 28.647673] de20: 00000000 00000002 8084fca8 8084fca4 d966de84 d966de40 8006aa04 80068a54
[ 28.658614] de40: 00000001 00000000 00000000 800b29ac 00000000 8002de70 00000000 d9647c00
[ 28.669563] de60: 8084fc18 808742e4 00000000 d9647d30 d8152b80 00000000 d966debc d966de88
[ 28.680525] de80: 800b2a84 80016d60 00000001 00000000 800b29ac d966dea0 80057850 8084fc18
[ 28.691468] dea0: d966df28 d9647c00 80e14490 00000000 d966defc d966dec0 800b2d44 800b29b8
[ 28.702435] dec0: 00000005 00000000 00000025 d8152f40 d966defc d8152b80 00000000 00000000
[ 28.713461] dee0: 00000000 ffffffff 00000000 ffffffff d966dfa4 d966df00 800b3658 800b2b08
[ 28.724484] df00: 00000000 00000000 00000000 00000010 d966df2c d966df20 8010a710 8010a5f0
[ 28.735494] df20: 00000008 00000000 00000000 00000048 00000000 00000000 00000000 00000000
[ 28.746513] df40: 00000000 00000000 00000003 00000000 00001003 00000000 00000000 00000000
[ 28.757531] df60: 00000000 00000000 00000000 00000000 001116ac 00000000 d966df94 00000000
[ 28.768568] df80: 001116ac 006cf450 0000016c 8000dc08 d966c000 00000000 00000000 d966dfa8
[ 28.779654] dfa0: 8000d980 800b32e0 00000000 001116ac 006cf458 0000047d ffffffff ffffffff
[ 28.790798] dfc0: 00000000 001116ac 006cf450 0000016c 00000004 00000000 00000000 00084cb8
[ 28.802003] dfe0: 7ee8a588 7ee8a578 00028c65 76ea79c0 200f0010 006cf458 00000000 00000000
[ 28.813299] [<80016e14>] (armpmu_event_init+0xc0/0x328) from [<800b2a84>] (perf_init_event+0xd8/0x150)
[ 28.825806] [<800b2a84>] (perf_init_event+0xd8/0x150) from [<800b2d44>] (perf_event_alloc+0x248/0x470)
[ 28.838382] [<800b2d44>] (perf_event_alloc+0x248/0x470) from [<800b3658>] (sys_perf_event_open+0x384/0x784)
[ 28.851398] [<800b3658>] (sys_perf_event_open+0x384/0x784) from [<8000d980>] (ret_fast_syscall+0x0/0x3c)
[ 28.864158] Code: 0a000002 e59f0254 eb166c05 ea00003f (e597308c)
[ 28.880969] ---[ end trace b9e247a5e3243127 ]---
Segmentation fault

Paweł Moll (pawel-moll)
visibility: private → public
Revision history for this message
Will Deacon (will-deacon) wrote :

Hi Pawel,

Do you have a pointer to the kernel sources for this?

Will

Revision history for this message
Paweł Moll (pawel-moll) wrote :

The kernel comes from this PPA: https://launchpad.net/~linaro-landing-team-freescale/+archive/public/+packages (the linux-linaro-lt-mx5-3.1 - 3.1.0-1002.8 packages)

I _suppose_ that this comes from that repo: http://git.linaro.org/gitweb?p=landing-teams/leb/freescale/kernel.git;a=summary but that's just a guess. The LT folk will (hopefully ;-) know...

Revision history for this message
Scott Bambrough (scottb) wrote : Re: [Bug 893653] Re: perf doesn't work with kernel 3.1.0-1002-linaro-lt-mx5
Download full text (4.5 KiB)

Yes. There should be a tag for that release there.

Scott

Sent from my iPhone

On 2011-11-22, at 11:17, Paweł Moll <email address hidden> wrote:

> The kernel comes from this PPA: https://launchpad.net/~linaro-landing-
> team-freescale/+archive/public/+packages (the linux-linaro-lt-mx5-3.1 -
> 3.1.0-1002.8 packages)
>
> I _suppose_ that this comes from that repo:
> http://git.linaro.org/gitweb?p=landing-
> teams/leb/freescale/kernel.git;a=summary but that's just a guess. The LT
> folk will (hopefully ;-) know...
>
> --
> You received this bug notification because you are a member of Linaro
> Landing Team: Freescale, which is subscribed to the bug report.
> https://bugs.launchpad.net/bugs/893653
>
> Title:
> perf doesn't work with kernel 3.1.0-1002-linaro-lt-mx5
>
> Status in Linaro Freescale Landing Team Project:
> New
>
> Bug description:
> Quickstart board
>
> root@linaro-nano:~# uname -a
> Linux linaro-nano 3.1.0-1002-linaro-lt-mx5 #7-Ubuntu PREEMPT Tue Nov 15 13:07:56 UTC 2011 armv7l armv7l armv7l GNU/Linux
> root@linaro-nano:~# perf stat sleep 1
> [ 28.489709] Unable to handle kernel NULL pointer dereference at virtual address 0000008c
> [ 28.502323] pgd = d9534000
> [ 28.507638] [0000008c] *pgd=c96cd831, *pte=00000000, *ppte=00000000
> [ 28.517243] Internal error: Oops: 17 [#1] PREEMPT
> [ 28.524366] Modules linked in: mma8450 input_polldev rtc_da9052 leds_da9052 da9052_onkey da9052_wdt
> [ 28.536057] CPU: 0 Not tainted (3.1.0-1002-linaro-lt-mx5 #7-Ubuntu)
> [ 28.545226] PC is at armpmu_event_init+0xc0/0x328
> [ 28.552497] LR is at reserve_pmu+0x1c/0x2c
> [ 28.559155] pc : [<80016e14>] lr : [<800164e8>] psr: 600f0013
> [ 28.559161] sp : d966de18 ip : 00000000 fp : d966de84
> [ 28.575828] r10: 00000000 r9 : 00000000 r8 : d9647d30
> [ 28.583623] r7 : 00000000 r6 : 8084fca4 r5 : 8084fc18 r4 : d9647c00
> [ 28.592759] r3 : 00000001 r2 : 00000001 r1 : 808aa324 r0 : 00000000
> [ 28.601897] Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
> [ 28.611702] Control: 10c5387d Table: c9534019 DAC: 00000015
> [ 28.620138] Process perf_3.1.0-1002 (pid: 1146, stack limit = 0xd966c2f0)
> [ 28.629659] Stack: (0xd966de18 to 0xd966e000)
> [ 28.636740] de00: 8085e028 00000000
> [ 28.647673] de20: 00000000 00000002 8084fca8 8084fca4 d966de84 d966de40 8006aa04 80068a54
> [ 28.658614] de40: 00000001 00000000 00000000 800b29ac 00000000 8002de70 00000000 d9647c00
> [ 28.669563] de60: 8084fc18 808742e4 00000000 d9647d30 d8152b80 00000000 d966debc d966de88
> [ 28.680525] de80: 800b2a84 80016d60 00000001 00000000 800b29ac d966dea0 80057850 8084fc18
> [ 28.691468] dea0: d966df28 d9647c00 80e14490 00000000 d966defc d966dec0 800b2d44 800b29b8
> [ 28.702435] dec0: 00000005 00000000 00000025 d8152f40 d966defc d8152b80 00000000 00000000
> [ 28.713461] dee0: 00000000 ffffffff 00000000 ffffffff d966dfa4 d966df00 800b3658 800b2b08
> [ 28.724484] df00: 00000000 00000000 00000000 00000010 d966df2c d966df20 8010a710 8010a5f0
> [ 28.735494] df2...

Read more...

Revision history for this message
Will Deacon (will-deacon) wrote :

Hmm, do you know which of these two tags it corresponds to?:

linux-release-2011-10-1

lt-3.1-2011.11-0

Revision history for this message
Will Deacon (will-deacon) wrote :

Also - Pawel, can I have a dmesg please?

Revision history for this message
Will Deacon (will-deacon) wrote :

Scratch that - please give this patch a try:

diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c
index e6e5d7c..9bc3683 100644
--- a/arch/arm/kernel/perf_event.c
+++ b/arch/arm/kernel/perf_event.c
@@ -396,6 +396,9 @@ armpmu_reserve_hardware(struct arm_pmu *armpmu)
        int i, err, irq, irqs;
        struct platform_device *pmu_device = armpmu->plat_device;

+ if (!pmu_device)
+ return -ENODEV;
+
        err = reserve_pmu(armpmu->type);
        if (err) {
                pr_warning("unable to reserve pmu\n");

Revision history for this message
Will Deacon (will-deacon) wrote :

Well that patch does fix a real bug, so I've included it in my perf/fixes branch and updated my outstanding pull request for RMK.

If it is causing your problem, then it means that the mx5 BSP isn't registering a platform_device for the PMU. If you want to use hardware perf counters, that's something you'll need to do.

Revision history for this message
Scott Bambrough (scottb) wrote :

On 11-11-22 12:44 PM, Will Deacon wrote:
> Hmm, do you know which of these two tags it corresponds to?:
>
> linux-release-2011-10-1

This one I believe.

Scott

Revision history for this message
Paweł Moll (pawel-moll) wrote :

Will is right about the platform device not being available:

root@linaro-nano:~# ls /sys/bus/platform/devices/ | grep pmu
root@linaro-nano:~#

Revision history for this message
Will Deacon (will-deacon) wrote :

grepping around in mach-mx5 didn't reveal what the IRQ numbers might be, so this needs to be added by somebody who knows the platform. The PMU has a DT binding, so you can use that if you like.

Revision history for this message
Eric Miao (eric.y.miao) wrote :

Checked, arm-pmu device not added. The attached patch will be a quick fix for this.

Eric Miao (eric.y.miao)
Changed in linaro-landing-team-freescale:
status: New → Triaged
importance: Undecided → High
assignee: nobody → Eric Miao (eric.y.miao)
milestone: none → 2011.12
Revision history for this message
Al Grant (al-grant) wrote :

No sign of pmu platform device on PandaBoard (Linaro 11.10) either:

root@sdperf-board1:/hd/linux# ls /sys/bus/platform/devices | grep pmu
root@sdperf-board1:/hd/linux#

Revision history for this message
Will Deacon (will-deacon) wrote :

Eric - can we get a variant of your patch into mainline please?

Changed in linaro-landing-team-freescale:
status: Triaged → In Progress
Changed in linaro-ubuntu:
milestone: none → 11.12
Revision history for this message
David Long (dave-long) wrote :

We are once again missing the patch for Panda that adds support to route the PMU interrupts through the Cross Trigger Interface. That code performs the missing platform_device registration. I am in the process of up-leveling that code.

Presumably this interrupt is routed differently in the MX5 SoC.

Eric Miao (eric.y.miao)
Changed in linaro-landing-team-freescale:
status: In Progress → Fix Committed
Changed in linaro-ubuntu:
assignee: nobody → Tom Gall (tom-gall)
Revision history for this message
Tom Gall (tom-gall) wrote :

When you run perf with the 11.12 RC1 hwpack/ubuntu-desktop on imx53, it will complain that perf_3.1.0 isn't installed. This isn't fatal. If you force it to run perf_3.0.0-14 it will run successfully. If you install linux-linaro-lt-xm5-tools-3.1.0 perf will run successfully.

Changed in linaro-ubuntu:
status: New → Fix Released
Fathi Boudra (fboudra)
Changed in linaro-landing-team-freescale:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.