All of lore.kernel.org
 help / color / mirror / Atom feed
* Coresight ETF trace dump failed in Juno r1 with 4.8-rc8
@ 2016-10-03 11:36 Venkatesh Vivekanandan
  2016-10-03 13:14 ` Sudeep Holla
  0 siblings, 1 reply; 13+ messages in thread
From: Venkatesh Vivekanandan @ 2016-10-03 11:36 UTC (permalink / raw)
  To: linux-arm-kernel

Hi All,

I am trying to collect ETF trace from Juno R1 and could see "cpu
stall" while dumping the trace. Attached is the log of sequence
followed. Was trying to collect the trace data from hardware and see
if it is any valid data. Am I missing anything here?.

cenaro-test [rc=0]# echo 0 > /sys/bus/coresight/devices/22140000.etm/enable_sour
[   89.609083] coresight-etm4x 22140000.etm: ETM tracing disabled
[   89.614892] coresight-funnel 220c0000.cluster0-funnel: FUNNEL
inport 1 disabled
[   89.622140] coresight-funnel 20040000.main-funnel: FUNNEL inport 0 disabled
[   89.629057] coresight-tmc 20010000.etf: TMC-ETB/ETF disabled
linaro-test [rc=0]# dd if=/dev/20010000.etf of=/cstrace.bin bs=1
[  128.876846] INFO: rcu_preempt detected stalls on CPUs/tasks:
[  128.882457]  3-...: (65 GPs behind) idle=a3f/140000000000000/0
softirq=314/315 fqs=2288
[  128.890462]  (detected by 1, t=5252 jiffies, g=0, c=-1, q=19)
[  128.896151] Task dump for CPU 3:
[  128.899340] dd              R  running task        0  1237   1234 0x00000002
[  128.906322] Call trace:
[  128.908745] [<ffff000008085560>] __switch_to+0xc8/0xd4
[  128.913826] [<0000000000020000>] 0x20000

This happens consistently with every boot.

Thanks,
Venkatesh.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: r1-trace-log
Type: application/octet-stream
Size: 4121 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20161003/34981cfd/attachment-0001.obj>

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

* Coresight ETF trace dump failed in Juno r1 with 4.8-rc8
  2016-10-03 11:36 Coresight ETF trace dump failed in Juno r1 with 4.8-rc8 Venkatesh Vivekanandan
@ 2016-10-03 13:14 ` Sudeep Holla
  2016-10-04  5:37   ` Venkatesh Vivekanandan
  0 siblings, 1 reply; 13+ messages in thread
From: Sudeep Holla @ 2016-10-03 13:14 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Venkatesh,

On 03/10/16 12:36, Venkatesh Vivekanandan wrote:
> Hi All,
>
> I am trying to collect ETF trace from Juno R1 and could see "cpu
> stall" while dumping the trace. Attached is the log of sequence
> followed. Was trying to collect the trace data from hardware and see
> if it is any valid data. Am I missing anything here?.
>

There are few fixes from me and Suzuki queued for v4.9.
Can you check if this issue persists even on linux-next ?

-- 
Regards,
Sudeep

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

* Coresight ETF trace dump failed in Juno r1 with 4.8-rc8
  2016-10-03 13:14 ` Sudeep Holla
@ 2016-10-04  5:37   ` Venkatesh Vivekanandan
  2016-10-04 10:30     ` Sudeep Holla
  2016-10-04 14:29     ` Suzuki K Poulose
  0 siblings, 2 replies; 13+ messages in thread
From: Venkatesh Vivekanandan @ 2016-10-04  5:37 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Oct 3, 2016 at 6:44 PM, Sudeep Holla <sudeep.holla@arm.com> wrote:
> Hi Venkatesh,
>
> On 03/10/16 12:36, Venkatesh Vivekanandan wrote:
>>
>> Hi All,
>>
>> I am trying to collect ETF trace from Juno R1 and could see "cpu
>> stall" while dumping the trace. Attached is the log of sequence
>> followed. Was trying to collect the trace data from hardware and see
>> if it is any valid data. Am I missing anything here?.
>>
>
> There are few fixes from me and Suzuki queued for v4.9.
> Can you check if this issue persists even on linux-next ?

Issue is the same in linux-next as well. Please find the attached log.

linaro-test [rc=0]# dd if=/dev/20010000.etf of=/cstrace.bin bs=1
[  120.009698] INFO: rcu_preempt detected stalls on CPUs/tasks:
[  120.015307]  2-...: (1 GPs behind) idle=f11/140000000000000/0
softirq=224/224 fqs=1903
[  120.023226]  (detected by 1, t=5255 jiffies, g=-1, c=-2, q=19)
[  120.029001] Task dump for CPU 2:
[  120.032190] dd              R  running task        0  1270   1267 0x00000002
[  120.039172] Call trace:
[  120.041594] [<ffff000008085534>] __switch_to+0xc8/0xd4
[  120.046675] [<0000000000020000>] 0x20000

Steps followed,
# git clone git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
linux-next
# cd linux-next
# make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig
# make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- menuconfig  <---
enable coresight
# make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j8 Image
# make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- dtbs
# arch/arm64/boot/Image <--- copied this kernel
# arch/arm64/boot/dts/arm/juno-r1.dtb <--- copied this dtb

Top commit in linux-next is,

commit c7d3b912180a9bb0733e5cfab84e5a7493dd3599
Author: Stephen Rothwell <sfr@canb.auug.org.au>
Date:   Tue Oct 4 14:52:03 2016 +1100

    Add linux-next specific files for 20161004

>
> --
> Regards,
> Sudeep
-------------- next part --------------
A non-text attachment was scrubbed...
Name: r1-next-trace-log
Type: application/octet-stream
Size: 3423 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20161004/9cc7e974/attachment.obj>

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

* Coresight ETF trace dump failed in Juno r1 with 4.8-rc8
  2016-10-04  5:37   ` Venkatesh Vivekanandan
@ 2016-10-04 10:30     ` Sudeep Holla
  2016-10-04 12:14       ` Venkatesh Vivekanandan
  2016-10-04 14:29     ` Suzuki K Poulose
  1 sibling, 1 reply; 13+ messages in thread
From: Sudeep Holla @ 2016-10-04 10:30 UTC (permalink / raw)
  To: linux-arm-kernel



On 04/10/16 06:37, Venkatesh Vivekanandan wrote:
> On Mon, Oct 3, 2016 at 6:44 PM, Sudeep Holla <sudeep.holla@arm.com> wrote:
>> Hi Venkatesh,
>>
>> On 03/10/16 12:36, Venkatesh Vivekanandan wrote:
>>>
>>> Hi All,
>>>
>>> I am trying to collect ETF trace from Juno R1 and could see "cpu
>>> stall" while dumping the trace. Attached is the log of sequence
>>> followed. Was trying to collect the trace data from hardware and see
>>> if it is any valid data. Am I missing anything here?.
>>>
>>
>> There are few fixes from me and Suzuki queued for v4.9.
>> Can you check if this issue persists even on linux-next ?
>
> Issue is the same in linux-next as well. Please find the attached log.
>

OK, what do you mean by the issue still being present. I no longer see
any ETM failures or messages. Does the system hang when you try to read
/dev/<addr>.etf ?

Also the RCU stalls could be related to CPUIdle. Are you using latest
versions of trusted firmware ?

-- 
Regards,
Sudeep

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

* Coresight ETF trace dump failed in Juno r1 with 4.8-rc8
  2016-10-04 10:30     ` Sudeep Holla
@ 2016-10-04 12:14       ` Venkatesh Vivekanandan
  2016-10-04 12:51         ` Sudeep Holla
  0 siblings, 1 reply; 13+ messages in thread
From: Venkatesh Vivekanandan @ 2016-10-04 12:14 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Oct 4, 2016 at 4:00 PM, Sudeep Holla <sudeep.holla@arm.com> wrote:
>
>
> On 04/10/16 06:37, Venkatesh Vivekanandan wrote:
>>
>> On Mon, Oct 3, 2016 at 6:44 PM, Sudeep Holla <sudeep.holla@arm.com> wrote:
>>>
>>> Hi Venkatesh,
>>>
>>> On 03/10/16 12:36, Venkatesh Vivekanandan wrote:
>>>>
>>>>
>>>> Hi All,
>>>>
>>>> I am trying to collect ETF trace from Juno R1 and could see "cpu
>>>> stall" while dumping the trace. Attached is the log of sequence
>>>> followed. Was trying to collect the trace data from hardware and see
>>>> if it is any valid data. Am I missing anything here?.
>>>>
>>>
>>> There are few fixes from me and Suzuki queued for v4.9.
>>> Can you check if this issue persists even on linux-next ?
>>
>>
>> Issue is the same in linux-next as well. Please find the attached log.
>>
>
> OK, what do you mean by the issue still being present. I no longer see
> any ETM failures or messages. Does the system hang when you try to read
> /dev/<addr>.etf ?
Yes, system hangs while reading /dev/<addr>.etf. Most of the times, it
gives RCU stall and sometimes just hangs and I have to reboot in both
case.
>
> Also the RCU stalls could be related to CPUIdle. Are you using latest
> versions of trusted firmware ?
Firmware is the one that came along with the board. Didn't update to
anything latest.

>From bootlog,

[    0.000000] Boot CPU: AArch64 Processor [411fd071]
[    0.000000] earlycon: pl11 at MMIO 0x000000007ff80000 (options '')
[    0.000000] bootconsole [pl11] enabled
[    0.000000] efi: Getting EFI parameters from FDT:
[    0.000000] efi: EFI v2.50 by ARM Juno EFI Nov 24 2015 17:54:31
[    0.000000] efi:  ACPI=0xfe720000  ACPI 2.0=0xfe720014  PROP=0xfe773f30

Please let me know, if the firmware needs to be updated to specific
version. Any pointers on that would be appreciated.

>
> --
> Regards,
> Sudeep

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

* Coresight ETF trace dump failed in Juno r1 with 4.8-rc8
  2016-10-04 12:14       ` Venkatesh Vivekanandan
@ 2016-10-04 12:51         ` Sudeep Holla
  0 siblings, 0 replies; 13+ messages in thread
From: Sudeep Holla @ 2016-10-04 12:51 UTC (permalink / raw)
  To: linux-arm-kernel



On 04/10/16 13:14, Venkatesh Vivekanandan wrote:
> On Tue, Oct 4, 2016 at 4:00 PM, Sudeep Holla <sudeep.holla@arm.com> wrote:
>>
>>
>> On 04/10/16 06:37, Venkatesh Vivekanandan wrote:
>>>
>>> On Mon, Oct 3, 2016 at 6:44 PM, Sudeep Holla <sudeep.holla@arm.com> wrote:
>>>>
>>>> Hi Venkatesh,
>>>>
>>>> On 03/10/16 12:36, Venkatesh Vivekanandan wrote:
>>>>>
>>>>>
>>>>> Hi All,
>>>>>
>>>>> I am trying to collect ETF trace from Juno R1 and could see "cpu
>>>>> stall" while dumping the trace. Attached is the log of sequence
>>>>> followed. Was trying to collect the trace data from hardware and see
>>>>> if it is any valid data. Am I missing anything here?.
>>>>>
>>>>
>>>> There are few fixes from me and Suzuki queued for v4.9.
>>>> Can you check if this issue persists even on linux-next ?
>>>
>>>
>>> Issue is the same in linux-next as well. Please find the attached log.
>>>
>>
>> OK, what do you mean by the issue still being present. I no longer see
>> any ETM failures or messages. Does the system hang when you try to read
>> /dev/<addr>.etf ?
> Yes, system hangs while reading /dev/<addr>.etf. Most of the times, it
> gives RCU stall and sometimes just hangs and I have to reboot in both
> case.

OK, I am unable reproduce the issue hence suspecting the firmware to be
very old.

>>
>> Also the RCU stalls could be related to CPUIdle. Are you using latest
>> versions of trusted firmware ?
> Firmware is the one that came along with the board. Didn't update to
> anything latest.
>
> From bootlog,
>
> [    0.000000] Boot CPU: AArch64 Processor [411fd071]
> [    0.000000] earlycon: pl11 at MMIO 0x000000007ff80000 (options '')
> [    0.000000] bootconsole [pl11] enabled
> [    0.000000] efi: Getting EFI parameters from FDT:
> [    0.000000] efi: EFI v2.50 by ARM Juno EFI Nov 24 2015 17:54:31
> [    0.000000] efi:  ACPI=0xfe720000  ACPI 2.0=0xfe720014  PROP=0xfe773f30
>

No, I was referring to the ones very early in the boot, something like:

NOTICE:  Booting Trusted Firmware
NOTICE:  BL1: v1.2(release):a5a423100822
NOTICE:  BL1: Built : 11:42:57, Sep 30 2016
NOTICE:  BL1: Booting BL2
NOTICE:  BL2: v1.2(release):a5a423100822
NOTICE:  BL2: Built : 11:42:58, Sep 30 2016
NOTICE:  BL1: Booting BL31
NOTICE:  BL31: v1.2(release):a5a423100822
NOTICE:  BL31: Built : 11:43:06, Sep 30 2016
UEFI firmware (version  built at 11:42:39 on Sep 30 2016)

Ignore the dates here as I have build one last week.

> Please let me know, if the firmware needs to be updated to specific
> version. Any pointers on that would be appreciated.
>

Yes always better as they will have bug fixes. You can get one from [1] 
or just follow instructions @[2].

[1] 
http://snapshots.linaro.org/member-builds/armlt-platforms-release/32/juno-uefi.zip 

[2] https://community.arm.com/docs/DOC-11395

-- 
Regards,
Sudeep

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

* Coresight ETF trace dump failed in Juno r1 with 4.8-rc8
  2016-10-04  5:37   ` Venkatesh Vivekanandan
  2016-10-04 10:30     ` Sudeep Holla
@ 2016-10-04 14:29     ` Suzuki K Poulose
  2016-10-05  5:27       ` Venkatesh Vivekanandan
  1 sibling, 1 reply; 13+ messages in thread
From: Suzuki K Poulose @ 2016-10-04 14:29 UTC (permalink / raw)
  To: linux-arm-kernel

On 04/10/16 06:37, Venkatesh Vivekanandan wrote:
> On Mon, Oct 3, 2016 at 6:44 PM, Sudeep Holla <sudeep.holla@arm.com> wrote:
>> Hi Venkatesh,
>>
>> On 03/10/16 12:36, Venkatesh Vivekanandan wrote:
>>>
>>> Hi All,
>>>
>>> I am trying to collect ETF trace from Juno R1 and could see "cpu
>>> stall" while dumping the trace. Attached is the log of sequence
>>> followed. Was trying to collect the trace data from hardware and see
>>> if it is any valid data. Am I missing anything here?.
>>>
>>
>> There are few fixes from me and Suzuki queued for v4.9.
>> Can you check if this issue persists even on linux-next ?
>
> Issue is the same in linux-next as well. Please find the attached log.
>
> linaro-test [rc=0]# dd if=/dev/20010000.etf of=/cstrace.bin bs=1
> [  120.009698] INFO: rcu_preempt detected stalls on CPUs/tasks:
> [  120.015307]  2-...: (1 GPs behind) idle=f11/140000000000000/0
> softirq=224/224 fqs=1903
> [  120.023226]  (detected by 1, t=5255 jiffies, g=-1, c=-2, q=19)
> [  120.029001] Task dump for CPU 2:
> [  120.032190] dd              R  running task        0  1270   1267 0x00000002
> [  120.039172] Call trace:
> [  120.041594] [<ffff000008085534>] __switch_to+0xc8/0xd4
> [  120.046675] [<0000000000020000>] 0x20000
>
> Steps followed,
> # git clone git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
> linux-next
> # cd linux-next
> # make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig
> # make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- menuconfig  <---
> enable coresight
> # make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j8 Image
> # make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- dtbs
> # arch/arm64/boot/Image <--- copied this kernel
> # arch/arm64/boot/dts/arm/juno-r1.dtb <--- copied this dtb
>
> Top commit in linux-next is,
>
> commit c7d3b912180a9bb0733e5cfab84e5a7493dd3599
> Author: Stephen Rothwell <sfr@canb.auug.org.au>
> Date:   Tue Oct 4 14:52:03 2016 +1100
>
>     Add linux-next specific files for 20161004

Can't reproduce it here either.

root at localhost:/sys/bus/coresight/devices# echo 1 > 20010000.etf/enable_sink
root at localhost:/sys/bus/coresight/devices# echo 1 > 22140000.etm/enable_source
root at localhost:/sys/bus/coresight/devices# dd if=/dev/20010000.etf bs=1 of=/root/etr.bin
65536+0 records in
65536+0 records out
65536 bytes (66 kB) copied, 0.227546 s, 288 kB/s
root at localhost:/sys/bus/coresight/devices# dd if=/dev/20010000.etf bs=1 of=/root/etr.bin
65536+0 records in
65536+0 records out
65536 bytes (66 kB) copied, 0.233527 s, 281 kB/s
root at localhost:/sys/bus/coresight/devices# echo 0 > 20010000.etf/enable_sink
root at localhost:/sys/bus/coresight/devices# dd if=/dev/20010000.etf bs=1 of=/root/etr.bin
65536+0 records in
65536+0 records out
65536 bytes (66 kB) copied, 0.474943 s, 138 kB/s

FWIW, here is my firmware version :

NOTICE:  Booting Trusted Firmware
NOTICE:  BL1: v1.1(release):e04723e21362
NOTICE:  BL1: Built : 15:39:56, Sep  1 2015
NOTICE:  BL1: Booting BL2
NOTICE:  BL2: v1.1(release):e04723e21362
NOTICE:  BL2: Built : 15:42:30, Sep  1 2015
NOTICE:  BL1: Booting BL3-1
NOTICE:  BL3-1: v1.1(release):604d5da6f2aa
NOTICE:  BL3-1: Built : 14:50:36, Sep 10 2015
UEFI firmware (version ea31f8e built at 16:35:17 on Aug  5 2015)


Cheers
Suzuki

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

* Coresight ETF trace dump failed in Juno r1 with 4.8-rc8
  2016-10-04 14:29     ` Suzuki K Poulose
@ 2016-10-05  5:27       ` Venkatesh Vivekanandan
  2016-10-05 10:42         ` Sudeep Holla
  2016-10-05 17:17         ` Suzuki K Poulose
  0 siblings, 2 replies; 13+ messages in thread
From: Venkatesh Vivekanandan @ 2016-10-05  5:27 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Oct 4, 2016 at 7:59 PM, Suzuki K Poulose <Suzuki.Poulose@arm.com> wrote:
> On 04/10/16 06:37, Venkatesh Vivekanandan wrote:
>>
>> On Mon, Oct 3, 2016 at 6:44 PM, Sudeep Holla <sudeep.holla@arm.com> wrote:
>>>
>>> Hi Venkatesh,
>>>
>>> On 03/10/16 12:36, Venkatesh Vivekanandan wrote:
>>>>
>>>>
>>>> Hi All,
>>>>
>>>> I am trying to collect ETF trace from Juno R1 and could see "cpu
>>>> stall" while dumping the trace. Attached is the log of sequence
>>>> followed. Was trying to collect the trace data from hardware and see
>>>> if it is any valid data. Am I missing anything here?.
>>>>
>>>
>>> There are few fixes from me and Suzuki queued for v4.9.
>>> Can you check if this issue persists even on linux-next ?
>>
>>
>> Issue is the same in linux-next as well. Please find the attached log.
>>
>> linaro-test [rc=0]# dd if=/dev/20010000.etf of=/cstrace.bin bs=1
>> [  120.009698] INFO: rcu_preempt detected stalls on CPUs/tasks:
>> [  120.015307]  2-...: (1 GPs behind) idle=f11/140000000000000/0
>> softirq=224/224 fqs=1903
>> [  120.023226]  (detected by 1, t=5255 jiffies, g=-1, c=-2, q=19)
>> [  120.029001] Task dump for CPU 2:
>> [  120.032190] dd              R  running task        0  1270   1267
>> 0x00000002
>> [  120.039172] Call trace:
>> [  120.041594] [<ffff000008085534>] __switch_to+0xc8/0xd4
>> [  120.046675] [<0000000000020000>] 0x20000
>>
>> Steps followed,
>> # git clone
>> git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
>> linux-next
>> # cd linux-next
>> # make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig
>> # make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- menuconfig  <---
>> enable coresight
>> # make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j8 Image
>> # make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- dtbs
>> # arch/arm64/boot/Image <--- copied this kernel
>> # arch/arm64/boot/dts/arm/juno-r1.dtb <--- copied this dtb
>>
>> Top commit in linux-next is,
>>
>> commit c7d3b912180a9bb0733e5cfab84e5a7493dd3599
>> Author: Stephen Rothwell <sfr@canb.auug.org.au>
>> Date:   Tue Oct 4 14:52:03 2016 +1100
>>
>>     Add linux-next specific files for 20161004
>
>
> Can't reproduce it here either.
>
> root at localhost:/sys/bus/coresight/devices# echo 1 > 20010000.etf/enable_sink
> root at localhost:/sys/bus/coresight/devices# echo 1 >
> 22140000.etm/enable_source
> root at localhost:/sys/bus/coresight/devices# dd if=/dev/20010000.etf bs=1
> of=/root/etr.bin
> 65536+0 records in
> 65536+0 records out
> 65536 bytes (66 kB) copied, 0.227546 s, 288 kB/s
> root at localhost:/sys/bus/coresight/devices# dd if=/dev/20010000.etf bs=1
> of=/root/etr.bin
> 65536+0 records in
> 65536+0 records out
> 65536 bytes (66 kB) copied, 0.233527 s, 281 kB/s
> root at localhost:/sys/bus/coresight/devices# echo 0 > 20010000.etf/enable_sink
> root at localhost:/sys/bus/coresight/devices# dd if=/dev/20010000.etf bs=1
> of=/root/etr.bin
> 65536+0 records in
> 65536+0 records out
> 65536 bytes (66 kB) copied, 0.474943 s, 138 kB/s
>
> FWIW, here is my firmware version :
>
> NOTICE:  Booting Trusted Firmware
> NOTICE:  BL1: v1.1(release):e04723e21362
> NOTICE:  BL1: Built : 15:39:56, Sep  1 2015
> NOTICE:  BL1: Booting BL2
> NOTICE:  BL2: v1.1(release):e04723e21362
> NOTICE:  BL2: Built : 15:42:30, Sep  1 2015
> NOTICE:  BL1: Booting BL3-1
> NOTICE:  BL3-1: v1.1(release):604d5da6f2aa
> NOTICE:  BL3-1: Built : 14:50:36, Sep 10 2015
> UEFI firmware (version ea31f8e built at 16:35:17 on Aug  5 2015)
>

Hang is seen while trying to dump trace _after_ disabling the ETM
source. Is it not supposed to work?.
It works fine, when dumped before disabling ETM source. Please find
the log below.

linaro-test [rc=0]# echo 1 > 20010000.etf/enable_sink
linaro-test [rc=0]# echo 1 > 22140000.etm/enable_source
[   91.792145] coresight-tmc 20010000.etf: TMC-ETB/ETF enabled
[   91.797719] coresight-funnel 20040000.main-funnel: FUNNEL inport 0 enabled
[   91.804552] coresight-funnel 220c0000.cluster0-funnel: FUNNEL
inport 1 enabled
[   91.815990] coresight-etm4x 22140000.etm: ETM tracing enabled
linaro-test [rc=0]# dd if=/dev/20010000.etf of=/cstrace.bin bs=1
[  108.105492] coresight-tmc 20010000.etf: TMC read start
[  108.404335] coresight-tmc 20010000.etf: TMC read end
65536+0 records in
65536+0 records out
linaro-test [rc=0]# echo 0 > 20010000.etf/enable_sink
linaro-test [rc=0]# dd if=/dev/20010000.etf of=/cstrace.bin bs=1
[  125.069740] coresight-tmc 20010000.etf: TMC read start
[  125.184370] coresight-tmc 20010000.etf: TMC read end
65536+0 records in
65536+0 records out
linaro-test [rc=0]# echo 0 > 22140000.etm/enable_source
[  140.271163] coresight-etm4x 22140000.etm: ETM tracing disabled
[  140.276964] coresight-funnel 220c0000.cluster0-funnel: FUNNEL
inport 1 disabled
[  140.284211] coresight-funnel 20040000.main-funnel: FUNNEL inport 0 disabled
[  140.291128] coresight-tmc 20010000.etf: TMC-ETB/ETF disabled
linaro-test [rc=0]# dd if=/dev/20010000.etf of=/cstrace.bin bs=1
<---- It hangs here...

My firmware version,

NOTICE:  Booting Trusted Firmware
NOTICE:  BL1: v1.1(debug):4a1dcde
NOTICE:  BL1: Built : 17:54:40, Nov 24 2015
NOTICE:  BL1: Booting BL2
NOTICE:  BL2: v1.1(debug):4a1dcde
NOTICE:  BL2: Built : 17:54:40, Nov 24 2015
NOTICE:  BL1: Booting BL3-1
NOTICE:  BL3-1: v1.1(debug):4a1dcde
NOTICE:  BL3-1: Built : 17:54:40, Nov 24 2015
UEFI firmware (version 9ed6f7e built@17:54:28 on Nov 24 2015)

>
> Cheers
> Suzuki
>

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

* Coresight ETF trace dump failed in Juno r1 with 4.8-rc8
  2016-10-05  5:27       ` Venkatesh Vivekanandan
@ 2016-10-05 10:42         ` Sudeep Holla
  2016-10-06  5:21           ` Venkatesh Vivekanandan
  2016-10-05 17:17         ` Suzuki K Poulose
  1 sibling, 1 reply; 13+ messages in thread
From: Sudeep Holla @ 2016-10-05 10:42 UTC (permalink / raw)
  To: linux-arm-kernel


On 05/10/16 06:27, Venkatesh Vivekanandan wrote:

[...]

>
> Hang is seen while trying to dump trace _after_ disabling the ETM
> source. Is it not supposed to work?.
> It works fine, when dumped before disabling ETM source. Please find
> the log below.
>
> linaro-test [rc=0]# echo 1 > 20010000.etf/enable_sink
> linaro-test [rc=0]# echo 1 > 22140000.etm/enable_source
> [   91.792145] coresight-tmc 20010000.etf: TMC-ETB/ETF enabled
> [   91.797719] coresight-funnel 20040000.main-funnel: FUNNEL inport 0 enabled
> [   91.804552] coresight-funnel 220c0000.cluster0-funnel: FUNNEL
> inport 1 enabled
> [   91.815990] coresight-etm4x 22140000.etm: ETM tracing enabled
> linaro-test [rc=0]# dd if=/dev/20010000.etf of=/cstrace.bin bs=1
> [  108.105492] coresight-tmc 20010000.etf: TMC read start
> [  108.404335] coresight-tmc 20010000.etf: TMC read end
> 65536+0 records in
> 65536+0 records out
> linaro-test [rc=0]# echo 0 > 20010000.etf/enable_sink
> linaro-test [rc=0]# dd if=/dev/20010000.etf of=/cstrace.bin bs=1
> [  125.069740] coresight-tmc 20010000.etf: TMC read start
> [  125.184370] coresight-tmc 20010000.etf: TMC read end
> 65536+0 records in
> 65536+0 records out
> linaro-test [rc=0]# echo 0 > 22140000.etm/enable_source
> [  140.271163] coresight-etm4x 22140000.etm: ETM tracing disabled
> [  140.276964] coresight-funnel 220c0000.cluster0-funnel: FUNNEL
> inport 1 disabled
> [  140.284211] coresight-funnel 20040000.main-funnel: FUNNEL inport 0 disabled
> [  140.291128] coresight-tmc 20010000.etf: TMC-ETB/ETF disabled
> linaro-test [rc=0]# dd if=/dev/20010000.etf of=/cstrace.bin bs=1
> <---- It hangs here...
>

I get dd: failed to open '/dev/20010000.etf': Invalid argument
once all the data is read.

> My firmware version,
>
> NOTICE:  Booting Trusted Firmware
> NOTICE:  BL1: v1.1(debug):4a1dcde
> NOTICE:  BL1: Built : 17:54:40, Nov 24 2015
> NOTICE:  BL1: Booting BL2
> NOTICE:  BL2: v1.1(debug):4a1dcde
> NOTICE:  BL2: Built : 17:54:40, Nov 24 2015
> NOTICE:  BL1: Booting BL3-1
> NOTICE:  BL3-1: v1.1(debug):4a1dcde
> NOTICE:  BL3-1: Built : 17:54:40, Nov 24 2015
> UEFI firmware (version 9ed6f7e built at 17:54:28 on Nov 24 2015)
>

OK, this looks as good as what Suzuki has, so should be fine.
But it doesn't list SCP version, can you see that from the Linux boot
logs ?(something like below)

"scpi_protocol scpi: SCP Protocol 1.2 Firmware 1.17.0 version"

-- 
Regards,
Sudeep

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

* Coresight ETF trace dump failed in Juno r1 with 4.8-rc8
  2016-10-05  5:27       ` Venkatesh Vivekanandan
  2016-10-05 10:42         ` Sudeep Holla
@ 2016-10-05 17:17         ` Suzuki K Poulose
  2016-10-06  6:01           ` Venkatesh Vivekanandan
  1 sibling, 1 reply; 13+ messages in thread
From: Suzuki K Poulose @ 2016-10-05 17:17 UTC (permalink / raw)
  To: linux-arm-kernel

On 05/10/16 06:27, Venkatesh Vivekanandan wrote:
> On Tue, Oct 4, 2016 at 7:59 PM, Suzuki K Poulose <Suzuki.Poulose@arm.com> wrote:
>> On 04/10/16 06:37, Venkatesh Vivekanandan wrote:
>>>
>>> On Mon, Oct 3, 2016 at 6:44 PM, Sudeep Holla <sudeep.holla@arm.com> wrote:
>>>>
>>>> Hi Venkatesh,
>>>>
>>>> On 03/10/16 12:36, Venkatesh Vivekanandan wrote:
>>>>>
>>>>>
>>>>> Hi All,
>>>>>
>>>>> I am trying to collect ETF trace from Juno R1 and could see "cpu
>>>>> stall" while dumping the trace. Attached is the log of sequence
>>>>> followed. Was trying to collect the trace data from hardware and see
>>>>> if it is any valid data. Am I missing anything here?.
>>>>>
>>>>
>>>> There are few fixes from me and Suzuki queued for v4.9.
>>>> Can you check if this issue persists even on linux-next ?
>>>
>>>
>>> Issue is the same in linux-next as well. Please find the attached log.
>>>
>>> linaro-test [rc=0]# dd if=/dev/20010000.etf of=/cstrace.bin bs=1
>>> [  120.009698] INFO: rcu_preempt detected stalls on CPUs/tasks:
>>> [  120.015307]  2-...: (1 GPs behind) idle=f11/140000000000000/0
>>> softirq=224/224 fqs=1903
>>> [  120.023226]  (detected by 1, t=5255 jiffies, g=-1, c=-2, q=19)
>>> [  120.029001] Task dump for CPU 2:
>>> [  120.032190] dd              R  running task        0  1270   1267
>>> 0x00000002
>>> [  120.039172] Call trace:
>>> [  120.041594] [<ffff000008085534>] __switch_to+0xc8/0xd4
>>> [  120.046675] [<0000000000020000>] 0x20000
>>>
>>> Steps followed,
>>> # git clone
>>> git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
>>> linux-next
>>> # cd linux-next
>>> # make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig
>>> # make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- menuconfig  <---
>>> enable coresight
>>> # make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j8 Image
>>> # make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- dtbs
>>> # arch/arm64/boot/Image <--- copied this kernel
>>> # arch/arm64/boot/dts/arm/juno-r1.dtb <--- copied this dtb
>>>
>>> Top commit in linux-next is,
>>>
>>> commit c7d3b912180a9bb0733e5cfab84e5a7493dd3599
>>> Author: Stephen Rothwell <sfr@canb.auug.org.au>
>>> Date:   Tue Oct 4 14:52:03 2016 +1100
>>>
>>>     Add linux-next specific files for 20161004
>>
>>
>> Can't reproduce it here either.
>>
>> root at localhost:/sys/bus/coresight/devices# echo 1 > 20010000.etf/enable_sink
>> root at localhost:/sys/bus/coresight/devices# echo 1 >
>> 22140000.etm/enable_source
>> root at localhost:/sys/bus/coresight/devices# dd if=/dev/20010000.etf bs=1
>> of=/root/etr.bin
>> 65536+0 records in
>> 65536+0 records out
>> 65536 bytes (66 kB) copied, 0.227546 s, 288 kB/s
>> root at localhost:/sys/bus/coresight/devices# dd if=/dev/20010000.etf bs=1
>> of=/root/etr.bin
>> 65536+0 records in
>> 65536+0 records out
>> 65536 bytes (66 kB) copied, 0.233527 s, 281 kB/s
>> root at localhost:/sys/bus/coresight/devices# echo 0 > 20010000.etf/enable_sink
>> root at localhost:/sys/bus/coresight/devices# dd if=/dev/20010000.etf bs=1
>> of=/root/etr.bin
>> 65536+0 records in
>> 65536+0 records out
>> 65536 bytes (66 kB) copied, 0.474943 s, 138 kB/s
>>
>> FWIW, here is my firmware version :
>>
>> NOTICE:  Booting Trusted Firmware
>> NOTICE:  BL1: v1.1(release):e04723e21362
>> NOTICE:  BL1: Built : 15:39:56, Sep  1 2015
>> NOTICE:  BL1: Booting BL2
>> NOTICE:  BL2: v1.1(release):e04723e21362
>> NOTICE:  BL2: Built : 15:42:30, Sep  1 2015
>> NOTICE:  BL1: Booting BL3-1
>> NOTICE:  BL3-1: v1.1(release):604d5da6f2aa
>> NOTICE:  BL3-1: Built : 14:50:36, Sep 10 2015
>> UEFI firmware (version ea31f8e built at 16:35:17 on Aug  5 2015)
>>
>
> Hang is seen while trying to dump trace _after_ disabling the ETM
> source. Is it not supposed to work?.
> It works fine, when dumped before disabling ETM source. Please find
> the log below.
>
> linaro-test [rc=0]# echo 1 > 20010000.etf/enable_sink
> linaro-test [rc=0]# echo 1 > 22140000.etm/enable_source
> [   91.792145] coresight-tmc 20010000.etf: TMC-ETB/ETF enabled
> [   91.797719] coresight-funnel 20040000.main-funnel: FUNNEL inport 0 enabled
> [   91.804552] coresight-funnel 220c0000.cluster0-funnel: FUNNEL
> inport 1 enabled
> [   91.815990] coresight-etm4x 22140000.etm: ETM tracing enabled
> linaro-test [rc=0]# dd if=/dev/20010000.etf of=/cstrace.bin bs=1
> [  108.105492] coresight-tmc 20010000.etf: TMC read start
> [  108.404335] coresight-tmc 20010000.etf: TMC read end
> 65536+0 records in
> 65536+0 records out
> linaro-test [rc=0]# echo 0 > 20010000.etf/enable_sink
> linaro-test [rc=0]# dd if=/dev/20010000.etf of=/cstrace.bin bs=1
> [  125.069740] coresight-tmc 20010000.etf: TMC read start
> [  125.184370] coresight-tmc 20010000.etf: TMC read end
> 65536+0 records in
> 65536+0 records out
> linaro-test [rc=0]# echo 0 > 22140000.etm/enable_source
> [  140.271163] coresight-etm4x 22140000.etm: ETM tracing disabled
> [  140.276964] coresight-funnel 220c0000.cluster0-funnel: FUNNEL
> inport 1 disabled
> [  140.284211] coresight-funnel 20040000.main-funnel: FUNNEL inport 0 disabled
> [  140.291128] coresight-tmc 20010000.etf: TMC-ETB/ETF disabled
> linaro-test [rc=0]# dd if=/dev/20010000.etf of=/cstrace.bin bs=1
> <---- It hangs here...

The point is once you disable the source, which eventually disables
all the components upto the sink, the data in the ETF is already captured
into a buffer, so there is no coresight hardware access involved.

Also, looks like the open(/dev/20010000.etf,..) from the  dd didn't complete,
as we don't see a "TMC read start" line.

Could you please :

a) Try the patch [0] and see if it helps ?
b) If a doesn't help, after disabling the source, run any other command
    instead of the trace collection. e.g,

    dd if=/dev/zero of=/dev/null

   and see if it hangs the system in a similar way ?


Thanks
Suzuki

[0] test patch

----8>----


diff --git a/drivers/hwtracing/coresight/coresight-tmc-etf.c b/drivers/hwtracing/coresight/coresight-tmc-etf.c
index 1ffdab8..ef72ed8 100644
--- a/drivers/hwtracing/coresight/coresight-tmc-etf.c
+++ b/drivers/hwtracing/coresight/coresight-tmc-etf.c
@@ -511,13 +511,6 @@ int tmc_read_prepare_etb(struct tmc_drvdata *drvdata)
  		goto out;
  	}
  
-	/* There is no point in reading a TMC in HW FIFO mode */
-	mode = readl_relaxed(drvdata->base + TMC_MODE);
-	if (mode != TMC_MODE_CIRCULAR_BUFFER) {
-		ret = -EINVAL;
-		goto out;
-	}
-
  	/* Don't interfere if operated from Perf */
  	if (drvdata->mode == CS_MODE_PERF) {
  		ret = -EINVAL;

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

* Coresight ETF trace dump failed in Juno r1 with 4.8-rc8
  2016-10-05 10:42         ` Sudeep Holla
@ 2016-10-06  5:21           ` Venkatesh Vivekanandan
  2016-10-06  9:59             ` Sudeep Holla
  0 siblings, 1 reply; 13+ messages in thread
From: Venkatesh Vivekanandan @ 2016-10-06  5:21 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Oct 5, 2016 at 4:12 PM, Sudeep Holla <sudeep.holla@arm.com> wrote:
>
> On 05/10/16 06:27, Venkatesh Vivekanandan wrote:
>
> [...]
>
>
>>
>> Hang is seen while trying to dump trace _after_ disabling the ETM
>> source. Is it not supposed to work?.
>> It works fine, when dumped before disabling ETM source. Please find
>> the log below.
>>
>> linaro-test [rc=0]# echo 1 > 20010000.etf/enable_sink
>> linaro-test [rc=0]# echo 1 > 22140000.etm/enable_source
>> [   91.792145] coresight-tmc 20010000.etf: TMC-ETB/ETF enabled
>> [   91.797719] coresight-funnel 20040000.main-funnel: FUNNEL inport 0
>> enabled
>> [   91.804552] coresight-funnel 220c0000.cluster0-funnel: FUNNEL
>> inport 1 enabled
>> [   91.815990] coresight-etm4x 22140000.etm: ETM tracing enabled
>> linaro-test [rc=0]# dd if=/dev/20010000.etf of=/cstrace.bin bs=1
>> [  108.105492] coresight-tmc 20010000.etf: TMC read start
>> [  108.404335] coresight-tmc 20010000.etf: TMC read end
>> 65536+0 records in
>> 65536+0 records out
>> linaro-test [rc=0]# echo 0 > 20010000.etf/enable_sink
>> linaro-test [rc=0]# dd if=/dev/20010000.etf of=/cstrace.bin bs=1
>> [  125.069740] coresight-tmc 20010000.etf: TMC read start
>> [  125.184370] coresight-tmc 20010000.etf: TMC read end
>> 65536+0 records in
>> 65536+0 records out
>> linaro-test [rc=0]# echo 0 > 22140000.etm/enable_source
>> [  140.271163] coresight-etm4x 22140000.etm: ETM tracing disabled
>> [  140.276964] coresight-funnel 220c0000.cluster0-funnel: FUNNEL
>> inport 1 disabled
>> [  140.284211] coresight-funnel 20040000.main-funnel: FUNNEL inport 0
>> disabled
>> [  140.291128] coresight-tmc 20010000.etf: TMC-ETB/ETF disabled
>> linaro-test [rc=0]# dd if=/dev/20010000.etf of=/cstrace.bin bs=1
>> <---- It hangs here...
>>
>
> I get dd: failed to open '/dev/20010000.etf': Invalid argument
> once all the data is read.
>
It hangs in my board.

>> My firmware version,
>>
>> NOTICE:  Booting Trusted Firmware
>> NOTICE:  BL1: v1.1(debug):4a1dcde
>> NOTICE:  BL1: Built : 17:54:40, Nov 24 2015
>> NOTICE:  BL1: Booting BL2
>> NOTICE:  BL2: v1.1(debug):4a1dcde
>> NOTICE:  BL2: Built : 17:54:40, Nov 24 2015
>> NOTICE:  BL1: Booting BL3-1
>> NOTICE:  BL3-1: v1.1(debug):4a1dcde
>> NOTICE:  BL3-1: Built : 17:54:40, Nov 24 2015
>> UEFI firmware (version 9ed6f7e built at 17:54:28 on Nov 24 2015)
>>
>
> OK, this looks as good as what Suzuki has, so should be fine.
> But it doesn't list SCP version, can you see that from the Linux boot
> logs ?(something like below)
>
> "scpi_protocol scpi: SCP Protocol 1.2 Firmware 1.17.0 version"

[    2.537096] scpi_protocol scpi: SCP Protocol 1.0 Firmware 1.11.0 version

>
> --
> Regards,
> Sudeep

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

* Coresight ETF trace dump failed in Juno r1 with 4.8-rc8
  2016-10-05 17:17         ` Suzuki K Poulose
@ 2016-10-06  6:01           ` Venkatesh Vivekanandan
  0 siblings, 0 replies; 13+ messages in thread
From: Venkatesh Vivekanandan @ 2016-10-06  6:01 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Oct 5, 2016 at 10:47 PM, Suzuki K Poulose
<Suzuki.Poulose@arm.com> wrote:
> On 05/10/16 06:27, Venkatesh Vivekanandan wrote:
>>
>> On Tue, Oct 4, 2016 at 7:59 PM, Suzuki K Poulose <Suzuki.Poulose@arm.com>
>> wrote:
>>>
>>> On 04/10/16 06:37, Venkatesh Vivekanandan wrote:
>>>>
>>>>
>>>> On Mon, Oct 3, 2016 at 6:44 PM, Sudeep Holla <sudeep.holla@arm.com>
>>>> wrote:
>>>>>
>>>>>
>>>>> Hi Venkatesh,
>>>>>
>>>>> On 03/10/16 12:36, Venkatesh Vivekanandan wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>> Hi All,
>>>>>>
>>>>>> I am trying to collect ETF trace from Juno R1 and could see "cpu
>>>>>> stall" while dumping the trace. Attached is the log of sequence
>>>>>> followed. Was trying to collect the trace data from hardware and see
>>>>>> if it is any valid data. Am I missing anything here?.
>>>>>>
>>>>>
>>>>> There are few fixes from me and Suzuki queued for v4.9.
>>>>> Can you check if this issue persists even on linux-next ?
>>>>
>>>>
>>>>
>>>> Issue is the same in linux-next as well. Please find the attached log.
>>>>
>>>> linaro-test [rc=0]# dd if=/dev/20010000.etf of=/cstrace.bin bs=1
>>>> [  120.009698] INFO: rcu_preempt detected stalls on CPUs/tasks:
>>>> [  120.015307]  2-...: (1 GPs behind) idle=f11/140000000000000/0
>>>> softirq=224/224 fqs=1903
>>>> [  120.023226]  (detected by 1, t=5255 jiffies, g=-1, c=-2, q=19)
>>>> [  120.029001] Task dump for CPU 2:
>>>> [  120.032190] dd              R  running task        0  1270   1267
>>>> 0x00000002
>>>> [  120.039172] Call trace:
>>>> [  120.041594] [<ffff000008085534>] __switch_to+0xc8/0xd4
>>>> [  120.046675] [<0000000000020000>] 0x20000
>>>>
>>>> Steps followed,
>>>> # git clone
>>>> git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
>>>> linux-next
>>>> # cd linux-next
>>>> # make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig
>>>> # make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- menuconfig  <---
>>>> enable coresight
>>>> # make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j8 Image
>>>> # make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- dtbs
>>>> # arch/arm64/boot/Image <--- copied this kernel
>>>> # arch/arm64/boot/dts/arm/juno-r1.dtb <--- copied this dtb
>>>>
>>>> Top commit in linux-next is,
>>>>
>>>> commit c7d3b912180a9bb0733e5cfab84e5a7493dd3599
>>>> Author: Stephen Rothwell <sfr@canb.auug.org.au>
>>>> Date:   Tue Oct 4 14:52:03 2016 +1100
>>>>
>>>>     Add linux-next specific files for 20161004
>>>
>>>
>>>
>>> Can't reproduce it here either.
>>>
>>> root at localhost:/sys/bus/coresight/devices# echo 1 >
>>> 20010000.etf/enable_sink
>>> root at localhost:/sys/bus/coresight/devices# echo 1 >
>>> 22140000.etm/enable_source
>>> root at localhost:/sys/bus/coresight/devices# dd if=/dev/20010000.etf bs=1
>>> of=/root/etr.bin
>>> 65536+0 records in
>>> 65536+0 records out
>>> 65536 bytes (66 kB) copied, 0.227546 s, 288 kB/s
>>> root at localhost:/sys/bus/coresight/devices# dd if=/dev/20010000.etf bs=1
>>> of=/root/etr.bin
>>> 65536+0 records in
>>> 65536+0 records out
>>> 65536 bytes (66 kB) copied, 0.233527 s, 281 kB/s
>>> root at localhost:/sys/bus/coresight/devices# echo 0 >
>>> 20010000.etf/enable_sink
>>> root at localhost:/sys/bus/coresight/devices# dd if=/dev/20010000.etf bs=1
>>> of=/root/etr.bin
>>> 65536+0 records in
>>> 65536+0 records out
>>> 65536 bytes (66 kB) copied, 0.474943 s, 138 kB/s
>>>
>>> FWIW, here is my firmware version :
>>>
>>> NOTICE:  Booting Trusted Firmware
>>> NOTICE:  BL1: v1.1(release):e04723e21362
>>> NOTICE:  BL1: Built : 15:39:56, Sep  1 2015
>>> NOTICE:  BL1: Booting BL2
>>> NOTICE:  BL2: v1.1(release):e04723e21362
>>> NOTICE:  BL2: Built : 15:42:30, Sep  1 2015
>>> NOTICE:  BL1: Booting BL3-1
>>> NOTICE:  BL3-1: v1.1(release):604d5da6f2aa
>>> NOTICE:  BL3-1: Built : 14:50:36, Sep 10 2015
>>> UEFI firmware (version ea31f8e built at 16:35:17 on Aug  5 2015)
>>>
>>
>> Hang is seen while trying to dump trace _after_ disabling the ETM
>> source. Is it not supposed to work?.
>> It works fine, when dumped before disabling ETM source. Please find
>> the log below.
>>
>> linaro-test [rc=0]# echo 1 > 20010000.etf/enable_sink
>> linaro-test [rc=0]# echo 1 > 22140000.etm/enable_source
>> [   91.792145] coresight-tmc 20010000.etf: TMC-ETB/ETF enabled
>> [   91.797719] coresight-funnel 20040000.main-funnel: FUNNEL inport 0
>> enabled
>> [   91.804552] coresight-funnel 220c0000.cluster0-funnel: FUNNEL
>> inport 1 enabled
>> [   91.815990] coresight-etm4x 22140000.etm: ETM tracing enabled
>> linaro-test [rc=0]# dd if=/dev/20010000.etf of=/cstrace.bin bs=1
>> [  108.105492] coresight-tmc 20010000.etf: TMC read start
>> [  108.404335] coresight-tmc 20010000.etf: TMC read end
>> 65536+0 records in
>> 65536+0 records out
>> linaro-test [rc=0]# echo 0 > 20010000.etf/enable_sink
>> linaro-test [rc=0]# dd if=/dev/20010000.etf of=/cstrace.bin bs=1
>> [  125.069740] coresight-tmc 20010000.etf: TMC read start
>> [  125.184370] coresight-tmc 20010000.etf: TMC read end
>> 65536+0 records in
>> 65536+0 records out
>> linaro-test [rc=0]# echo 0 > 22140000.etm/enable_source
>> [  140.271163] coresight-etm4x 22140000.etm: ETM tracing disabled
>> [  140.276964] coresight-funnel 220c0000.cluster0-funnel: FUNNEL
>> inport 1 disabled
>> [  140.284211] coresight-funnel 20040000.main-funnel: FUNNEL inport 0
>> disabled
>> [  140.291128] coresight-tmc 20010000.etf: TMC-ETB/ETF disabled
>> linaro-test [rc=0]# dd if=/dev/20010000.etf of=/cstrace.bin bs=1
>> <---- It hangs here...
>
>
> The point is once you disable the source, which eventually disables
> all the components upto the sink, the data in the ETF is already captured
> into a buffer, so there is no coresight hardware access involved.
>
> Also, looks like the open(/dev/20010000.etf,..) from the  dd didn't
> complete,
> as we don't see a "TMC read start" line.
>
> Could you please :
>
> a) Try the patch [0] and see if it helps ?
> b) If a doesn't help, after disabling the source, run any other command
>    instead of the trace collection. e.g,
>
>    dd if=/dev/zero of=/dev/null
>
>   and see if it hangs the system in a similar way ?

Applied the patch(fixed unused variable warning) and tested. System
hangs the same way as before
with one extra print. dd to /dev/null works fine. Please find the log below.

linaro-test [rc=0]# echo 0 > 20010000.etf/enable_sink
linaro-test [rc=0]# dd if=/dev/20010000.etf of=/cstrace.bin bs=1
[   60.519034] coresight-tmc 20010000.etf: TMC read start
[   60.635825] coresight-tmc 20010000.etf: TMC read end
65536+0 records in
65536+0 records out
linaro-test [rc=0]# echo 0 > 22140000.etm/enable_source
[   78.394169] coresight-etm4x 22140000.etm: ETM tracing disabled
[   78.399977] coresight-funnel 220c0000.cluster0-funnel: FUNNEL
inport 1 disabled
[   78.407225] coresight-funnel 20040000.main-funnel: FUNNEL inport 0 disabled
[   78.414140] coresight-tmc 20010000.etf: TMC-ETB/ETF disabled
linaro-test [rc=0]# dd if=/dev/zero of=/dev/null bs=1 count=100
100+0 records in
100+0 records out
linaro-test [rc=0]# dd if=/dev/20010000.etf of=/cstrace.bin bs=1
[  104.673413] coresight-tmc 20010000.etf: TMC read start
==== it just hangs here====

>
>
> Thanks
> Suzuki
>
> [0] test patch
>
> ----8>----
>
>
> diff --git a/drivers/hwtracing/coresight/coresight-tmc-etf.c
> b/drivers/hwtracing/coresight/coresight-tmc-etf.c
> index 1ffdab8..ef72ed8 100644
> --- a/drivers/hwtracing/coresight/coresight-tmc-etf.c
> +++ b/drivers/hwtracing/coresight/coresight-tmc-etf.c
> @@ -511,13 +511,6 @@ int tmc_read_prepare_etb(struct tmc_drvdata *drvdata)
>                 goto out;
>         }
>  -      /* There is no point in reading a TMC in HW FIFO mode */
> -       mode = readl_relaxed(drvdata->base + TMC_MODE);
> -       if (mode != TMC_MODE_CIRCULAR_BUFFER) {
> -               ret = -EINVAL;
> -               goto out;
> -       }
> -
>         /* Don't interfere if operated from Perf */
>         if (drvdata->mode == CS_MODE_PERF) {
>                 ret = -EINVAL;
>
>
>

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

* Coresight ETF trace dump failed in Juno r1 with 4.8-rc8
  2016-10-06  5:21           ` Venkatesh Vivekanandan
@ 2016-10-06  9:59             ` Sudeep Holla
  0 siblings, 0 replies; 13+ messages in thread
From: Sudeep Holla @ 2016-10-06  9:59 UTC (permalink / raw)
  To: linux-arm-kernel



On 06/10/16 06:21, Venkatesh Vivekanandan wrote:
> On Wed, Oct 5, 2016 at 4:12 PM, Sudeep Holla <sudeep.holla@arm.com> wrote:
>>
>> On 05/10/16 06:27, Venkatesh Vivekanandan wrote:
>>

[...]

>> OK, this looks as good as what Suzuki has, so should be fine.
>> But it doesn't list SCP version, can you see that from the Linux boot
>> logs ?(something like below)
>>
>> "scpi_protocol scpi: SCP Protocol 1.2 Firmware 1.17.0 version"
>
> [    2.537096] scpi_protocol scpi: SCP Protocol 1.0 Firmware 1.11.0 version
>

So you have not upgraded the firmware yet ? IIRC, the latest release
link I provided has v1.16.0 or 1.17.0

v1.11.0 is almost a year old and I have worked with the firmware team to
get various issues around ETM I encountered since then. If you are
facing issue even with latest release firmware, then I will be able to
look at it and help you.

-- 
Regards,
Sudeep

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

end of thread, other threads:[~2016-10-06  9:59 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-03 11:36 Coresight ETF trace dump failed in Juno r1 with 4.8-rc8 Venkatesh Vivekanandan
2016-10-03 13:14 ` Sudeep Holla
2016-10-04  5:37   ` Venkatesh Vivekanandan
2016-10-04 10:30     ` Sudeep Holla
2016-10-04 12:14       ` Venkatesh Vivekanandan
2016-10-04 12:51         ` Sudeep Holla
2016-10-04 14:29     ` Suzuki K Poulose
2016-10-05  5:27       ` Venkatesh Vivekanandan
2016-10-05 10:42         ` Sudeep Holla
2016-10-06  5:21           ` Venkatesh Vivekanandan
2016-10-06  9:59             ` Sudeep Holla
2016-10-05 17:17         ` Suzuki K Poulose
2016-10-06  6:01           ` Venkatesh Vivekanandan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.