linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* How to use ARM ETM/ETB at linux?
@ 2012-06-21  5:38 Frank Li
  2012-06-28 15:42 ` Linus Walleij
  0 siblings, 1 reply; 5+ messages in thread
From: Frank Li @ 2012-06-21  5:38 UTC (permalink / raw)
  To: linux-arm-kernel

Anyone use ARM ETM/ETB before?

I run.
echo 1 > /sys/devices/etm/trace_running

root at freescale /$ echo v >/proc/sysrq-trigger
SysRq : etm
Trace buffer contents length: 4
--- ETB buffer begin ---
01000000000000000000000000000000

--- ETB buffer end ---


best regards
Frank Li

^ permalink raw reply	[flat|nested] 5+ messages in thread

* How to use ARM ETM/ETB at linux?
  2012-06-21  5:38 How to use ARM ETM/ETB at linux? Frank Li
@ 2012-06-28 15:42 ` Linus Walleij
  2012-06-28 20:38   ` Arve Hjønnevåg
  0 siblings, 1 reply; 5+ messages in thread
From: Linus Walleij @ 2012-06-28 15:42 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jun 21, 2012 at 7:38 AM, Frank Li <lznuaa@gmail.com> wrote:

> Anyone use ARM ETM/ETB before?

I know for sure that Arve has been making good use of the ETB+ETB,
since there are some nice patches for it in the Android source tree,
but I don't know how he's using it :-)

John Stultz recently submitted some of Arves patches upstream so let's
ask these gentlemen how they use it.

Yours,
Linus Walleij

>
> I run.
> echo 1 > /sys/devices/etm/trace_running
>
> root at freescale /$ echo v >/proc/sysrq-trigger
> SysRq : etm
> Trace buffer contents length: 4
> --- ETB buffer begin ---
> 01000000000000000000000000000000
>
> --- ETB buffer end ---
>
>
> best regards
> Frank Li

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 5+ messages in thread

* How to use ARM ETM/ETB at linux?
  2012-06-28 15:42 ` Linus Walleij
@ 2012-06-28 20:38   ` Arve Hjønnevåg
  2012-06-29  3:31     ` Frank Li
  0 siblings, 1 reply; 5+ messages in thread
From: Arve Hjønnevåg @ 2012-06-28 20:38 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jun 28, 2012 at 8:42 AM, Linus Walleij <linus.walleij@linaro.org> wrote:
> On Thu, Jun 21, 2012 at 7:38 AM, Frank Li <lznuaa@gmail.com> wrote:
>
>> Anyone use ARM ETM/ETB before?
>
> I know for sure that Arve has been making good use of the ETB+ETB,
> since there are some nice patches for it in the Android source tree,
> but I don't know how he's using it :-)
>

I have not used it a lot, but I made changes to make it work on
systems with Cortex A8, A9 and A15 cpus. I found it most useful to
debug watchdog resets, but I had to manually figure out where in the
buffer the data starts since the pointers were lost on a reset.

> John Stultz recently submitted some of Arves patches upstream so let's
> ask these gentlemen how they use it.
>
> Yours,
> Linus Walleij
>
>>
>> I run.
>> echo 1 > /sys/devices/etm/trace_running
>>
>> root at freescale /$ echo v >/proc/sysrq-trigger
>> SysRq : etm
>> Trace buffer contents length: 4
>> --- ETB buffer begin ---
>> 01000000000000000000000000000000
>>
>> --- ETB buffer end ---

Make sure you don't have trace-funnels between the trace cell and the
trace buffer that need to be configured. All the SOCs I used have at
least one trace funnel in the way that by default did not not pass any
data through. The driver has no code to configure these (the channels
used are SOC specific and usually not well documented).

Also, at least one SOC I used would not output any trace data with the
default configuration since it considered the kernel to be executing
in secure mode. One of the patches from the android tree fixes this.


>>
>>
>> best regards
>> Frank Li
>
> Yours,
> Linus Walleij



-- 
Arve Hj?nnev?g

^ permalink raw reply	[flat|nested] 5+ messages in thread

* How to use ARM ETM/ETB at linux?
  2012-06-28 20:38   ` Arve Hjønnevåg
@ 2012-06-29  3:31     ` Frank Li
  2012-06-29  9:20       ` Frank Li
  0 siblings, 1 reply; 5+ messages in thread
From: Frank Li @ 2012-06-29  3:31 UTC (permalink / raw)
  To: linux-arm-kernel

2012/6/29 Arve Hj?nnev?g <arve@android.com>:
> On Thu, Jun 28, 2012 at 8:42 AM, Linus Walleij <linus.walleij@linaro.org> wrote:
>> On Thu, Jun 21, 2012 at 7:38 AM, Frank Li <lznuaa@gmail.com> wrote:
>>
>>> Anyone use ARM ETM/ETB before?
>>
>> I know for sure that Arve has been making good use of the ETB+ETB,
>> since there are some nice patches for it in the Android source tree,
>> but I don't know how he's using it :-)
>>
>
> I have not used it a lot, but I made changes to make it work on
> systems with Cortex A8, A9 and A15 cpus. I found it most useful to
> debug watchdog resets, but I had to manually figure out where in the
> buffer the data starts since the pointers were lost on a reset.
>
>> John Stultz recently submitted some of Arves patches upstream so let's
>> ask these gentlemen how they use it.
>>
>> Yours,
>> Linus Walleij
>>
>>>
>>> I run.
>>> echo 1 > /sys/devices/etm/trace_running
>>>
>>> root at freescale /$ echo v >/proc/sysrq-trigger
>>> SysRq : etm
>>> Trace buffer contents length: 4
>>> --- ETB buffer begin ---
>>> 01000000000000000000000000000000
>>>
>>> --- ETB buffer end ---
>
> Make sure you don't have trace-funnels between the trace cell and the
> trace buffer that need to be configured. All the SOCs I used have at
> least one trace funnel in the way that by default did not not pass any
> data through. The driver has no code to configure these (the channels
> used are SOC specific and usually not well documented).
>
> Also, at least one SOC I used would not output any trace data with the
> default configuration since it considered the kernel to be executing
> in secure mode. One of the patches from the android tree fixes this.
>

Thank you for your reply. I will check trace-funnel with our IC team
owner and update you.
I have picked up below patch. Anything missed?

* | 2d4660b ARM: etm: Power down etm(s) when tracing is not enabled
* | 6e48ba5 ARM: etm: Support multiple ETMs/PTMs.
* | c1db5d4 ARM: etm: Return the entire trace buffer if it is empty after reset
* | 5b9dda1 ARM: etm: Add some missing locks and error checks
* | 1a6825a ARM: etm: Configure data tracing
* | 22a917b ARM: etm: Allow range selection
* | 684b02b ARM: etm: Don't try to clear the buffer full status after reading th
* | 86827c5 ARM: etm: Don't limit tracing to only non-secure code.
* | 936c25b ARM: etm: Don't require clock control


>
>>>
>>>
>>> best regards
>>> Frank Li
>>
>> Yours,
>> Linus Walleij
>
>
>
> --
> Arve Hj?nnev?g

^ permalink raw reply	[flat|nested] 5+ messages in thread

* How to use ARM ETM/ETB at linux?
  2012-06-29  3:31     ` Frank Li
@ 2012-06-29  9:20       ` Frank Li
  0 siblings, 0 replies; 5+ messages in thread
From: Frank Li @ 2012-06-29  9:20 UTC (permalink / raw)
  To: linux-arm-kernel

>
> Thank you for your reply. I will check trace-funnel with our IC team
> owner and update you.
> I have picked up below patch. Anything missed?
>
> * | 2d4660b ARM: etm: Power down etm(s) when tracing is not enabled
> * | 6e48ba5 ARM: etm: Support multiple ETMs/PTMs.
> * | c1db5d4 ARM: etm: Return the entire trace buffer if it is empty after reset
> * | 5b9dda1 ARM: etm: Add some missing locks and error checks
> * | 1a6825a ARM: etm: Configure data tracing
> * | 22a917b ARM: etm: Allow range selection
> * | 684b02b ARM: etm: Don't try to clear the buffer full status after reading th
> * | 86827c5 ARM: etm: Don't limit tracing to only non-secure code.
> * | 936c25b ARM: etm: Don't require clock control
>


Our SOC have trace-funnel. I config it and enable port. First time, I
dump etb and everything is 0xFFFFFF. After run the same command twice,
I get data 0000000000800c01000000000000000000000000

write 0x02144fb0 = 0xc5acce55 /unlock CSTF
write 0x02144000 = 0x31  //open port 1, I have tried open all ports
and same result.
write 0x02144fb0 = 0 //lock CSTF.

root at freescale /sys/devices/etm$ echo v >/proc/sysrq-trigger
SysRq : etm
Trace buffer contents length: 1
--- ETB buffer begin ---
ffffffff

--- ETB buffer end ---
root at freescale /sys/devices/etm$ echo v >/proc/sysrq-trigger
SysRq : etm
Trace buffer contents length: 1
--- ETB buffer begin ---
ffffffff

--- ETB buffer end ---
root at freescale /sys/devices/etm$ echo v >/proc/sysrq-trigger
SysRq : etm
Trace buffer contents length: 5
--- ETB buffer begin ---
0000000000800c01000000000000000000000000


>
>>
>>>>
>>>>
>>>> best regards
>>>> Frank Li
>>>
>>> Yours,
>>> Linus Walleij
>>
>>
>>
>> --
>> Arve Hj?nnev?g

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-06-29  9:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-21  5:38 How to use ARM ETM/ETB at linux? Frank Li
2012-06-28 15:42 ` Linus Walleij
2012-06-28 20:38   ` Arve Hjønnevåg
2012-06-29  3:31     ` Frank Li
2012-06-29  9:20       ` Frank Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).