Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test case for sof component performance check #1090

Merged
merged 2 commits into from
Aug 23, 2023

Conversation

aiChaoSONG
Copy link

@aiChaoSONG aiChaoSONG commented Aug 16, 2023

based on #1064, add a test case for performance check

2023-08-16 06:33:37 UTC [INFO] ktime=524 sof-test PID=2513: starting
2023-08-16 06:33:37 UTC [INFO] Starting /usr/local/bin/mtrace-reader.py >& /home/ubuntu/sof-test/logs/check-performance/2023-08-16-06:33:36-7734/mtrace.txt &
2023-08-16 06:33:37 UTC [INFO] /home/ubuntu/sof-test/test-case/check-performance.sh will use topology /usr/lib/firmware/intel/sof-ace-tplg/sof-hda-generic-4ch.tplg to run the test case
2023-08-16 06:33:37 UTC [INFO] Pipeline list to ignore is specified, will ignore 'pcm=HDA Digital' in test case
2023-08-16 06:33:37 UTC [INFO] Run command to get pipeline parameters
2023-08-16 06:33:37 UTC [COMMAND] sof-tplgreader.py /usr/lib/firmware/intel/sof-ace-tplg/sof-hda-generic-4ch.tplg -f 'type:any & ~pcm:HDMI' -b ' pcm:HDA Digital' -s 0 -e
2023-08-16 06:33:37 UTC [INFO] Running (PCM: HDA Analog [hw:0,0]<playback>) in background
2023-08-16 06:33:37 UTC [COMMAND] aplay   -D hw:0,0 -c 2 -r 48000 -f S32_LE -d 30 /dev/zero -q
2023-08-16 06:33:37 UTC [INFO] Running (PCM: HDA Analog [hw:0,0]<capture>) in background
2023-08-16 06:33:37 UTC [COMMAND] arecord   -D hw:0,0 -c 2 -r 48000 -f S32_LE -d 30 /dev/null -q
2023-08-16 06:33:37 UTC [INFO] Running (PCM: Deepbuffer HDA Analog [hw:0,31]<playback>) in background
2023-08-16 06:33:37 UTC [COMMAND] aplay   -D hw:0,31 -c 2 -r 48000 -f S32_LE -d 30 /dev/zero -q
2023-08-16 06:33:37 UTC [INFO] Running (PCM: DMIC Raw [hw:0,6]<capture>) in background
2023-08-16 06:33:37 UTC [INFO] Waiting for aplay/arecord process to exit
2023-08-16 06:33:37 UTC [COMMAND] arecord   -D hw:0,6 -c 4 -r 48000 -f S32_LE -d 30 /dev/null -q
2023-08-16 06:34:09 UTC [INFO] Starting func_exit_handler(0)
2023-08-16 06:34:09 UTC [INFO] pkill -TERM -f mtrace-reader.py
2023-08-16 06:34:09 UTC [INFO] nlines=1248 /home/ubuntu/sof-test/logs/check-performance/2023-08-16-06:33:36-7734/mtrace.txt
2023-08-16 06:34:09 UTC [INFO] ktime=557 sof-test PID=2513: ending
2023-08-16 06:34:09 UTC [INFO] Checking SOF component performance
2023-08-16 06:34:09 UTC [COMMAND] sof_perf_analyzer.py --kmsg=/home/ubuntu/sof-test/logs/check-performance/2023-08-16-06:33:36-7734/dmesg.txt /home/ubuntu/sof-test/logs/check-performance/2023-08-16-06:33:36-7734/mtrace.txt

                     COMP_NAME,    COMP_ID,  AVG_OF_CPU_AVG, AVG_OF_CPU_PEAK, PEAK_OF_CPU_AVG, PEAK_OF_CPU_PEAK
                    mixout.2.1,  1-0x30000,            3.27,            3.72,            3.30,            13.34
                      gain.2.1,  1-0x60001,            2.61,            3.81,            2.75,            18.93
dai-copier.HDA.Analog.playback,  1-0x40001,            5.25,           10.56,            5.28,            15.55
        host-copier.0.playback,  0-0x40000,            4.57,            5.00,            4.58,            11.21
                      gain.1.1,  0-0x60000,            2.58,            3.76,            2.71,            19.64
                     mixin.1.1,  0-0x20000,            3.49,            3.80,            3.51,             7.93
                     gain.11.1,  4-0x60003,            2.81,            4.05,            3.00,            13.20
         host-copier.6.capture,  4-0x40005,            4.79,            5.49,            4.81,            16.27
dai-copier.DMIC.dmic01.capture,  3-0x40003,            6.92,            7.58,            7.03,            17.18
                          None, 3-0x100000,           15.29,           23.70,           15.29,            25.93
            module-copier.12.2,  3-0x40004,            3.26,            3.39,            3.26,             3.44
                          None,  2-0x40002,            4.24,            4.58,            4.25,             5.84
                          None,  2-0x60002,            2.64,            3.47,            2.75,             9.54
                    mixin.15.1,  2-0x20001,            3.63,            3.77,            3.65,             3.81
         host-copier.0.capture,  6-0x40007,            4.59,            4.76,            4.60,             5.24
 dai-copier.HDA.Analog.capture,  5-0x40006,            5.12,            5.26,            5.14,             5.30
                          None, 5-0x100001,            8.97,           20.77,            8.98,            21.29
2023-08-16 06:34:09 UTC [INFO] Test Result: PASS!

There is probably a bug in tools/sof_perf_analyzer.py here, so the component id matching is not work very well (as you see the None in above table),

widget_id = '0x' + widget_id[:-6:-1]
I will fix it later.

On test passed, do performance test if it
is enabled by set DO_PERF_ANALYSIS to 1.

Signed-off-by: Chao Song <[email protected]>
Add a test case for SOF component performance check.
This test will start all pipeline except HDMI pipeline,
and call tools/sof_perf_analyzer.py script on test pass.

Signed-off-by: Chao Song <[email protected]>
Copy link
Contributor

@keqiaozhang keqiaozhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Run this PR locally and LGTM.

@aiChaoSONG aiChaoSONG merged commit 7e70d7d into thesofproject:main Aug 23, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants