Problem with pmcstat -p

27 views
Skip to first unread message

Rui Paulo

unread,
Nov 8, 2009, 8:14:57 AM11/8/09
to pmctools...@googlegroups.com
Trying to do a pmcstat -p with my code, yields:

# pmcstat -p IC_FETCH ls
PMC:ALL:2: event=70144 caps=0x0 mode=3 cpu=-1
PMC:ALL:1: allocate-pmc -> pmc=0xc1277040
OWN:FND:1: find-owner proc=0xc11cf578 (1183, pmcstat) hindex=0xe ->
pmc-owner=0
MDP:ALL:2: xscale-allocate ri=0 -> config=0x0
PMC:ALL:2: ev=70144 class=8 mode=3 n=0 -> pmcid=ff030800
OWN:FND:1: find-owner proc=0xc11cf578 (1183, pmcstat) hindex=0xe ->
pmc-owner=0
OWN:ALL:1: allocate-owner proc=0xc11cf578 (1183, pmcstat) pmc-
owner=0xc11e7980
PMC:FND:1: find-pmc id=-16578560
OWN:FND:1: find-owner proc=0xc11cf578 (1183, pmcstat) hindex=0xe ->
pmc-owner=0xc11e7980
PMC:FND:2: find-pmc id=-16578560 -> pmc=0xc1277040
PMC:FND:1: find-pmc id=-16578560
OWN:FND:1: find-owner proc=0xc11cf578 (1183, pmcstat) hindex=0xe ->
pmc-owner=0xc11e7980
PMC:FND:2: find-pmc id=-16578560 -> pmc=0xc1277040
PMC:OPS:1: start pmc=0xc1277040 mode=3 ri=0
panic: [pmc,1438] negative increment cpu=0 ri=0 newvalue=fbb
saved=1569 incr=fffffffffffffa52
KDB: enter: panic
[thread pid 1184 tid 100049 ]
Stopped at kdb_enter+0x48: ldrb r15, [r15, r15, ror r15]!
db>

I understand the difference between -p and -s (-s works fine BTW), but
can you explain this panic?

Thanks,
--
Rui Paulo

--
Rui Paulo

Joseph Koshy

unread,
Nov 11, 2009, 8:43:40 PM11/11/09
to PMCTools Discuss
See hwpmc_mod.c:

1400: pcd->pcd_read_pmc(cpu, adjri, &newvalue);
...
1402: tmp = newvalue - PMC_PCPU_SAVED(cpu,ri);

So "newvalue" (0xFBB) is less than the previously seen value (0x1569)
for this PMC.

This could be because you have not implemented xscale_write_pmc(); PMC
registers are updated to the previous saved value when a process gets
scheduled onto a CPU.

Hope this helps.

Koshy

Rui Paulo

unread,
Nov 12, 2009, 1:36:39 PM11/12/09
to pmctools...@googlegroups.com

Hmm, I've implemented xscale_write_pmc() but it didn't help. Guess I
have to dig deeper.

--
Rui Paulo

Rui Paulo

unread,
Nov 13, 2009, 6:07:32 AM11/13/09
to pmctools...@googlegroups.com

I found the problem. I was reseting the counters on xscale_start_pmc(). It works now.

The next bit is sampling and callchain. The latter seems hard and ddb doesn't even do a good job at backtracing on arm. :-(

--
Rui Paulo

Joseph Koshy

unread,
Nov 14, 2009, 11:03:47 PM11/14/09
to pmctools...@googlegroups.com

> I found the problem. I was reseting the counters on
> xscale_start_pmc(). It works now.

Great :).

> The next bit is sampling and callchain. The latter seems hard and
> ddb doesn't even do a good job at backtracing on arm. :-(

Are PMC interrupts higher or lower in priority with respect to the
clock interrupt?

Koshy

Rui Paulo

unread,
Nov 15, 2009, 6:52:38 AM11/15/09
to pmctools...@googlegroups.com


I haven't implemented PMC interrupts yet, so I don't know.

--
Rui Paulo

Reply all
Reply to author
Forward
0 new messages