402 Star 1.4K Fork 1.3K

GVPopenEuler / kernel

 / 详情

海思Hip09支持coresight trace功能

已完成
任务
创建于  
2022-10-29 10:49

Synchronize the coresight code of the Linux mainline to support ETE tracing

  1. Add support for ETE tracing
    Add ETE as one of the supported device types we support
    with ETM4x driver. The devices are named following the
    existing convention as ete.

  2. Add TRBE driver
    TRBE always needs to be used along with it's corresponding percpu ETE
    component. ETE generates trace data which is then captured with TRBE.
    Unlike traditional sink devices, TRBE is a CPU feature accessible via
    system registers. But it's explicit dependency with trace unit (ETE)
    requires it to be plugged in as a coresight sink device.

  3. Add TMC driver
    It can present itself as an ETF (Embedded Trace FIFO) or ETR
    (Embedded Trace Router).
    ETF configured in HW fifo mode it acts as link.
    ETR always acts as a sink and can be used to route data to memory
    allocated in RAM.

评论 (2)

何俊豪 创建了任务

Hi hejunhao3, welcome to the openEuler Community.
I'm the Bot here serving you. You can find the instructions on how to interact with me at Here.
If you have any questions, please contact the SIG: Kernel, and any of the maintainers: @YangYingliang , @成坚 (CHENG Jian) , @jiaoff , @zhengzengkai , @刘勇强 , @wangxiongfeng , @朱科潜 , @WangShaoBo , @lujialin , @wuxu_buque , @Xu Kuohai , @冷嘲啊 , @Lingmingqiang , @yuzenghui , @juntian , @OSSIM , @陈结松 , @whoisxxx , @koulihong , @刘恺 , @hanjun-guo , @woqidaideshi , @Chiqijun , @Kefeng , @ThunderTown , @AlexGuo , @kylin-mayukun , @Zheng Zucheng , @柳歆 , @Jackie Liu , @zhujianwei001 , @郑振鹏 , @SuperSix173 , @colyli , @Zhang Yi , @htforge , @Qiuuuuu , @Yuehaibing , @xiehaocheng , @guzitao , @CTC-Xibo.Wang , @zhanghongchen , @chen wei , @Jason Zeng , @Xie XiuQi

openeuler-ci-bot 添加了
 
sig/Kernel
标签
何俊豪 修改了描述
何俊豪 修改了标题
何俊豪 修改了标题
rcS Complete
Welcome to Mini Linux
GNU/Linux 5.10.0+ aarch64
Version: 1.1.6
        .--.
       |o_o |
       |:_/ |
      //   \ \
     (|     | )
    /'\_   _/`\
    \___)=(___/
Documentation: http://open-estuary.org
E-mail: Chinafengliang@163.com
estuary:/$ 
estuary:/$ insmod /lib/modules/5.10.0+/coresight.ko 
estuary:/$ insmod /lib/modules/5.10.0+/coresight-etm4x.ko
[  229.463637][  T267] coresight ete0: CPU0: ete v1.0 initialized
[  229.491985][  T267] coresight ete1: CPU1: ete v1.0 initialized
[  229.515577][  T267] coresight ete2: CPU2: ete v1.0 initialized
[  229.539732][  T267] coresight ete3: CPU3: ete v1.0 initialized
[  229.564522][  T267] coresight ete4: CPU4: ete v1.0 initialized
[  229.591876][  T267] coresight ete5: CPU5: ete v1.0 initialized
[  229.615923][  T267] coresight ete6: CPU6: ete v1.0 initialized
[  229.639536][  T267] coresight ete7: CPU7: ete v1.0 initialized
[  229.664517][  T267] coresight ete8: CPU8: ete v1.0 initialized
[  229.688138][  T267] coresight ete9: CPU9: ete v1.0 initialized
[  229.712215][  T267] coresight ete10: CPU10: ete v1.0 initialized
[  229.736791][  T267] coresight ete11: CPU11: ete v1.0 initialized
[  229.762489][  T267] coresight ete12: CPU12: ete v1.0 initialized
[  229.787324][  T267] coresight ete13: CPU13: ete v1.0 initialized
[  229.812427][  T267] coresight ete14: CPU14: ete v1.0 initialized
[  229.836316][  T267] coresight ete15: CPU15: ete v1.0 initialized
estuary:/$ insmod /lib/modules/5.10.0+/coresight-funnel.ko
estuary:/$ insmod /lib/modules/5.10.0+/coresight-tmc.ko 
estuary:/$ 
estuary:/$ ls /sys/bus/coresight/devices/
ete0      ete12     ete2      ete6      funnel0   tmc_etf0  tmc_etr0
ete1      ete13     ete3      ete7      funnel1   tmc_etf1
ete10     ete14     ete4      ete8      funnel2   tmc_etf2
ete11     ete15     ete5      ete9      funnel3   tmc_etf3
estuary:/$ 
estuary:/$ echo 0x400000 > /sys/bus/coresight/devices/tmc_etr0/buffer_size
estuary:/$ echo 1 > /sys/bus/coresight/devices/tmc_etr0/enable_sink
estuary:/$ echo 1 > /sys/bus/coresight/devices/ete3/enable_source
estuary:/$ cat /sys/bus/coresight/devices/tmc_etr0/mgmt/*
0x33
0xf3e
0x1
0x79100000
0x1c40
0x133
0x0
0x0
0x0
0x79100000
0x100000
0x79105b80
0x0
0x0
estuary:/$ 
estuary:/$ cat /sys/bus/coresight/devices/tmc_etr0/mgmt/*
0x33
0xf3e
0x1
0x79100000
0x1c40
0x133
0x0
0x0
0x0
0x79100000
0x100000
0x79106e00
0x0
0x0
estuary:/$ echo 0 > /sys/bus/coresight/devices/ete3/enable_source
estuary:/$ 
estuary:/$ insmod /lib/modules/5.10.0+/ram_blk_drv.ko p_addr=0x79100000 p_size=0x3000
[  751.414200][  T298] ramblock_init
[  751.419370][  T298] input para p_addr:0x79100000,p_size:0x3000
[  751.437124][  T298] ramblock_buf viraddr:(____ptrval____),phyaddr: 0x79100000,len:0x3000 
estuary:/$ dd if=/dev/ramblock  of=sys_c1_range.data bs=4k count=48
3+0 records in
3+0 records out
12288 bytes (12.0KB) copied, 0.028941 seconds, 414.6KB/s
estuary:/$ 
estuary:/$ ptm2human -e -i sys_c1_range.data >sys_c1_range.data.log 2>&1
estuary:/$ vi sys_c1_range.data.log 
[2;1HThere is no valid data in the stream of ID 0
[3;1HThere is no valid data in the stream of ID 1
[4;1HThere is no valid data in the stream of ID 2
[5;1HThere is no valid data in the stream of ID 3
[6;1HThere is no valid data in the stream of ID 4
[7;1HThere is no valid data in the stream of ID 5
[8;1HThere is no valid data in the stream of ID 6
[9;1HThere is no valid data in the stream of ID 7
[10;1HThere is no valid data in the stream of ID 8
[11;1HThere is no valid data in the stream of ID 9
[12;1HThere is no valid data in the stream of ID 10
[13;1HThere is no valid data in the stream of ID 11
[14;1HThere is no valid data in the stream of ID 12
[15;1HThere is no valid data in the stream of ID 13
[16;1HThere is no valid data in the stream of ID 14
[17;1HThere is no valid data in the stream of ID 15
[18;1HThere is no valid data in the stream of ID 16
[19;1HThere is no valid data in the stream of ID 17
[20;1HThere is no valid data in the stream of ID 18
[21;1HThere is no valid data in the stream of ID 19
[22;1HThere is no valid data in the stream of ID 20
[21;1HDecode trace stream of ID 21                 
[22;1HSyncing the trace stream... 
[23;1HDecoding the trace stream...
[24;1HTraceInfo - Cycle count disabled,
[21;1H            Tracing of conditional non-branch instruction disabled,0%1049l
estuary:/$ 
estuary:/$ perf -v
perf version 5.10.g6c1f9225d743
estuary:/$ perf record -e /cs_etm/@tmc_etr0/ -C 7 taskset -c 7 uname -a
Linux (none) 5.10.0+ #3 SMP Thu Oct 27 14:51:05 CST 2022 aarch64 GNU/Linux
[ 2900.563565][  T306] coresight tmc_etr0: timeout while waiting for completion of Manual Flush
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.588 MB perf.data ]
/estuary:/$ 
estuary:/$ perf report --stdio -D > report.txt
estuary:/$ 
estuary:/$ vi report.txt 
[1;1H 00 00 00 00 00 00 00 00 00  ................                              
[2;1H 00 00 00 00 00 00 00 00 00  ................                              
[3;1H                                                                                
[4;1HMMAP -1/0: [0xffff800008e51000(0xb000) @ 0]: x /lib/modules/5.10.0+/coresight.ko
[5;1H                                                                                
[6;1H                      
[7;1H 
[8;1Hs                              
[9;1H 00 ff ff ff ff 00 00 00 00  ......p.........                              
[10;1H ff 00 f0 01 00 00 00 00 00  ................                              
[11;1H 00 2f 6c 69 62 2f 6d 6f 64  ......../lib/mod                              
[12;1H 31 30 2e 30 2b 2f 63 6f 72  ules/5.10.0+/cor                              
[13;1H 65 74 6d 34 78 2e 6b 6f 00  esight-etm4x.ko.                              
[14;1H 00 00 00 00 00 00 00 00 00  ................                              
[15;1H 00 00 00 00 00 00 00 00 00  ................                              
[16;1H                                                                                
[17;1HMMAP -1/0: [0xffff800008e5d000(0x1f000) @ 0]: x /lib/modules/5.10.0+/coresight-e
[18;1H                                                                                
[19;1H                      
[20;1H 
[21;1Hs                              
[22;1H 00 ff ff ff ff 00 00 00 00  ......x.........                              
[23;1H ff 00 50 00 00 00 00 00 00  .........P......                              
[24;1H 00 2f 6c 69 62 2f 6d 6f 64  ......../lib/mod                              
[17;80H
[25;1H
[K- report.txt 141/321832 0%
[17;80H
[1;2H                                            
[2;1H0x73c8 [0x40]: PERF_RECORD_AUX offset: 0 size: 0x8f550 flags: 0 []
[3;1H                                                                                
[4;1Hvent: 71                                                                        
[5;1H                                                                                
[6;2Hsize 48 bytes
[7;1H00 00 00 00 30 00 50 f5 08 00 00 00 00 00  G.....0.P.......
[8;1H00 00 00 00 00 00 bc e9 85 3d 36 c4 4f 38  ...........=6.O8
[9;1H00 00 ff ff ff ff 07 00 00 00 00 00 00 00  ................
[10;2H                                            
[11;1H]: PERF_RECORD_AUXTRACE size: 0x8f550  offset: 0  ref: 0x384fc4363d85e9bc  idx:
[12;2H                                            
[13;1HETM Trace data: size 587088 bytes            
[14;1HD:1e;   I_ASYNC : Alignment Synchronisation. 
[15;1HID:1e;  I_TRACE_INFO : Trace Info.; INFO=0x0 { CC.0 }
[16;1HID:1e;  I_TRACE_ON : Trace On.
[17;1HID:1e;  I_ADDR_CTXT_L_64IS0 : Address & Context, Long, 64 bit, IS0.; Addr=0xFFFF
[18;1HID:1e;  I_ATOM_F1 : Atom format 1.; E
[19;1HID:1e;  I_TIMESTAMP : Timestamp.; Updated val = 0x16993364f4
[20;1HID:1e;  I_ATOM_F1 : Atom format 1.; E
[21;1HID:1e;  I_TIMESTAMP : Timestamp.; Updated val = 0x16993364f6
[22;1HID:1e;  I_ATOM_F1 : Atom format 1.; E        
[23;1HID:1e;  I_TIMESTAMP : Timestamp.; Updated val = 0x16993364fe
[24;1HID:1e;  I_ATOM_F1 : Atom format 1.; E        
estuary:/$ 
estuary:/$ grep -rn "I_ASYNC : Alignment Synchronisation" report.txt | head -n 5 
4244:	Idx:0; ID:1e;	I_ASYNC : Alignment Synchronisation.
6913:	Idx:4429; ID:1e;	I_ASYNC : Alignment Synchronisation.
9279:	Idx:8833; ID:1e;	I_ASYNC : Alignment Synchronisation.
11644:	Idx:13250; ID:1e;	I_ASYNC : Alignment Synchronisation.
14010:	Idx:17667; ID:1e;	I_ASYNC : Alignment Synchronisation.
estuary:/$ 
何俊豪 通过openeuler/kernel Pull Request !225任务状态待办的 修改为已完成
何俊豪 修改了描述
何俊豪 修改了标题

登录 后才可以发表评论

状态
负责人
项目
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
预计工期 (小时)
参与者(2)
5329419 openeuler ci bot 1632792936
C
1
https://gitee.com/openeuler/kernel.git
git@gitee.com:openeuler/kernel.git
openeuler
kernel
kernel

搜索帮助