Hi,
On Thu, 2 Jul 2020 at 09:59, H MJ eric.mjh123@gmail.com wrote:
Dear Leo,
Big Thanks for replying!!!!
I have tried some code pieces for perf tool and driver (kernel v4.19), but it seems cannot work because the parser error.
Also, I've checked the coresight can work by referencing https://github.com/saiprakash-ranjan/coresight-test-results/blob/master/core....
Therefore, I guess the key problem is that the perf-parser cannot support the symbol "-" under the cs_etm. Now, I am trying two ways, one is to modify the device name under the folders (/sys/bus/coresight/device, /sys/bus/event_source/devices/cs_etm/sinks/)
This is the best approach.
another one is to modify the per-parser rule to solve the problem.
The perf parser is rather complex - the "-" may be causing an error due to it being valid for other commands .e.g. -e, so changing the parser may not be possible.
Could you give me some suggestions?
Due to the way perf works, the sinks/<name> contains a value known as the sinkid - this is a string hash of <name>. This 32 bit hash is what is passed between kernel and user space perf, not the string. As a result the following is possible (from my DB410 system):-
root@linaro-developer:/home/linaro/perf-tests# ls /sys/devices/cs_etm/sinks/ tmc_etf0 tmc_etr0 tpiu0 root@linaro-developer:/home/linaro/perf-tests# cat /sys/devices/cs_etm/sinks/tmc_etr0 0xa6509eae root@linaro-developer:/home/linaro/perf-tests# ./perf record -e cs_etm/sinkid=0xa6509eae/ --per-thread uname Linux [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.157 MB perf.data ]
Regards
Mike
Thanks you very much. Best regards, M.H.
Leo Yan leo.yan@linaro.org 於 2020年7月2日 週四 下午4:25寫道:
Hi Eric,
On Wed, Jul 01, 2020 at 10:41:21AM +0800, H MJ wrote:
Dears,
After I moved some kernel codes from Linux version 5.8 into 4.19 (current device), I can see the device name in the sinks folder. (Table1) However, both of perfK30 (perf builtin version) and perf53 (perf linux 53 version) still happened same problems. (Table 2)
Could you give me some suggestions?
I am busy on the tasks in hand, so didn't follow up your questions closely.
When I saw you are using different code bases for kernel and perf tool, this seems to me it is not the right way. I suggest you could firstly to use the same code base for both kernel and perf tool, e.g. you can use the mainline kernel, or if you have SoC vendor's kernel version, either is okay.
The kernel and perf tool have many upgradation from 4.19 to 5.8, especially for perf tools, if you want to back port some patches from 5.8 to 4.19, it's easily to miss some code pices and cause compatibility issue. If jump to differnt code base, the questions will be floating.
Again, I still suggest you could firstly get clear the CoreSight device naming issue, e.g. why the device names are not using default namings, like tmc-etr0, tmc-etf0, etc? Could you check this and also check with SoC vendor if possible?
And as Mike and me have suggested some code pieces for perf tool and driver, suggest you could dig into it and get more debugging info.
Thanks, Leo