diff --git a/base/base.json b/base/base.json index 41657a40d710fa8eb15ccc286ee448971494434e..093868e210f995f1cf13aa24e0a6fcdff1ff194e 100644 --- a/base/base.json +++ b/base/base.json @@ -15986,6 +15986,88 @@ } } }, + "tperf-stream-max": { + "status": "PASS", + "duration": 121.58, + "result": { + "stream-max-thread-Copy": { + "name": "stream-max-thread-Copy", + "type": "HIB", + "key": "avg", + "unit": "MB/s", + "label": "", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 50.0 + }, + "stream-max-thread-Scale": { + "name": "stream-max-thread-Scale", + "type": "HIB", + "key": "avg", + "unit": "MB/s", + "label": "", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 50.0 + }, + "stream-max-thread-Add": { + "name": "stream-max-thread-Add", + "type": "HIB", + "key": "avg", + "unit": "MB/s", + "label": "", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 50.0 + }, + "stream-max-thread-Triad": { + "name": "stream-max-thread-Triad", + "type": "HIB", + "key": "avg", + "unit": "MB/s", + "label": "", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 50.0 + } + } + }, "tperf-sysbench-threads-16-locks-24-yields-1000": { "status": "PASS", "duration": 20.13, @@ -20333,5 +20415,1587 @@ } } } + }, + "tperf-sysbench-memory-thread-max": { + "status": "PASS", + "duration": 0, + "result": { + "tperf-sysbench-memory-thread-max": { + "name": "tperf-sysbench-memory-thread-max", + "type": "HIB", + "key": "avg", + "unit": "MiB/s", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 0 + } + } + }, + "tperf-sysbench-memory-block-1k-size-1g-seqrd": { + "status": "PASS", + "duration": 0, + "result": { + "tperf-sysbench-memory-block-1k-size-1g-seqrd": { + "name": "tperf-sysbench-memory-block-1k-size-1g-seqrd", + "type": "HIB", + "key": "avg", + "unit": "MiB/s", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 0 + } + } + }, + "tperf-sysbench-memory-block-2k-size-1g-seqrd": { + "status": "PASS", + "duration": 0, + "result": { + "tperf-sysbench-memory-block-2k-size-1g-seqrd": { + "name": "tperf-sysbench-memory-block-2k-size-1g-seqrd", + "type": "HIB", + "key": "avg", + "unit": "MiB/s", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 0 + } + } + }, + "tperf-sysbench-memory-block-4k-size-1g-seqrd": { + "status": "PASS", + "duration": 0, + "result": { + "tperf-sysbench-memory-block-4k-size-1g-seqrd": { + "name": "tperf-sysbench-memory-block-4k-size-1g-seqrd", + "type": "HIB", + "key": "avg", + "unit": "MiB/s", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 0 + } + } + }, + "tperf-sysbench-memory-block-16k-size-1g-seqrd": { + "status": "PASS", + "duration": 0, + "result": { + "tperf-sysbench-memory-block-16k-size-1g-seqrd": { + "name": "tperf-sysbench-memory-block-16k-size-1g-seqrd", + "type": "HIB", + "key": "avg", + "unit": "MiB/s", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 0 + } + } + }, + "tperf-sysbench-memory-block-32k-size-1g-seqrd": { + "status": "PASS", + "duration": 0, + "result": { + "tperf-sysbench-memory-block-32k-size-1g-seqrd": { + "name": "tperf-sysbench-memory-block-32k-size-1g-seqrd", + "type": "HIB", + "key": "avg", + "unit": "MiB/s", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 0 + } + } + }, + "tperf-sysbench-memory-block-32k-size-1g-seqwr": { + "status": "PASS", + "duration": 0, + "result": { + "tperf-sysbench-memory-block-32k-size-1g-seqwr": { + "name": "tperf-sysbench-memory-block-32k-size-1g-seqwr", + "type": "HIB", + "key": "avg", + "unit": "MiB/s", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 0 + } + } + }, + "tperf-sysbench-memory-block-32k-size-1g-rndrd": { + "status": "PASS", + "duration": 0, + "result": { + "tperf-sysbench-memory-block-32k-size-1g-rndrd": { + "name": "tperf-sysbench-memory-block-32k-size-1g-rndrd", + "type": "HIB", + "key": "avg", + "unit": "MiB/s", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 0 + } + } + }, + "tperf-sysbench-memory-block-32k-size-1g-rndwr": { + "status": "PASS", + "duration": 0, + "result": { + "tperf-sysbench-memory-block-32k-size-1g-rndwr": { + "name": "tperf-sysbench-memory-block-32k-size-1g-rndwr", + "type": "HIB", + "key": "avg", + "unit": "MiB/s", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 0 + } + } + }, + "tperf-sysbench-memory-block-64k-size-10g-rndrd": { + "status": "PASS", + "duration": 0, + "result": { + "tperf-sysbench-memory-block-64k-size-10g-rndrd": { + "name": "tperf-sysbench-memory-block-64k-size-10g-rndrd", + "type": "HIB", + "key": "avg", + "unit": "MiB/s", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 0 + } + } + }, + "tperf-sysbench-memory-block-64k-size-10g-rndwr": { + "status": "PASS", + "duration": 0, + "result": { + "tperf-sysbench-memory-block-64k-size-10g-rndwr": { + "name": "tperf-sysbench-memory-block-64k-size-10g-rndwr", + "type": "HIB", + "key": "avg", + "unit": "MiB/s", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 0 + } + } + }, + "tperf-sysbench-memory-block-128k-size-10g-seqrd": { + "status": "PASS", + "duration": 0, + "result": { + "tperf-sysbench-memory-block-128k-size-10g-seqrd": { + "name": "tperf-sysbench-memory-block-128k-size-10g-seqrd", + "type": "HIB", + "key": "avg", + "unit": "MiB/s", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 0 + } + } + }, + "tperf-sysbench-memory-block-128k-size-10g-rndwr": { + "status": "PASS", + "duration": 0, + "result": { + "tperf-sysbench-memory-block-128k-size-10g-rndwr": { + "name": "tperf-sysbench-memory-block-128k-size-10g-rndwr", + "type": "HIB", + "key": "avg", + "unit": "MiB/s", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 0 + } + } + }, + "tperf-sysbench-memory-block-256k-size-10g-rndwr": { + "status": "PASS", + "duration": 0, + "result": { + "tperf-sysbench-memory-block-256k-size-10g-rndwr": { + "name": "tperf-sysbench-memory-block-256k-size-10g-rndwr", + "type": "HIB", + "key": "avg", + "unit": "MiB/s", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 0 + } + } + }, + "tperf-sysbench-memory-block-512k-size-10g-seqwr": { + "status": "PASS", + "duration": 0, + "result": { + "tperf-sysbench-memory-block-512k-size-10g-seqwr": { + "name": "tperf-sysbench-memory-block-512k-size-10g-seqwr", + "type": "HIB", + "key": "avg", + "unit": "MiB/s", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 0 + } + } + }, + "tperf-sysbench-memory-block-512k-size-10g-rndwr": { + "status": "PASS", + "duration": 0, + "result": { + "tperf-sysbench-memory-block-512k-size-10g-rndwr": { + "name": "tperf-sysbench-memory-block-512k-size-10g-rndwr", + "type": "HIB", + "key": "avg", + "unit": "MiB/s", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 0 + } + } + }, + "tperf-sysbench-memory-block-1g-size-10g-rndrd": { + "status": "PASS", + "duration": 0, + "result": { + "tperf-sysbench-memory-block-1g-size-10g-rndrd": { + "name": "tperf-sysbench-memory-block-1g-size-10g-rndrd", + "type": "HIB", + "key": "avg", + "unit": "MiB/s", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 0 + } + } + }, + "tperf-sysbench-memory-block-1g-size-10g-rndwr": { + "status": "PASS", + "duration": 0, + "result": { + "tperf-sysbench-memory-block-1g-size-10g-rndwr": { + "name": "tperf-sysbench-memory-block-1g-size-10g-rndwr", + "type": "HIB", + "key": "avg", + "unit": "MiB/s", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 0 + } + } + }, + "tperf-sysbench-memory-thread-1": { + "status": "PASS", + "duration": 0, + "result": { + "tperf-sysbench-memory-thread-1": { + "name": "tperf-sysbench-memory-thread-1", + "type": "HIB", + "key": "avg", + "unit": "MiB/s", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 0 + } + } + }, + "tperf-mlc-idle-latency": { + "status": "PASS", + "duration": 0, + "result": { + "mlc_idle_latency_result-idle_latency": { + "name": "mlc_idle_latency_result-idle_latency", + "type": "LIB", + "key": "avg", + "unit": "ns", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 50 + } + } + }, + "tperf-mlc-peak-bandwidth": { + "status": "PASS", + "duration": 0, + "result": { + "mlc_peak_injection_bandwidth_result-all_read": { + "name": "mlc_peak_injection_bandwidth_result-all_read", + "type": "HIB", + "key": "avg", + "unit": "MB/s", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 50 + }, + "mlc_peak_injection_bandwidth_result-3:1_read_write": { + "name": "mlc_peak_injection_bandwidth_result-3:1_read_write", + "type": "HIB", + "key": "avg", + "unit": "MB/s", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 50 + }, + "mlc_peak_injection_bandwidth_result-2:1_read_write": { + "name": "mlc_peak_injection_bandwidth_result-2:1_read_write", + "type": "HIB", + "key": "avg", + "unit": "MB/s", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 50 + }, + "mlc_peak_injection_bandwidth_result-1:1_read_write": { + "name": "mlc_peak_injection_bandwidth_result-1:1_read_write", + "type": "HIB", + "key": "avg", + "unit": "MB/s", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 50 + } + } + }, + "tperf-mlc-loaded-latency": { + "status": "PASS", + "duration": 0, + "result": { + "mlc_loaded_latency_result-loaded_latency_min": { + "name": "mlc_loaded_latency_result-loaded_latency_min", + "type": "LIB", + "key": "avg", + "unit": "ns", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 50 + }, + "mlc_loaded_latency_result-loaded_latency_max": { + "name": "mlc_loaded_latency_result-loaded_latency_max", + "type": "LIB", + "key": "avg", + "unit": "ns", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 50 + } + } + }, + "tperf-mlc-latency-matrix": { + "status": "PASS", + "duration": 0, + "result": { + "mlc_latency_matrix_result-samenuma_latency_max": { + "name": "mlc_latency_matrix_result-samenuma_latency_max", + "type": "LIB", + "key": "avg", + "unit": "ns", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 50 + }, + "mlc_latency_matrix_result-samenuma_latency_min": { + "name": "mlc_latency_matrix_result-samenuma_latency_min", + "type": "LIB", + "key": "avg", + "unit": "ns", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 50 + }, + "mlc_latency_matrix_result-difnuma_latency_max": { + "name": "mlc_latency_matrix_result-difnuma_latency_max", + "type": "LIB", + "key": "avg", + "unit": "ns", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 50 + }, + "mlc_latency_matrix_result-difnuma_latency_min": { + "name": "mlc_latency_matrix_result-difnuma_latency_min", + "type": "LIB", + "key": "avg", + "unit": "ns", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 50 + } + } + }, + "tperf-mlc-bandwidth-matrix": { + "status": "PASS", + "duration": 0, + "result": { + "mlc_bandwidth_matrix_result-samenuma_bandwidth_max": { + "name": "mlc_bandwidth_matrix_result-samenuma_bandwidth_max", + "type": "HIB", + "key": "avg", + "unit": "MB/s", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 50 + }, + "mlc_bandwidth_matrix_result-samenuma_bandwidth_min": { + "name": "mlc_bandwidth_matrix_result-samenuma_bandwidth_min", + "type": "HIB", + "key": "avg", + "unit": "MB/s", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 50 + }, + "mlc_bandwidth_matrix_result-difnuma_bandwidth_max": { + "name": "mlc_bandwidth_matrix_result-difnuma_bandwidth_max", + "type": "HIB", + "key": "avg", + "unit": "MB/s", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 50 + }, + "mlc_bandwidth_matrix_result-difnuma_bandwidth_min": { + "name": "mlc_bandwidth_matrix_result-difnuma_bandwidth_min", + "type": "HIB", + "key": "avg", + "unit": "MB/s", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 50 + } + } + }, + "tperf-lmbench-lat_mem_rd-prefetch-on": { + "status": "PASS", + "duration": 125.721, + "result": { + "tperf-lmbench-lat_mem_rd-prefetch-on-l1_latency": { + "name": "tperf-lmbench-lat_mem_rd-prefetch-on-l1_latency", + "type": "LIB", + "key": "avg", + "unit": "ns", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0.0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 50.0 + }, + "tperf-lmbench-lat_mem_rd-prefetch-on-l2_latency": { + "name": "tperf-lmbench-lat_mem_rd-prefetch-on-l2_latency", + "type": "LIB", + "key": "avg", + "unit": "ns", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0.0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 50.0 + }, + "tperf-lmbench-lat_mem_rd-prefetch-on-l3_latency": { + "name": "tperf-lmbench-lat_mem_rd-prefetch-on-l3_latency", + "type": "LIB", + "key": "avg", + "unit": "ns", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0.0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 50.0 + }, + "tperf-lmbench-lat_mem_rd-prefetch-on-mem_latency": { + "name": "tperf-lmbench-lat_mem_rd-prefetch-on-mem_latency", + "type": "LIB", + "key": "avg", + "unit": "ns", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0.0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 50.0 + } + } + }, + "tperf-lmbench-lat_mem_rd-prefetch-off": { + "status": "PASS", + "duration": 129.739, + "result": { + "tperf-lmbench-lat_mem_rd-prefetch-off-l1_latency": { + "name": "tperf-lmbench-lat_mem_rd-prefetch-off-l1_latency", + "type": "LIB", + "key": "avg", + "unit": "ns", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0.0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 50.0 + }, + "tperf-lmbench-lat_mem_rd-prefetch-off-l2_latency": { + "name": "tperf-lmbench-lat_mem_rd-prefetch-off-l2_latency", + "type": "LIB", + "key": "avg", + "unit": "ns", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0.0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 50.0 + }, + "tperf-lmbench-lat_mem_rd-prefetch-off-l3_latency": { + "name": "tperf-lmbench-lat_mem_rd-prefetch-off-l3_latency", + "type": "LIB", + "key": "avg", + "unit": "ns", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0.0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 50.0 + }, + "tperf-lmbench-lat_mem_rd-prefetch-off-mem_latency": { + "name": "tperf-lmbench-lat_mem_rd-prefetch-off-mem_latency", + "type": "LIB", + "key": "avg", + "unit": "ns", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0.0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 50.0 + } + } + }, + "tperf-libmicro-memcpy_1k": { + "status": "PASS", + "duration": 1, + "result": { + "tperf-libmicro-memcpy_1k": { + "name": "tperf-libmicro-memcpy_1k", + "type": "LIB", + "key": "avg", + "unit": "usecs/call", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 50 + } + } + }, + "tperf-libmicro-memcpy_100k": { + "status": "PASS", + "duration": 1, + "result": { + "tperf-libmicro-memcpy_100k": { + "name": "tperf-libmicro-memcpy_100k", + "type": "LIB", + "key": "avg", + "unit": "usecs/call", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 50 + } + } + }, + "tperf-libmicro-memset_10k": { + "status": "PASS", + "duration": 1, + "result": { + "tperf-libmicro-memset_10k": { + "name": "tperf-libmicro-memset_10k", + "type": "LIB", + "key": "avg", + "unit": "usecs/call", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 50 + } + } + }, + "tperf-libmicro-memset_100k": { + "status": "PASS", + "duration": 1, + "result": { + "tperf-libmicro-memset_100k": { + "name": "tperf-libmicro-memset_100k", + "type": "LIB", + "key": "avg", + "unit": "usecs/call", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 50 + } + } + }, + "tperf-libmicro-malloc_1k": { + "status": "PASS", + "duration": 1, + "result": { + "tperf-libmicro-malloc_1k": { + "name": "tperf-libmicro-malloc_1k", + "type": "LIB", + "key": "avg", + "unit": "usecs/call", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 30 + } + } + }, + "tperf-libmicro-malloc_1m": { + "status": "PASS", + "duration": 1, + "result": { + "tperf-libmicro-malloc_1m": { + "name": "tperf-libmicro-malloc_1m", + "type": "LIB", + "key": "avg", + "unit": "usecs/call", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 30 + } + } + }, + "tperf-lmbench-bw_mem-fwr": { + "status": "PASS", + "duration": 1, + "result": { + "tperf-lmbench-bw_mem-fwr": { + "name": "tperf-lmbench-bw_mem-fwr", + "type": "HIB", + "key": "avg", + "unit": "MB/s", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 50 + } + } + }, + "tperf-lmbench-bw_mem-cp": { + "status": "PASS", + "duration": 1, + "result": { + "tperf-lmbench-bw_mem-cp": { + "name": "tperf-lmbench-bw_mem-cp", + "type": "HIB", + "key": "avg", + "unit": "MB/s", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 50 + } + } + }, + "tperf-lmbench-bw_mem-fcp": { + "status": "PASS", + "duration": 1, + "result": { + "tperf-lmbench-bw_mem-fcp": { + "name": "tperf-lmbench-bw_mem-fcp", + "type": "HIB", + "key": "avg", + "unit": "MB/s", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 50 + } + } + }, + "tperf-lmbench-bw_mem-bcopy": { + "status": "PASS", + "duration": 1, + "result": { + "tperf-lmbench-bw_mem-bcopy": { + "name": "tperf-lmbench-bw_mem-bcopy", + "type": "HIB", + "key": "avg", + "unit": "MB/s", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 50 + } + } + }, + "tperf-stream-thread-4": { + "status": "PASS", + "duration": 1, + "result": { + "stream-thread-4-Add": { + "name": "stream-thread-4-Add", + "type": "HIB", + "key": "avg", + "unit": "MB/s", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 50 + }, + "stream-thread-4-Copy": { + "name": "stream-thread-4-Copy", + "type": "HIB", + "key": "avg", + "unit": "MB/s", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 50 + }, + "stream-thread-4-Scale": { + "name": "stream-thread-4-Scale", + "type": "HIB", + "key": "avg", + "unit": "MB/s", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 50 + }, + "stream-thread-4-Triad": { + "name": "stream-thread-4-Triad", + "type": "HIB", + "key": "avg", + "unit": "MB/s", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 50 + } + } + }, + "tperf-stream-thread-8": { + "status": "PASS", + "duration": 1, + "result": { + "stream-thread-8-Add": { + "name": "stream-thread-8-Add", + "type": "HIB", + "key": "avg", + "unit": "MB/s", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 50 + }, + "stream-thread-8-Copy": { + "name": "stream-thread-8-Copy", + "type": "HIB", + "key": "avg", + "unit": "MB/s", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 50 + }, + "stream-thread-8-Scale": { + "name": "stream-thread-8-Scale", + "type": "HIB", + "key": "avg", + "unit": "MB/s", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 50 + }, + "stream-thread-8-Triad": { + "name": "stream-thread-8-Triad", + "type": "HIB", + "key": "avg", + "unit": "MB/s", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 50 + } + } + }, + "tperf-stream-thread-16": { + "status": "PASS", + "duration": 1, + "result": { + "stream-thread-16-Add": { + "name": "stream-thread-16-Add", + "type": "HIB", + "key": "avg", + "unit": "MB/s", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 50 + }, + "stream-thread-16-Copy": { + "name": "stream-thread-16-Copy", + "type": "HIB", + "key": "avg", + "unit": "MB/s", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 50 + }, + "stream-thread-16-Scale": { + "name": "stream-thread-16-Scale", + "type": "HIB", + "key": "avg", + "unit": "MB/s", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 50 + }, + "stream-thread-16-Triad": { + "name": "stream-thread-16-Triad", + "type": "HIB", + "key": "avg", + "unit": "MB/s", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 50 + } + } + }, + "tperf-stream-thread-32": { + "status": "PASS", + "duration": 1, + "result": { + "stream-thread-32-Add": { + "name": "stream-thread-32-Add", + "type": "HIB", + "key": "avg", + "unit": "MB/s", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 50 + }, + "stream-thread-32-Copy": { + "name": "stream-thread-32-Copy", + "type": "HIB", + "key": "avg", + "unit": "MB/s", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 50 + }, + "stream-thread-32-Scale": { + "name": "stream-thread-32-Scale", + "type": "HIB", + "key": "avg", + "unit": "MB/s", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 50 + }, + "stream-thread-32-Triad": { + "name": "stream-thread-32-Triad", + "type": "HIB", + "key": "avg", + "unit": "MB/s", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 50 + } + } + }, + "tperf-libmicro-strcpy_1k": { + "status": "PASS", + "duration": 1, + "result": { + "tperf-libmicro-strcpy_1k": { + "name": "tperf-libmicro-strcpy_1k", + "type": "LIB", + "key": "avg", + "unit": "usecs/call", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 80 + } + } + }, + "tperf-libmicro-strchr_10": { + "status": "PASS", + "duration": 1, + "result": { + "tperf-libmicro-strchr_10": { + "name": "tperf-libmicro-strchr_10", + "type": "LIB", + "key": "avg", + "unit": "usecs/call", + "label": "L0:内存", + "value": 1, + "statistics": { + "max": 1, + "min": 1, + "avg": 1, + "mid": 1, + "sd": 0 + }, + "L0": "内存", + "L1": "", + "L2": "", + "weight": 80 + } + } } } \ No newline at end of file diff --git a/lib/ts_common.py b/lib/ts_common.py index e893356c0a0497dbf968e782237475db978be161..152c74f46cbf2275a8128ff3abff0bb21ba6832b 100644 --- a/lib/ts_common.py +++ b/lib/ts_common.py @@ -2,6 +2,7 @@ # coding: utf-8 # Desc: 测试套公共模块 import abc +import bisect import json import multiprocessing import os.path @@ -14,6 +15,7 @@ import subprocess import sys import time from typing import Union +import numpy as np tperf_top_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.append(tperf_top_dir) @@ -686,6 +688,412 @@ class PerfStream(TSTPerf): return result +class PerfMLC(TSTPerf): + """Intel Memory Latency Checker (MLC) 性能测试工具适配类 + + MLC 支持以下测试模式: + - idle_latency: 空闲内存延迟 + - loaded_latency: 负载内存延迟 + - peak_injection_bandwidth: 峰值注入带宽 + - latency_matrix: 延迟矩阵(跨NUMA节点) + - bandwidth_matrix: 带宽矩阵(跨NUMA节点) + """ + + # 支持的测试模式 + SUPPORTED_MODES = [ + "idle_latency", + "loaded_latency", + "peak_injection_bandwidth", + "latency_matrix", + "bandwidth_matrix", + ] + + def __init__( + self, + name: str, + test_mode: str = "", + label: str = "", + general_opt: str = "", + ): + """初始化 MLC 测试 + + Args: + name: 测试名称 + test_mode: 测试模式,支持 idle_latency, loaded_latency, peak_injection_bandwidth, + latency_matrix, bandwidth_matrix + label: 标签 + general_opt: 额外的命令行参数 + """ + super().__init__() + self.name = name + self.label = label + self.test_mode = test_mode + self.general_opt = general_opt + + if test_mode not in self.SUPPORTED_MODES: + raise ValueError( + f"不支持的测试模式: {test_mode},支持的模式: {self.SUPPORTED_MODES}" + ) + + self.mlc = os.path.join(tperf_top_dir, "tools/mlc.install/mlc") + self.command = f"{self.mlc} --{test_mode} {general_opt if general_opt else ''}" + self.outs = "" + self.errs = "" + + def prepare(self): + """prepare before run testcase""" + if not os.path.isfile(self.mlc): + fail_dir = os.path.join(tperf_top_dir, "tools/mlc.install.fail") + if os.path.isdir(fail_dir): + raise FileNotFoundError(f"mlc may compile fail: {fail_dir}") + self.log("compile mlc") + command(cmd=f"{os.path.join(tperf_top_dir, 'tools/mlc/tst-build.sh')}") + if not os.path.isfile(self.mlc): + raise FileNotFoundError(f"mlc tool compile fail: {self.mlc}") + + def benchmark(self): + """执行性能测试""" + self.log(f"COMMAND: {self.command}") + proc = subprocess.Popen( + self.command, + shell=True, + encoding="utf-8", + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + ) + self.outs, self.errs = proc.communicate() + self.log(f"outs: {self.outs}") + self.log(f"errs: {self.errs}") + + def parse_test_data(self) -> Union[list, PerfData]: + """执行benchmark性能测试后,对测试结果进行解析,返回 PerfData 或其 list 性能测试结果""" + if not self.outs: + raise Exception("test output is empty") + + if self.test_mode == "idle_latency": + return self._parse_idle_latency() + elif self.test_mode == "loaded_latency": + return self._parse_loaded_latency() + elif self.test_mode == "peak_injection_bandwidth": + return self._parse_peak_injection_bandwidth() + elif self.test_mode == "latency_matrix": + return self._parse_latency_matrix() + elif self.test_mode == "bandwidth_matrix": + return self._parse_bandwidth_matrix() + else: + raise Exception(f"unknown test mode {self.test_mode}") + + def _parse_idle_latency(self) -> PerfData: + """解析 idle_latency 测试结果 + 输出格式示例: + Each iteration took 256.5 base frequency clocks ( 128.2 ns) + + 输出指标: + --idle_latency: 内存空闲延迟 (80.3ns) + """ + result = PerfData( + name="mlc_idle_latency_result-idle_latency", + value_type=ValueType.LIB, # 延迟越低越好 + key_item=KeyItem.avg, + unit="ns", + label=self.label, + ) + for line in self.outs.splitlines(): + if "Each iteration took" in line and "ns)" in line: + # 提取延迟值 (ns) + match = re.search(r"\(\s*([\d.]+)\s*ns\)", line) + if match: + latency = float(match.group(1)) + result.set_key_value(value=latency) + break + return result + + def _parse_loaded_latency(self) -> list: + """解析 loaded_latency 测试结果 + 输出格式示例: + Inject Latency Bandwidth + Delay (ns) MB/sec + ========================== + 00000 982.13 54708.4 + + 输出指标: + --loaded_latency_min: 注入延迟最小值 + --loaded_latency_max: 注入延迟最大值 + """ + result_list = [] + # 返回最低延迟和最高延迟 + min_latency = float("inf") + max_latency = 0 + + in_data_section = False + for line in self.outs.splitlines(): + if "====" in line: + in_data_section = True + continue + if in_data_section and line.strip(): + parts = line.split() + if len(parts) >= 3: + try: + latency = float(parts[1]) + if latency < min_latency: + min_latency = latency + if latency > max_latency: + max_latency = latency + except (ValueError, IndexError): + continue + + # 最低延迟结果 + result_min_lat = PerfData( + name="mlc_loaded_latency_result-loaded_latency_min", + value_type=ValueType.LIB, + key_item=KeyItem.avg, + unit="ns", + label=self.label, + ) + result_min_lat.set_key_value(value=min_latency if min_latency != float("inf") else 0) + result_list.append(result_min_lat) + + # 最高延迟结果 + result_max_lat = PerfData( + name="mlc_loaded_latency_result-loaded_latency_max", + value_type=ValueType.LIB, + key_item=KeyItem.avg, + unit="ns", + label=self.label, + ) + result_max_lat.set_key_value(value=max_latency) + result_list.append(result_max_lat) + + return result_list + + def _parse_peak_injection_bandwidth(self) -> list: + """解析 peak_injection_bandwidth 测试结果 + 输出格式示例: + ALL Reads : 56361.9 + 3:1 Reads-Writes : 54526.2 + + 输出指标: + --all_read: 峰值内存带宽测试——全读 + --3:1_read_write: 峰值内存带宽测试——读写3:1 + --2:1_read_write: 峰值内存带宽测试——读写2:1 + --1:1_read_write: 峰值内存带宽测试——读写1:1 + """ + result_list = [] + bandwidth_types = { + "ALL Reads": "all_read", + "3:1 Reads-Writes": "3:1_read_write", + "2:1 Reads-Writes": "2:1_read_write", + "1:1 Reads-Writes": "1:1_read_write", + } + + for line in self.outs.splitlines(): + for pattern, suffix in bandwidth_types.items(): + if pattern in line and ":" in line: + parts = line.split(":") + if len(parts) >= 2: + try: + bandwidth = float(parts[-1].strip()) + result = PerfData( + name=f"mlc_peak_injection_bandwidth_result-{suffix}", + value_type=ValueType.HIB, + key_item=KeyItem.avg, + unit="MB/s", + label=self.label, + ) + result.set_key_value(value=bandwidth) + result_list.append(result) + except ValueError: + continue + break + + if not result_list: + raise Exception("Failed to parse peak_injection_bandwidth results") + + return result_list + + def _parse_latency_matrix(self) -> list: + """解析 latency_matrix 测试结果 + 输出格式示例: + Numa node + Numa node 0 1 + 0 125.9 162.2 + 1 186.3 101.8 + + 输出指标: + --samenuma_latency_max: 同NUMA时延最大值 (80.7) + --samenuma_latency_min: 同NUMA时延最小值 (80.6) + --difnuma_latency_max: 不同NUMA时延最大值 (140.0) + --difnuma_latency_min: 不同NUMA时延最小值 (139.8) + """ + result_list = [] + in_data_section = False + header_found = False + + # 收集同NUMA和不同NUMA的延迟值 + samenuma_latencies = [] + difnuma_latencies = [] + + for line in self.outs.splitlines(): + if "Numa node" in line and not header_found: + header_found = True + continue + if header_found and "Numa node" not in line: + in_data_section = True + if in_data_section and line.strip(): + parts = line.split() + if len(parts) >= 2: + try: + src_node = int(parts[0]) + for dst_idx, value in enumerate(parts[1:]): + latency = float(value) + if src_node == dst_idx: + samenuma_latencies.append(latency) + else: + difnuma_latencies.append(latency) + except (ValueError, IndexError): + continue + + # 同NUMA时延最大值 + if samenuma_latencies: + result = PerfData( + name="mlc_latency_matrix_result-samenuma_latency_max", + value_type=ValueType.LIB, + key_item=KeyItem.avg, + unit="ns", + label=self.label, + ) + result.set_key_value(value=max(samenuma_latencies)) + result_list.append(result) + + result = PerfData( + name="mlc_latency_matrix_result-samenuma_latency_min", + value_type=ValueType.LIB, + key_item=KeyItem.avg, + unit="ns", + label=self.label, + ) + result.set_key_value(value=min(samenuma_latencies)) + result_list.append(result) + + # 不同NUMA时延最大值和最小值 + if difnuma_latencies: + result = PerfData( + name="mlc_latency_matrix_result-difnuma_latency_max", + value_type=ValueType.LIB, + key_item=KeyItem.avg, + unit="ns", + label=self.label, + ) + result.set_key_value(value=max(difnuma_latencies)) + result_list.append(result) + + result = PerfData( + name="mlc_latency_matrix_result-difnuma_latency_min", + value_type=ValueType.LIB, + key_item=KeyItem.avg, + unit="ns", + label=self.label, + ) + result.set_key_value(value=min(difnuma_latencies)) + result_list.append(result) + + if not result_list: + raise Exception("Failed to parse latency_matrix results") + + return result_list + + def _parse_bandwidth_matrix(self) -> list: + """解析 bandwidth_matrix 测试结果 + 输出格式类似 latency_matrix + + 输出指标: + --samenuma_bandwidth_max: 同NUMA带宽最大值 (123556.8) + --samenuma_bandwidth_min: 同NUMA带宽最小值 (123280.2) + --difnuma_bandwidth_max: 不同NUMA带宽最大值 (34261.4) + --difnuma_bandwidth_min: 不同NUMA带宽最小值 (34131.5) + """ + result_list = [] + in_data_section = False + header_found = False + + # 收集同NUMA和不同NUMA的带宽值 + samenuma_bandwidths = [] + difnuma_bandwidths = [] + + for line in self.outs.splitlines(): + if "Numa node" in line and not header_found: + header_found = True + continue + if header_found and "Numa node" not in line: + in_data_section = True + if in_data_section and line.strip(): + parts = line.split() + if len(parts) >= 2: + try: + src_node = int(parts[0]) + for dst_idx, value in enumerate(parts[1:]): + bandwidth = float(value) + if src_node == dst_idx: + samenuma_bandwidths.append(bandwidth) + else: + difnuma_bandwidths.append(bandwidth) + except (ValueError, IndexError): + continue + + # 同NUMA带宽最大值和最小值 + if samenuma_bandwidths: + result = PerfData( + name="mlc_bandwidth_matrix_result-samenuma_bandwidth_max", + value_type=ValueType.HIB, + key_item=KeyItem.avg, + unit="MB/s", + label=self.label, + ) + result.set_key_value(value=max(samenuma_bandwidths)) + result_list.append(result) + + result = PerfData( + name="mlc_bandwidth_matrix_result-samenuma_bandwidth_min", + value_type=ValueType.HIB, + key_item=KeyItem.avg, + unit="MB/s", + label=self.label, + ) + result.set_key_value(value=min(samenuma_bandwidths)) + result_list.append(result) + + # 不同NUMA带宽最大值和最小值 + if difnuma_bandwidths: + result = PerfData( + name="mlc_bandwidth_matrix_result-difnuma_bandwidth_max", + value_type=ValueType.HIB, + key_item=KeyItem.avg, + unit="MB/s", + label=self.label, + ) + result.set_key_value(value=max(difnuma_bandwidths)) + result_list.append(result) + + result = PerfData( + name="mlc_bandwidth_matrix_result-difnuma_bandwidth_min", + value_type=ValueType.HIB, + key_item=KeyItem.avg, + unit="MB/s", + label=self.label, + ) + result.set_key_value(value=min(difnuma_bandwidths)) + result_list.append(result) + + if not result_list: + raise Exception("Failed to parse bandwidth_matrix results") + + return result_list + + def cleanup(self): + """性能测试完成后cleanup""" + pass + + class PerfUnixbench(TSTPerf): def __init__( self, @@ -878,7 +1286,7 @@ class PerfLMbench(TSTPerf): elif self.name == "lat_ctx": result.append(self.parse_result_ctx()) elif self.name == "lat_mem_rd": - result.append(self.parse_result_mem_rd()) + result.extend(self.parse_result_mem_rd()) elif self.name == "lat_fs": result.append(self.parse_result_fs()) elif self.name == "lat_ops": @@ -934,31 +1342,143 @@ class PerfLMbench(TSTPerf): return result def parse_result_mem_rd(self): - result = PerfData( - name=self.testname, - value_type=ValueType.LIB, - key_item=KeyItem.avg, - unit="ns", - label=self.label, - ) + """解析 lat_mem_rd 测试结果 + 输出格式示例: + "stride=128 + 0.00098 1.234 + 0.00195 1.345 + ... + 0.12500 5.678 + ... + 8.00000 89.012 + + 输出指标: + --l1_latency: L1缓存延迟 (约1KB数组大小) + --l2_latency: L2缓存延迟 (约128KB数组大小) + --l3_latency: L3缓存延迟 (约2-8MB数组大小) + --mem_latency: 主内存延迟 (最大数组大小) + """ + # 新版本的完整解析:返回所有缓存级别的延迟 + result_list = [] + # 解析所有数据点 + data_points = [] + size_list = [] + lat_list = [] lines = self.outs.splitlines() - if "l1" in self.testname: - last_line = lines[2] - mean = float(last_line.split()[-1]) - result.set_key_value(value=mean) - return result - elif "l2" in self.testname: - last_line = lines[25] - mean = float(last_line.split()[-1]) - result.set_key_value(value=mean) - return result - else: - last_line = lines[-2] - print(last_line) - mean = float(last_line.split()[-1]) - result.set_key_value(value=mean) - return result + + for line in lines: + line = line.strip() + if not line or line.startswith('"'): + continue + + parts = line.split() + if len(parts) >= 2: + try: + size_mb = float(parts[0]) + latency_ns = float(parts[1]) + data_points.append((size_mb, latency_ns)) + size_list.append(size_mb) + lat_list.append(latency_ns) + except (ValueError, IndexError): + continue + + if not data_points: + # 没有数据点 + return result_list + + # 使用参考代码中的算法:基于实际缓存大小识别缓存级别 + # 获取系统缓存大小信息(如果可用) + cache_range = self._get_cache_sizes() + + # 如果没有获取到缓存大小信息,使用默认的缓存大小估计 + if not cache_range: + # 默认缓存大小估计(MB) + cache_range = [0.032, 1.024, 36.608] # L1: ~32KB, L2: ~1MB, L3: ~36MB + + # 使用二分查找定位缓存边界 + size_list.sort() + lat_list.sort() + + # 查找每个缓存级别对应的索引位置 + index_list = [bisect.bisect_left(size_list, cr) for cr in cache_range] + index_list.insert(0, 0) # 添加起始索引 + index_list.append(len(lat_list)) # 添加结束索引 + + # 计算每个缓存级别的延迟(使用中位数) + result_list_values = [] + for i in range(1, len(index_list)): + sub_list = lat_list[index_list[i - 1]:index_list[i]] + if sub_list: + median_latency = round(np.median(sub_list), 3) + result_list_values.append(median_latency) + else: + result_list_values.append(None) + self.log(f"警告: 缓存级别 {i} 没有数据点") + + # 主内存延迟使用最后一个数据点 + mem_latency = lat_list[-1] if lat_list else None + + # 根据检测到的缓存级别数量分配延迟值 + l1_latency = result_list_values[0] if len(result_list_values) > 0 else None + l2_latency = result_list_values[1] if len(result_list_values) > 1 else None + l3_latency = result_list_values[2] if len(result_list_values) > 2 else None + + # 打印调试信息 + self.log(f"检测到缓存级别: L1={l1_latency}ns, L2={l2_latency}ns, L3={l3_latency}ns, 内存={mem_latency}ns") + + # 创建各级缓存的 PerfData 对象 + if l1_latency is not None: + result = PerfData( + name=f"{self.testname}-l1_latency", + value_type=ValueType.LIB, + key_item=KeyItem.avg, + unit="ns", + label=self.label, + ) + result.set_key_value(value=l1_latency) + result_list.append(result) + + if l2_latency is not None: + result = PerfData( + name=f"{self.testname}-l2_latency", + value_type=ValueType.LIB, + key_item=KeyItem.avg, + unit="ns", + label=self.label, + ) + result.set_key_value(value=l2_latency) + result_list.append(result) + + if l3_latency is not None: + result = PerfData( + name=f"{self.testname}-l3_latency", + value_type=ValueType.LIB, + key_item=KeyItem.avg, + unit="ns", + label=self.label, + ) + result.set_key_value(value=l3_latency) + result_list.append(result) + + if mem_latency is not None: + result = PerfData( + name=f"{self.testname}-mem_latency", + value_type=ValueType.LIB, + key_item=KeyItem.avg, + unit="ns", + label=self.label, + ) + result.set_key_value(value=mem_latency) + result_list.append(result) + + return result_list + + def _get_cache_sizes(self): + """获取系统缓存大小信息""" + # 这里可以扩展为从系统信息获取实际缓存大小 + # 目前返回空列表,使用默认估计值 + return [] def parse_result_bandwidth(self): result = PerfData( diff --git a/templates/tperf.csv b/templates/tperf.csv index de668ebbbd2d34427d288fa59759f0f719fc1030..a229c926f159ced75d59621345f870228d2614da 100644 --- a/templates/tperf.csv +++ b/templates/tperf.csv @@ -1011,3 +1011,81 @@ tperf-qperf-udp-len-60000-bw,tperf-qperf-udp-len-60000-bw-udp_bw,网络,,,40 tperf-qperf-udp-len-60000-lat,tperf-qperf-udp-len-60000-lat-udp_lat,网络,,,40 tperf-qperf-udp-len-64-bw,tperf-qperf-udp-len-64-bw-udp_bw,网络,,,40 tperf-qperf-udp-len-64-lat,tperf-qperf-udp-len-64-lat-udp_lat,网络,,,40 +tperf-sysbench-memory-thread-1,tperf-sysbench-memory-thread-1,内存,,,50 +tperf-sysbench-memory-thread-max,tperf-sysbench-memory-thread-max,内存,,,50 +tperf-sysbench-memory-block-1k-size-1g-seqrd,tperf-sysbench-memory-block-1k-size-1g-seqrd,内存,,,30 +tperf-sysbench-memory-block-2k-size-1g-seqrd,tperf-sysbench-memory-block-2k-size-1g-seqrd,内存,,,30 +tperf-sysbench-memory-block-4k-size-1g-seqrd,tperf-sysbench-memory-block-4k-size-1g-seqrd,内存,,,30 +tperf-sysbench-memory-block-16k-size-1g-seqrd,tperf-sysbench-memory-block-16k-size-1g-seqrd,内存,,,30 +tperf-sysbench-memory-block-32k-size-1g-seqrd,tperf-sysbench-memory-block-32k-size-1g-seqrd,内存,,,40 +tperf-sysbench-memory-block-32k-size-1g-seqwr,tperf-sysbench-memory-block-32k-size-1g-seqwr,内存,,,40 +tperf-sysbench-memory-block-32k-size-1g-rndrd,tperf-sysbench-memory-block-32k-size-1g-rndrd,内存,,,40 +tperf-sysbench-memory-block-32k-size-1g-rndwr,tperf-sysbench-memory-block-32k-size-1g-rndwr,内存,,,40 +tperf-sysbench-memory-block-64k-size-10g-rndrd,tperf-sysbench-memory-block-64k-size-10g-rndrd,内存,,,40 +tperf-sysbench-memory-block-64k-size-10g-rndwr,tperf-sysbench-memory-block-64k-size-10g-rndwr,内存,,,40 +tperf-sysbench-memory-block-128k-size-10g-seqrd,tperf-sysbench-memory-block-128k-size-10g-seqrd,内存,,,40 +tperf-sysbench-memory-block-128k-size-10g-rndwr,tperf-sysbench-memory-block-128k-size-10g-rndwr,内存,,,40 +tperf-sysbench-memory-block-256k-size-10g-rndwr,tperf-sysbench-memory-block-256k-size-10g-rndwr,内存,,,40 +tperf-sysbench-memory-block-512k-size-10g-seqwr,tperf-sysbench-memory-block-512k-size-10g-seqwr,内存,,,40 +tperf-sysbench-memory-block-512k-size-10g-rndwr,tperf-sysbench-memory-block-512k-size-10g-rndwr,内存,,,40 +tperf-sysbench-memory-block-1g-size-10g-rndrd,tperf-sysbench-memory-block-1g-size-10g-rndrd,内存,,,50 +tperf-sysbench-memory-block-1g-size-10g-rndwr,tperf-sysbench-memory-block-1g-size-10g-rndwr,内存,,,50 +tperf-stream-single,stream-single-thread-Add,内存,,,50 +,stream-single-thread-Copy,内存,,,50 +,stream-single-thread-Scale,内存,,,50 +,stream-single-thread-Triad,内存,,,50 +tperf-stream-max,stream-max-thread-Add,内存,,,50 +,stream-max-thread-Copy,内存,,,50 +,stream-max-thread-Scale,内存,,,50 +,stream-max-thread-Triad,内存,,,50 +tperf-lmbench-lat_mem_rd-prefetch-on,tperf-lmbench-lat_mem_rd-prefetch-on-l1_latency,内存,,,50 +,tperf-lmbench-lat_mem_rd-prefetch-on-l2_latency,内存,,,50 +,tperf-lmbench-lat_mem_rd-prefetch-on-l3_latency,内存,,,50 +,tperf-lmbench-lat_mem_rd-prefetch-on-mem_latency,内存,,,50 +tperf-lmbench-lat_mem_rd-prefetch-off,tperf-lmbench-lat_mem_rd-prefetch-off-l1_latency,内存,,,50 +,tperf-lmbench-lat_mem_rd-prefetch-off-l2_latency,内存,,,50 +,tperf-lmbench-lat_mem_rd-prefetch-off-l3_latency,内存,,,50 +,tperf-lmbench-lat_mem_rd-prefetch-off-mem_latency,内存,,,50 +tperf-mlc-idle-latency,mlc_idle_latency_result-idle_latency,内存,,,50 +tperf-mlc-peak-bandwidth,mlc_peak_injection_bandwidth_result-all_read,内存,,,50 +,mlc_peak_injection_bandwidth_result-3:1_read_write,内存,,,50 +,mlc_peak_injection_bandwidth_result-2:1_read_write,内存,,,50 +,mlc_peak_injection_bandwidth_result-1:1_read_write,内存,,,50 +tperf-mlc-loaded-latency,mlc_loaded_latency_result-loaded_latency_min,内存,,,50 +,mlc_loaded_latency_result-loaded_latency_max,内存,,,50 +tperf-mlc-bandwidth-matrix,mlc_bandwidth_matrix_result-samenuma_bandwidth_max,内存,,,50 +,mlc_bandwidth_matrix_result-samenuma_bandwidth_min,内存,,,50 +,mlc_bandwidth_matrix_result-difnuma_bandwidth_max,内存,,,50 +,mlc_bandwidth_matrix_result-difnuma_bandwidth_min,内存,,,50 +tperf-libmicro-memcpy_1k,tperf-libmicro-memcpy_1k,内存,,,50 +tperf-libmicro-memcpy_100k,tperf-libmicro-memcpy_100k,内存,,,50 +tperf-libmicro-memset_10k,tperf-libmicro-memset_10k,内存,,,50 +tperf-libmicro-memset_100k,tperf-libmicro-memset_100k,内存,,,50 +tperf-libmicro-malloc_1k,tperf-libmicro-malloc_1k,内存,,,30 +tperf-libmicro-malloc_1m,tperf-libmicro-malloc_1m,内存,,,30 +tperf-lmbench-bw_mem-fwr,tperf-lmbench-bw_mem-fwr,内存,,,50 +tperf-lmbench-bw_mem-cp,tperf-lmbench-bw_mem-cp,内存,,,50 +tperf-lmbench-bw_mem-fcp,tperf-lmbench-bw_mem-fcp,内存,,,50 +tperf-lmbench-bw_mem-bcopy,tperf-lmbench-bw_mem-bcopy,内存,,,50 +tperf-stream-thread-4,stream-thread-4-Add,内存,,,50 +,stream-thread-4-Copy,内存,,,50 +,stream-thread-4-Scale,内存,,,50 +,stream-thread-4-Triad,内存,,,50 +tperf-stream-thread-8,stream-thread-8-Add,内存,,,50 +,stream-thread-8-Copy,内存,,,50 +,stream-thread-8-Scale,内存,,,50 +,stream-thread-8-Triad,内存,,,50 +tperf-stream-thread-16,stream-thread-16-Add,内存,,,50 +,stream-thread-16-Copy,内存,,,50 +,stream-thread-16-Scale,内存,,,50 +,stream-thread-16-Triad,内存,,,50 +tperf-stream-thread-32,stream-thread-32-Add,内存,,,50 +,stream-thread-32-Copy,内存,,,50 +,stream-thread-32-Scale,内存,,,50 +,stream-thread-32-Triad,内存,,,50 +tperf-mlc-latency-matrix,mlc_latency_matrix_result-samenuma_latency_min,内存,,,50 +,mlc_latency_matrix_result-samenuma_latency_max,内存,,,50 +,mlc_latency_matrix_result-difnuma_latency_min,内存,,,50 +,mlc_latency_matrix_result-difnuma_latency_max,内存,,,50 +tperf-libmicro-strcpy_1k,tperf-libmicro-strcpy_1k,内存,,,80 +tperf-libmicro-strchr_10,tperf-libmicro-strchr_10,内存,,,80 diff --git a/testcase/tperf-libmicro-malloc_1k.py b/testcase/tperf-libmicro-malloc_1k.py new file mode 100755 index 0000000000000000000000000000000000000000..77c77c7e3275a92cc13e179b7db173beb57c0c3d --- /dev/null +++ b/testcase/tperf-libmicro-malloc_1k.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python3 +# coding: utf-8 + +import os.path +import stat +import sys + +_suite_top_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..") +while _suite_top_dir != "/": + if os.path.isfile(os.path.join(_suite_top_dir, "tsuite")): + break + _suite_top_dir = os.path.dirname(_suite_top_dir) +sys.path.append(_suite_top_dir) +from lib.ts_common import MyTestCase, PerfLibMicro # noqa: E402 + + +class PythonTestCase(MyTestCase): + """ + @用例ID: 20251223-170001-000000105 + @用例名称: tperf-libmicro-malloc_1k + @用例级别: 3 + @用例标签: + @扩展属性: + @用例类型: 性能测试 + @自动化: 1 + @超时时间: 0 + @用例描述: 使用libmicro测试系统性能 + """ + + def tc_setup(self, *args): + self.msg("this is tc_setup") + + # @预置条件: 系统启动 + + def do_test(self, *args): + self.msg("this is do_test") + + # @测试步骤: 使用使用libmicro测试系统性能 + # @预期结果: 测试正常,性能数据采集正常 + perf = PerfLibMicro( + name=self.tc_name, + label="L0:内存", + test_opt="-E -C 2000 -L -S -W -N malloc_1k -s 1k -g 10 -I 100 -B 100", + tool_path="tools/libmicro.install/build/malloc" + ) + perf.run(warmup=1, run_loop=20, result_select_percent=80) + perf.report(testcase=self) + self.assert_true(len(perf.results) > 0) + + def tc_teardown(self, *args): + self.msg("this is tc_teardown") + + +if __name__ == "__main__": + PythonTestCase().tst_main(sys.argv) diff --git a/testcase/tperf-libmicro-malloc_1m.py b/testcase/tperf-libmicro-malloc_1m.py new file mode 100755 index 0000000000000000000000000000000000000000..84cce534efe2416f054327e67e7354bd25cf195a --- /dev/null +++ b/testcase/tperf-libmicro-malloc_1m.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python3 +# coding: utf-8 + +import os.path +import stat +import sys + +_suite_top_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..") +while _suite_top_dir != "/": + if os.path.isfile(os.path.join(_suite_top_dir, "tsuite")): + break + _suite_top_dir = os.path.dirname(_suite_top_dir) +sys.path.append(_suite_top_dir) +from lib.ts_common import MyTestCase, PerfLibMicro # noqa: E402 + + +class PythonTestCase(MyTestCase): + """ + @用例ID: 20251223-170001-000000106 + @用例名称: tperf-libmicro-malloc_1m + @用例级别: 3 + @用例标签: + @扩展属性: + @用例类型: 性能测试 + @自动化: 1 + @超时时间: 0 + @用例描述: 使用libmicro测试系统性能 + """ + + def tc_setup(self, *args): + self.msg("this is tc_setup") + + # @预置条件: 系统启动 + + def do_test(self, *args): + self.msg("this is do_test") + + # @测试步骤: 使用使用libmicro测试系统性能 + # @预期结果: 测试正常,性能数据采集正常 + perf = PerfLibMicro( + name=self.tc_name, + label="L0:内存", + test_opt="-E -C 2000 -L -S -W -N malloc_1m -s 1m -g 10 -I 2000 -B 100", + tool_path="tools/libmicro.install/build/malloc" + ) + perf.run(warmup=1, run_loop=20, result_select_percent=80) + perf.report(testcase=self) + self.assert_true(len(perf.results) > 0) + + def tc_teardown(self, *args): + self.msg("this is tc_teardown") + + +if __name__ == "__main__": + PythonTestCase().tst_main(sys.argv) diff --git a/testcase/tperf-libmicro-memcpy_100k.py b/testcase/tperf-libmicro-memcpy_100k.py new file mode 100755 index 0000000000000000000000000000000000000000..dd05da10b28add6b868d3e540f274f1f2011ac13 --- /dev/null +++ b/testcase/tperf-libmicro-memcpy_100k.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python3 +# coding: utf-8 + +import os.path +import stat +import sys + +_suite_top_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..") +while _suite_top_dir != "/": + if os.path.isfile(os.path.join(_suite_top_dir, "tsuite")): + break + _suite_top_dir = os.path.dirname(_suite_top_dir) +sys.path.append(_suite_top_dir) +from lib.ts_common import MyTestCase, PerfLibMicro # noqa: E402 + + +class PythonTestCase(MyTestCase): + """ + @用例ID: 20251223-170001-000000101 + @用例名称: tperf-libmicro-memcpy_100k + @用例级别: 3 + @用例标签: + @扩展属性: + @用例类型: 性能测试 + @自动化: 1 + @超时时间: 0 + @用例描述: 使用libmicro测试系统性能 + """ + + def tc_setup(self, *args): + self.msg("this is tc_setup") + + # @预置条件: 系统启动 + + def do_test(self, *args): + self.msg("this is do_test") + + # @测试步骤: 使用使用libmicro测试系统性能 + # @预期结果: 测试正常,性能数据采集正常 + perf = PerfLibMicro( + name=self.tc_name, + label="L0:内存", + test_opt="-E -C 2000 -L -S -W -N memcpy_100k -s 100k -I 1000 -B 100", + tool_path="tools/libmicro.install/build/memcpy" + ) + perf.run(warmup=1, run_loop=20, result_select_percent=80) + perf.report(testcase=self) + self.assert_true(len(perf.results) > 0) + + def tc_teardown(self, *args): + self.msg("this is tc_teardown") + + +if __name__ == "__main__": + PythonTestCase().tst_main(sys.argv) diff --git a/testcase/tperf-libmicro-memcpy_1k.py b/testcase/tperf-libmicro-memcpy_1k.py new file mode 100755 index 0000000000000000000000000000000000000000..c556c1c9c1c80b2ccf4e78eb49fedc0c4b659c3c --- /dev/null +++ b/testcase/tperf-libmicro-memcpy_1k.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python3 +# coding: utf-8 + +import os.path +import stat +import sys + +_suite_top_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..") +while _suite_top_dir != "/": + if os.path.isfile(os.path.join(_suite_top_dir, "tsuite")): + break + _suite_top_dir = os.path.dirname(_suite_top_dir) +sys.path.append(_suite_top_dir) +from lib.ts_common import MyTestCase, PerfLibMicro # noqa: E402 + + +class PythonTestCase(MyTestCase): + """ + @用例ID: 20251223-170001-000000102 + @用例名称: tperf-libmicro-memcpy_1k + @用例级别: 3 + @用例标签: + @扩展属性: + @用例类型: 性能测试 + @自动化: 1 + @超时时间: 0 + @用例描述: 使用libmicro测试系统性能 + """ + + def tc_setup(self, *args): + self.msg("this is tc_setup") + + # @预置条件: 系统启动 + + def do_test(self, *args): + self.msg("this is do_test") + + # @测试步骤: 使用使用libmicro测试系统性能 + # @预期结果: 测试正常,性能数据采集正常 + perf = PerfLibMicro( + name=self.tc_name, + label="L0:内存", + test_opt="-E -C 2000 -L -S -W -N memcpy_1k -s 1k -I 500 -B 100", + tool_path="tools/libmicro.install/build/memcpy" + ) + perf.run(warmup=1, run_loop=20, result_select_percent=80) + perf.report(testcase=self) + self.assert_true(len(perf.results) > 0) + + def tc_teardown(self, *args): + self.msg("this is tc_teardown") + + +if __name__ == "__main__": + PythonTestCase().tst_main(sys.argv) diff --git a/testcase/tperf-libmicro-memset_100k.py b/testcase/tperf-libmicro-memset_100k.py new file mode 100755 index 0000000000000000000000000000000000000000..6452b05d0491ce731495986c6a91c80aded13909 --- /dev/null +++ b/testcase/tperf-libmicro-memset_100k.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python3 +# coding: utf-8 + +import os.path +import stat +import sys + +_suite_top_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..") +while _suite_top_dir != "/": + if os.path.isfile(os.path.join(_suite_top_dir, "tsuite")): + break + _suite_top_dir = os.path.dirname(_suite_top_dir) +sys.path.append(_suite_top_dir) +from lib.ts_common import MyTestCase, PerfLibMicro # noqa: E402 + + +class PythonTestCase(MyTestCase): + """ + @用例ID: 20251223-170001-000000104 + @用例名称: tperf-libmicro-memset_100k + @用例级别: 3 + @用例标签: + @扩展属性: + @用例类型: 性能测试 + @自动化: 1 + @超时时间: 0 + @用例描述: 使用libmicro测试系统性能 + """ + + def tc_setup(self, *args): + self.msg("this is tc_setup") + + # @预置条件: 系统启动 + + def do_test(self, *args): + self.msg("this is do_test") + + # @测试步骤: 使用使用libmicro测试系统性能 + # @预期结果: 测试正常,性能数据采集正常 + perf = PerfLibMicro( + name=self.tc_name, + label="L0:内存", + test_opt="-E -C 2000 -L -S -W -N memset_100k -s 100k -I 1000 -B 100", + tool_path="tools/libmicro.install/build/memset", + ) + perf.run(warmup=1, run_loop=20, result_select_percent=80) + perf.report(testcase=self) + self.assert_true(len(perf.results) > 0) + + def tc_teardown(self, *args): + self.msg("this is tc_teardown") + + +if __name__ == "__main__": + PythonTestCase().tst_main(sys.argv) diff --git a/testcase/tperf-libmicro-memset_10k.py b/testcase/tperf-libmicro-memset_10k.py new file mode 100755 index 0000000000000000000000000000000000000000..64c3c266842cff0e421f9901c90e75638af9e16a --- /dev/null +++ b/testcase/tperf-libmicro-memset_10k.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python3 +# coding: utf-8 + +import os.path +import stat +import sys + +_suite_top_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..") +while _suite_top_dir != "/": + if os.path.isfile(os.path.join(_suite_top_dir, "tsuite")): + break + _suite_top_dir = os.path.dirname(_suite_top_dir) +sys.path.append(_suite_top_dir) +from lib.ts_common import MyTestCase, PerfLibMicro # noqa: E402 + + +class PythonTestCase(MyTestCase): + """ + @用例ID: 20251223-170001-000000103 + @用例名称: tperf-libmicro-memset_10k + @用例级别: 3 + @用例标签: + @扩展属性: + @用例类型: 性能测试 + @自动化: 1 + @超时时间: 0 + @用例描述: 使用libmicro测试系统性能 + """ + + def tc_setup(self, *args): + self.msg("this is tc_setup") + + # @预置条件: 系统启动 + + def do_test(self, *args): + self.msg("this is do_test") + + # @测试步骤: 使用使用libmicro测试系统性能 + # @预期结果: 测试正常,性能数据采集正常 + perf = PerfLibMicro( + name=self.tc_name, + label="L0:内存", + test_opt="-E -C 2000 -L -S -W -N memset_10k -s 10k -I 800 -B 100", + tool_path="tools/libmicro.install/build/memset", + ) + perf.run(warmup=1, run_loop=20, result_select_percent=80) + perf.report(testcase=self) + self.assert_true(len(perf.results) > 0) + + def tc_teardown(self, *args): + self.msg("this is tc_teardown") + + +if __name__ == "__main__": + PythonTestCase().tst_main(sys.argv) diff --git a/testcase/tperf-libmicro-strchr_10.py b/testcase/tperf-libmicro-strchr_10.py new file mode 100755 index 0000000000000000000000000000000000000000..3598925580aa1cbcb427c336c11df0f4a7fdce9e --- /dev/null +++ b/testcase/tperf-libmicro-strchr_10.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python3 +# coding: utf-8 + +import os.path +import stat +import sys + +_suite_top_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..") +while _suite_top_dir != "/": + if os.path.isfile(os.path.join(_suite_top_dir, "tsuite")): + break + _suite_top_dir = os.path.dirname(_suite_top_dir) +sys.path.append(_suite_top_dir) +from lib.ts_common import MyTestCase, PerfLibMicro # noqa: E402 + + +class PythonTestCase(MyTestCase): + """ + @用例ID: 20251223-170001-000000502 + @用例名称: tperf-libmicro-strchr_10 + @用例级别: 3 + @用例标签: + @扩展属性: + @用例类型: 性能测试 + @自动化: 1 + @超时时间: 0 + @用例描述: 使用libmicro测试系统性能 + """ + + def tc_setup(self, *args): + self.msg("this is tc_setup") + + # @预置条件: 系统启动 + + def do_test(self, *args): + self.msg("this is do_test") + + # @测试步骤: 使用使用libmicro测试系统性能 + # @预期结果: 测试正常,性能数据采集正常 + perf = PerfLibMicro( + name=self.tc_name, + label="L0:内存", + test_opt="-E -C 2000 -L -S -W -N strchr_10 -s 10 -I 100 -B 100", + tool_path="tools/libmicro.install/build/strchr" + ) + perf.run(warmup=1, run_loop=20, result_select_percent=80) + perf.report(testcase=self) + self.assert_true(len(perf.results) > 0) + + def tc_teardown(self, *args): + self.msg("this is tc_teardown") + + +if __name__ == "__main__": + PythonTestCase().tst_main(sys.argv) diff --git a/testcase/tperf-libmicro-strcpy_1k.py b/testcase/tperf-libmicro-strcpy_1k.py new file mode 100755 index 0000000000000000000000000000000000000000..7abe60ef47bfb0397b3a97262a236e014884af78 --- /dev/null +++ b/testcase/tperf-libmicro-strcpy_1k.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python3 +# coding: utf-8 + +import os.path +import stat +import sys + +_suite_top_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..") +while _suite_top_dir != "/": + if os.path.isfile(os.path.join(_suite_top_dir, "tsuite")): + break + _suite_top_dir = os.path.dirname(_suite_top_dir) +sys.path.append(_suite_top_dir) +from lib.ts_common import MyTestCase, PerfLibMicro # noqa: E402 + + +class PythonTestCase(MyTestCase): + """ + @用例ID: 20251223-170001-000000501 + @用例名称: tperf-libmicro-strcpy_1k + @用例级别: 3 + @用例标签: + @扩展属性: + @用例类型: 性能测试 + @自动化: 1 + @超时时间: 0 + @用例描述: 使用libmicro测试系统性能 + """ + + def tc_setup(self, *args): + self.msg("this is tc_setup") + + # @预置条件: 系统启动 + + def do_test(self, *args): + self.msg("this is do_test") + + # @测试步骤: 使用使用libmicro测试系统性能 + # @预期结果: 测试正常,性能数据采集正常 + perf = PerfLibMicro( + name=self.tc_name, + label="L0:内存", + test_opt="-E -C 2000 -L -S -W -N strcpy_1k -s 1k -I 200 -B 100", + tool_path="tools/libmicro.install/build/strcpy" + ) + perf.run(warmup=1, run_loop=20, result_select_percent=80) + perf.report(testcase=self) + self.assert_true(len(perf.results) > 0) + + def tc_teardown(self, *args): + self.msg("this is tc_teardown") + + +if __name__ == "__main__": + PythonTestCase().tst_main(sys.argv) diff --git a/testcase/tperf-lmbench-bw_mem-bcopy.py b/testcase/tperf-lmbench-bw_mem-bcopy.py new file mode 100755 index 0000000000000000000000000000000000000000..6a419cacd4e09471594f281d1577d10073059972 --- /dev/null +++ b/testcase/tperf-lmbench-bw_mem-bcopy.py @@ -0,0 +1,54 @@ +#!/usr/bin/env python3 +# coding: utf-8 + +import os.path +import pathlib +import subprocess +import sys +from typing import List + +_suite_top_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..") +while _suite_top_dir != "/": + if os.path.isfile(os.path.join(_suite_top_dir, "tsuite")): + break + _suite_top_dir = os.path.dirname(_suite_top_dir) +sys.path.append(_suite_top_dir) +from lib.ts_common import MyTestCase, PerfLMbench # noqa: E402 + +class PythonTestCase(MyTestCase): + """ + @用例ID: 20251223-170001-000000204 + @用例名称: tperf-lmbench-bw_mem-bcopy + @用例级别: 3 + @用例标签: + @用例类型: 性能测试 + @自动化: 1 + @超时时间: 0 + @用例描述: 使用lmbench测试内存带宽-bcopy模式 + """ + + def tc_setup(self, *args): + # @预置条件: + self.msg("this is tc_setup") + + def do_test(self, *args): + self.msg("this is do_test") + + # @测试步骤: 测试lmbench性能 + # @预期结果: 测试正常,性能数据采集正常 + perf = PerfLMbench( + name="bw_mem", + testname=self.tc_name, + label="L0:内存", + general_opt="-P 1 4096m bcopy" + ) + perf.run() + perf.report(testcase=self) + self.assert_true(len(perf.results) > 0) + + def tc_teardown(self, *args): + self.msg("this is tc_teardown") + + +if __name__ == '__main__': + PythonTestCase().tst_main(sys.argv) diff --git a/testcase/tperf-lmbench-bw_mem-cp.py b/testcase/tperf-lmbench-bw_mem-cp.py new file mode 100755 index 0000000000000000000000000000000000000000..e56eb5724f826dd50d6f666ad529292168c0c43e --- /dev/null +++ b/testcase/tperf-lmbench-bw_mem-cp.py @@ -0,0 +1,54 @@ +#!/usr/bin/env python3 +# coding: utf-8 + +import os.path +import pathlib +import subprocess +import sys +from typing import List + +_suite_top_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..") +while _suite_top_dir != "/": + if os.path.isfile(os.path.join(_suite_top_dir, "tsuite")): + break + _suite_top_dir = os.path.dirname(_suite_top_dir) +sys.path.append(_suite_top_dir) +from lib.ts_common import MyTestCase, PerfLMbench # noqa: E402 + +class PythonTestCase(MyTestCase): + """ + @用例ID: 20251223-170001-000000202 + @用例名称: tperf-lmbench-bw_mem-cp + @用例级别: 3 + @用例标签: + @用例类型: 性能测试 + @自动化: 1 + @超时时间: 0 + @用例描述: 使用lmbench测试内存带宽-cp模式 + """ + + def tc_setup(self, *args): + # @预置条件: + self.msg("this is tc_setup") + + def do_test(self, *args): + self.msg("this is do_test") + + # @测试步骤: 测试lmbench性能 + # @预期结果: 测试正常,性能数据采集正常 + perf = PerfLMbench( + name="bw_mem", + testname=self.tc_name, + label="L0:内存", + general_opt="-P 1 4096m cp" + ) + perf.run() + perf.report(testcase=self) + self.assert_true(len(perf.results) > 0) + + def tc_teardown(self, *args): + self.msg("this is tc_teardown") + + +if __name__ == '__main__': + PythonTestCase().tst_main(sys.argv) diff --git a/testcase/tperf-lmbench-bw_mem-fcp.py b/testcase/tperf-lmbench-bw_mem-fcp.py new file mode 100755 index 0000000000000000000000000000000000000000..eb0356e82e09895ac55e18dfe9c51ed6c7f878c8 --- /dev/null +++ b/testcase/tperf-lmbench-bw_mem-fcp.py @@ -0,0 +1,54 @@ +#!/usr/bin/env python3 +# coding: utf-8 + +import os.path +import pathlib +import subprocess +import sys +from typing import List + +_suite_top_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..") +while _suite_top_dir != "/": + if os.path.isfile(os.path.join(_suite_top_dir, "tsuite")): + break + _suite_top_dir = os.path.dirname(_suite_top_dir) +sys.path.append(_suite_top_dir) +from lib.ts_common import MyTestCase, PerfLMbench # noqa: E402 + +class PythonTestCase(MyTestCase): + """ + @用例ID: 20251223-170001-000000203 + @用例名称: tperf-lmbench-bw_mem-fcp + @用例级别: 3 + @用例标签: + @用例类型: 性能测试 + @自动化: 1 + @超时时间: 0 + @用例描述: 使用lmbench测试内存带宽-fcp模式 + """ + + def tc_setup(self, *args): + # @预置条件: + self.msg("this is tc_setup") + + def do_test(self, *args): + self.msg("this is do_test") + + # @测试步骤: 测试lmbench性能 + # @预期结果: 测试正常,性能数据采集正常 + perf = PerfLMbench( + name="bw_mem", + testname=self.tc_name, + label="L0:内存", + general_opt="-P 1 4096m fcp" + ) + perf.run() + perf.report(testcase=self) + self.assert_true(len(perf.results) > 0) + + def tc_teardown(self, *args): + self.msg("this is tc_teardown") + + +if __name__ == '__main__': + PythonTestCase().tst_main(sys.argv) diff --git a/testcase/tperf-lmbench-bw_mem-fwr.py b/testcase/tperf-lmbench-bw_mem-fwr.py new file mode 100755 index 0000000000000000000000000000000000000000..d695da9c98f5f190d5fd1e836fc5bd2d07d2b12b --- /dev/null +++ b/testcase/tperf-lmbench-bw_mem-fwr.py @@ -0,0 +1,54 @@ +#!/usr/bin/env python3 +# coding: utf-8 + +import os.path +import pathlib +import subprocess +import sys +from typing import List + +_suite_top_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..") +while _suite_top_dir != "/": + if os.path.isfile(os.path.join(_suite_top_dir, "tsuite")): + break + _suite_top_dir = os.path.dirname(_suite_top_dir) +sys.path.append(_suite_top_dir) +from lib.ts_common import MyTestCase, PerfLMbench # noqa: E402 + +class PythonTestCase(MyTestCase): + """ + @用例ID: 20251223-170001-000000201 + @用例名称: tperf-lmbench-bw_mem-fwr + @用例级别: 3 + @用例标签: + @用例类型: 性能测试 + @自动化: 1 + @超时时间: 0 + @用例描述: 使用lmbench测试内存带宽-fwr模式 + """ + + def tc_setup(self, *args): + # @预置条件: + self.msg("this is tc_setup") + + def do_test(self, *args): + self.msg("this is do_test") + + # @测试步骤: 测试lmbench性能 + # @预期结果: 测试正常,性能数据采集正常 + perf = PerfLMbench( + name="bw_mem", + testname=self.tc_name, + label="L0:内存", + general_opt="-P 1 4096m fwr" + ) + perf.run() + perf.report(testcase=self) + self.assert_true(len(perf.results) > 0) + + def tc_teardown(self, *args): + self.msg("this is tc_teardown") + + +if __name__ == '__main__': + PythonTestCase().tst_main(sys.argv) diff --git a/testcase/tperf-lmbench-lat_mem_rd-prefetch-off.py b/testcase/tperf-lmbench-lat_mem_rd-prefetch-off.py new file mode 100755 index 0000000000000000000000000000000000000000..1614fe6ddce7a7265e99c9166a35d1e954f60c7d --- /dev/null +++ b/testcase/tperf-lmbench-lat_mem_rd-prefetch-off.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python3 +# coding: utf-8 + +import os.path +import sys + +_suite_top_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..") +while _suite_top_dir != "/": + if os.path.isfile(os.path.join(_suite_top_dir, "tsuite")): + break + _suite_top_dir = os.path.dirname(_suite_top_dir) +sys.path.append(_suite_top_dir) +from lib.ts_common import MyTestCase, PerfLMbench # noqa: E402 + + +class PythonTestCase(MyTestCase): + """ + @用例ID: 20251217-200000-000000002 + @用例名称: tperf-lmbench-lat_mem_rd-prefetch-off + @用例级别: 3 + @用例标签: + @扩展属性: + @用例类型: 性能测试 + @自动化: 1 + @超时时间: 0 + @用例描述: 使用lmbench测试内存读取延迟(关闭硬件预取)- 同NUMA节点 + """ + + def tc_setup(self, *args): + self.msg("this is tc_setup") + + def do_test(self, *args): + self.msg("this is do_test") + + # @测试步骤: 测试内存读取延迟(关闭硬件预取) + # @预期结果: 测试正常,性能数据采集正常 + # 注意:-t 参数用于关闭硬件预取,测试同NUMA节点内存延迟 + # 命令格式: numactl --cpunodebind=0 --membind=0 lat_mem_rd -P 1 -t 8000 128 + perf = PerfLMbench( + name="lat_mem_rd", + testname=self.tc_name, + label="L0:内存", + general_opt="-P 1 -t 8000 128" + ) + # 修改命令以添加numactl前缀 + perf.command = f"numactl --cpunodebind=0 --membind=0 {perf.command}" + perf.run(warmup=0, run_loop=1) + perf.report(testcase=self) + self.assert_true(len(perf.results) > 0) + + def tc_teardown(self, *args): + self.msg("this is tc_teardown") + + +if __name__ == "__main__": + PythonTestCase().tst_main(sys.argv) + diff --git a/testcase/tperf-lmbench-lat_mem_rd-prefetch-on.py b/testcase/tperf-lmbench-lat_mem_rd-prefetch-on.py new file mode 100755 index 0000000000000000000000000000000000000000..e861d0e52cf668e0f0c1fdea07ffd15672c464d2 --- /dev/null +++ b/testcase/tperf-lmbench-lat_mem_rd-prefetch-on.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python3 +# coding: utf-8 + +import os.path +import sys + +_suite_top_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..") +while _suite_top_dir != "/": + if os.path.isfile(os.path.join(_suite_top_dir, "tsuite")): + break + _suite_top_dir = os.path.dirname(_suite_top_dir) +sys.path.append(_suite_top_dir) +from lib.ts_common import MyTestCase, PerfLMbench # noqa: E402 + + +class PythonTestCase(MyTestCase): + """ + @用例ID: 20251217-200000-000000001 + @用例名称: tperf-lmbench-lat_mem_rd-prefetch-on + @用例级别: 3 + @用例标签: + @扩展属性: + @用例类型: 性能测试 + @自动化: 1 + @超时时间: 0 + @用例描述: 使用lmbench测试内存读取延迟(开启硬件预取)- 同NUMA节点 + """ + + def tc_setup(self, *args): + self.msg("this is tc_setup") + + def do_test(self, *args): + self.msg("this is do_test") + + # @测试步骤: 测试内存读取延迟(开启硬件预取) + # @预期结果: 测试正常,性能数据采集正常 + # 注意:使用numactl绑定到NUMA节点0,测试同NUMA节点内存延迟 + # 命令格式: numactl --cpunodebind=0 --membind=0 lat_mem_rd -P 1 8000 128 + perf = PerfLMbench( + name="lat_mem_rd", + testname=self.tc_name, + label="L0:内存", + general_opt="-P 1 8000 128" + ) + # 修改命令以添加numactl前缀 + perf.command = f"numactl --cpunodebind=0 --membind=0 {perf.command}" + perf.run(warmup=0, run_loop=1) + perf.report(testcase=self) + self.assert_true(len(perf.results) > 0) + + def tc_teardown(self, *args): + self.msg("this is tc_teardown") + + +if __name__ == "__main__": + PythonTestCase().tst_main(sys.argv) + diff --git a/testcase/tperf-mlc-bandwidth-matrix.py b/testcase/tperf-mlc-bandwidth-matrix.py new file mode 100755 index 0000000000000000000000000000000000000000..eabe65a398834d61de821cbbe5ada458c147bbfb --- /dev/null +++ b/testcase/tperf-mlc-bandwidth-matrix.py @@ -0,0 +1,51 @@ +#!/usr/bin/env python3 +# coding: utf-8 + +import os.path +import sys + +_suite_top_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..") +while _suite_top_dir != "/": + if os.path.isfile(os.path.join(_suite_top_dir, "tsuite")): + break + _suite_top_dir = os.path.dirname(_suite_top_dir) +sys.path.append(_suite_top_dir) +from lib.ts_common import MyTestCase, PerfMLC # noqa: E402 + + +class PythonTestCase(MyTestCase): + """ + @用例ID: 20251217-194800-029667980 + @用例名称: tperf-mlc-bandwidth-matrix + @用例级别: 3 + @用例标签: + @扩展属性: + @用例类型: 性能测试 + @自动化: 1 + @超时时间: 0 + @用例描述: 使用Intel MLC测试NUMA节点间带宽矩阵 + """ + + def tc_setup(self, *args): + self.msg("this is tc_setup") + + def do_test(self, *args): + self.msg("this is do_test") + + # @测试步骤: 测试NUMA节点间带宽矩阵 + # @预期结果: 测试正常,性能数据采集正常 + perf = PerfMLC( + name="mlc-bandwidth-matrix", + test_mode="bandwidth_matrix", + label="L0:内存", + ) + perf.run(warmup=0, run_loop=1, result_select_percent=70) + perf.report(testcase=self) + self.assert_true(len(perf.results) > 0) + + def tc_teardown(self, *args): + self.msg("this is tc_teardown") + + +if __name__ == "__main__": + PythonTestCase().tst_main(sys.argv) diff --git a/testcase/tperf-mlc-idle-latency.py b/testcase/tperf-mlc-idle-latency.py new file mode 100755 index 0000000000000000000000000000000000000000..d3519b300f29a6d2ba7c5c684a5e870c1422b675 --- /dev/null +++ b/testcase/tperf-mlc-idle-latency.py @@ -0,0 +1,51 @@ +#!/usr/bin/env python3 +# coding: utf-8 + +import os.path +import sys + +_suite_top_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..") +while _suite_top_dir != "/": + if os.path.isfile(os.path.join(_suite_top_dir, "tsuite")): + break + _suite_top_dir = os.path.dirname(_suite_top_dir) +sys.path.append(_suite_top_dir) +from lib.ts_common import MyTestCase, PerfMLC # noqa: E402 + + +class PythonTestCase(MyTestCase): + """ + @用例ID: 20251217-194800-029667976 + @用例名称: tperf-mlc-idle-latency + @用例级别: 3 + @用例标签: + @扩展属性: + @用例类型: 性能测试 + @自动化: 1 + @超时时间: 0 + @用例描述: 使用Intel MLC测试空闲内存延迟 + """ + + def tc_setup(self, *args): + self.msg("this is tc_setup") + + def do_test(self, *args): + self.msg("this is do_test") + + # @测试步骤: 测试空闲内存延迟 + # @预期结果: 测试正常,性能数据采集正常 + perf = PerfMLC( + name="mlc-idle", + test_mode="idle_latency", + label="L0:内存", + ) + perf.run(warmup=0, run_loop=1, result_select_percent=70) + perf.report(testcase=self) + self.assert_true(len(perf.results) > 0) + + def tc_teardown(self, *args): + self.msg("this is tc_teardown") + + +if __name__ == "__main__": + PythonTestCase().tst_main(sys.argv) diff --git a/testcase/tperf-mlc-latency-matrix.py b/testcase/tperf-mlc-latency-matrix.py new file mode 100755 index 0000000000000000000000000000000000000000..693dd03f0bcafcc1172883992dba6891a227f576 --- /dev/null +++ b/testcase/tperf-mlc-latency-matrix.py @@ -0,0 +1,51 @@ +#!/usr/bin/env python3 +# coding: utf-8 + +import os.path +import sys + +_suite_top_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..") +while _suite_top_dir != "/": + if os.path.isfile(os.path.join(_suite_top_dir, "tsuite")): + break + _suite_top_dir = os.path.dirname(_suite_top_dir) +sys.path.append(_suite_top_dir) +from lib.ts_common import MyTestCase, PerfMLC # noqa: E402 + + +class PythonTestCase(MyTestCase): + """ + @用例ID: 20251223-170001-000000401 + @用例名称: tperf-mlc-latency-matrix + @用例级别: 3 + @用例标签: + @扩展属性: + @用例类型: 性能测试 + @自动化: 1 + @超时时间: 0 + @用例描述: 使用Intel MLC测试NUMA延迟矩阵 + """ + + def tc_setup(self, *args): + self.msg("this is tc_setup") + + def do_test(self, *args): + self.msg("this is do_test") + + # @测试步骤: 测试NUMA延迟矩阵 + # @预期结果: 测试正常,性能数据采集正常 + perf = PerfMLC( + name="mlc-latency-matrix", + test_mode="latency_matrix", + label="L0:内存", + ) + perf.run(warmup=0, run_loop=1, result_select_percent=70) + perf.report(testcase=self) + self.assert_true(len(perf.results) > 0) + + def tc_teardown(self, *args): + self.msg("this is tc_teardown") + + +if __name__ == "__main__": + PythonTestCase().tst_main(sys.argv) diff --git a/testcase/tperf-mlc-loaded-latency.py b/testcase/tperf-mlc-loaded-latency.py new file mode 100755 index 0000000000000000000000000000000000000000..6b347239f4c1f0a23469211b583b75208eca8cb3 --- /dev/null +++ b/testcase/tperf-mlc-loaded-latency.py @@ -0,0 +1,51 @@ +#!/usr/bin/env python3 +# coding: utf-8 + +import os.path +import sys + +_suite_top_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..") +while _suite_top_dir != "/": + if os.path.isfile(os.path.join(_suite_top_dir, "tsuite")): + break + _suite_top_dir = os.path.dirname(_suite_top_dir) +sys.path.append(_suite_top_dir) +from lib.ts_common import MyTestCase, PerfMLC # noqa: E402 + + +class PythonTestCase(MyTestCase): + """ + @用例ID: 20251217-194800-029667978 + @用例名称: tperf-mlc-loaded-latency + @用例级别: 3 + @用例标签: + @扩展属性: + @用例类型: 性能测试 + @自动化: 1 + @超时时间: 0 + @用例描述: 使用Intel MLC测试负载内存延迟和带宽 + """ + + def tc_setup(self, *args): + self.msg("this is tc_setup") + + def do_test(self, *args): + self.msg("this is do_test") + + # @测试步骤: 测试负载内存延迟和带宽 + # @预期结果: 测试正常,性能数据采集正常 + perf = PerfMLC( + name="mlc-loaded", + test_mode="loaded_latency", + label="L0:内存", + ) + perf.run(warmup=0, run_loop=1, result_select_percent=70) + perf.report(testcase=self) + self.assert_true(len(perf.results) > 0) + + def tc_teardown(self, *args): + self.msg("this is tc_teardown") + + +if __name__ == "__main__": + PythonTestCase().tst_main(sys.argv) diff --git a/testcase/tperf-mlc-peak-bandwidth.py b/testcase/tperf-mlc-peak-bandwidth.py new file mode 100755 index 0000000000000000000000000000000000000000..7159e375f1e55d8c321eaf4aeba85bc05c56570f --- /dev/null +++ b/testcase/tperf-mlc-peak-bandwidth.py @@ -0,0 +1,51 @@ +#!/usr/bin/env python3 +# coding: utf-8 + +import os.path +import sys + +_suite_top_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..") +while _suite_top_dir != "/": + if os.path.isfile(os.path.join(_suite_top_dir, "tsuite")): + break + _suite_top_dir = os.path.dirname(_suite_top_dir) +sys.path.append(_suite_top_dir) +from lib.ts_common import MyTestCase, PerfMLC # noqa: E402 + + +class PythonTestCase(MyTestCase): + """ + @用例ID: 20251217-194800-029667977 + @用例名称: tperf-mlc-peak-bandwidth + @用例级别: 3 + @用例标签: + @扩展属性: + @用例类型: 性能测试 + @自动化: 1 + @超时时间: 0 + @用例描述: 使用Intel MLC测试峰值注入带宽 + """ + + def tc_setup(self, *args): + self.msg("this is tc_setup") + + def do_test(self, *args): + self.msg("this is do_test") + + # @测试步骤: 测试峰值注入带宽 + # @预期结果: 测试正常,性能数据采集正常 + perf = PerfMLC( + name="mlc-peak", + test_mode="peak_injection_bandwidth", + label="L0:内存", + ) + perf.run(warmup=0, run_loop=1, result_select_percent=70) + perf.report(testcase=self) + self.assert_true(len(perf.results) > 0) + + def tc_teardown(self, *args): + self.msg("this is tc_teardown") + + +if __name__ == "__main__": + PythonTestCase().tst_main(sys.argv) diff --git a/testcase/tperf-stream-max.py b/testcase/tperf-stream-max.py new file mode 100755 index 0000000000000000000000000000000000000000..f89e2b7253879d61c97e8ced47a235a700c0884d --- /dev/null +++ b/testcase/tperf-stream-max.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python3 +# coding: utf-8 + +import multiprocessing +import os +import os.path +import stat +import sys + +_suite_top_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..") +while _suite_top_dir != "/": + if os.path.isfile(os.path.join(_suite_top_dir, "tsuite")): + break + _suite_top_dir = os.path.dirname(_suite_top_dir) +sys.path.append(_suite_top_dir) +from lib.ts_common import MyTestCase, PerfStream # noqa: E402 + + +class PythonTestCase(MyTestCase): + """ + @用例ID: 20251217-100000-599002773 + @用例名称: tperf-stream-max + @用例级别: 3 + @用例标签: + @扩展属性: + @用例类型: 性能测试 + @自动化: 1 + @超时时间: 0 + @用例描述: 使用stream测试内存性能(整机线程数) + """ + + def tc_setup(self, *args): + self.msg("this is tc_setup") + # 设置线程数为CPU核心数 + cpu_count = multiprocessing.cpu_count() + os.environ["OMP_NUM_THREADS"] = str(cpu_count) + self.msg(f"Set OMP_NUM_THREADS={cpu_count}") + + def do_test(self, *args): + self.msg("this is do_test") + + # @测试步骤: 测试内存性能(整机线程数) + # @预期结果: 测试正常,性能数据采集正常 + perf = PerfStream( + name="stream-max-thread", + label="L0:内存", + ) + perf.run(warmup=0, run_loop=40, result_select_percent=70) + perf.report(testcase=self) + self.assert_true(len(perf.results) > 0) + + def tc_teardown(self, *args): + self.msg("this is tc_teardown") + + +if __name__ == "__main__": + PythonTestCase().tst_main(sys.argv) diff --git a/testcase/tperf-stream-single.py b/testcase/tperf-stream-single.py index 67f207365a19f9452efa800f611d17c9554fcc13..97cc8c4e8e7975241897688367ecd254541fe5c5 100755 --- a/testcase/tperf-stream-single.py +++ b/testcase/tperf-stream-single.py @@ -1,6 +1,7 @@ #!/usr/bin/env python3 # coding: utf-8 +import os import os.path import stat import sys @@ -29,6 +30,9 @@ class PythonTestCase(MyTestCase): def tc_setup(self, *args): self.msg("this is tc_setup") + # 设置线程数为1,确保单线程运行 + os.environ["OMP_NUM_THREADS"] = "1" + self.msg("Set OMP_NUM_THREADS=1") def do_test(self, *args): self.msg("this is do_test") diff --git a/testcase/tperf-stream-thread-16.py b/testcase/tperf-stream-thread-16.py new file mode 100755 index 0000000000000000000000000000000000000000..081fed30b6ac30e7d6f27b1b220e76ca90ce484e --- /dev/null +++ b/testcase/tperf-stream-thread-16.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python3 +# coding: utf-8 + +import os +import os.path +import stat +import sys + +_suite_top_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..") +while _suite_top_dir != "/": + if os.path.isfile(os.path.join(_suite_top_dir, "tsuite")): + break + _suite_top_dir = os.path.dirname(_suite_top_dir) +sys.path.append(_suite_top_dir) +from lib.ts_common import MyTestCase, PerfStream # noqa: E402 + + +class PythonTestCase(MyTestCase): + """ + @用例ID: 20251223-170001-000000303 + @用例名称: tperf-stream-thread-16 + @用例级别: 3 + @用例标签: + @扩展属性: + @用例类型: 性能测试 + @自动化: 1 + @超时时间: 0 + @用例描述: 使用stream测试内存性能(16线程) + """ + + def tc_setup(self, *args): + self.msg("this is tc_setup") + # 设置线程数为16 + os.environ["OMP_NUM_THREADS"] = "16" + self.msg("Set OMP_NUM_THREADS=16") + + def do_test(self, *args): + self.msg("this is do_test") + + # @测试步骤: 测试内存性能(16线程) + # @预期结果: 测试正常,性能数据采集正常 + perf = PerfStream( + name="stream-thread-16", + label="L0:内存", + ) + perf.run(warmup=0, run_loop=40, result_select_percent=70) + perf.report(testcase=self) + self.assert_true(len(perf.results) > 0) + + def tc_teardown(self, *args): + self.msg("this is tc_teardown") + + +if __name__ == "__main__": + PythonTestCase().tst_main(sys.argv) diff --git a/testcase/tperf-stream-thread-32.py b/testcase/tperf-stream-thread-32.py new file mode 100755 index 0000000000000000000000000000000000000000..0f50b404fb01b638bffb59eaf3a69614d3ed6bd9 --- /dev/null +++ b/testcase/tperf-stream-thread-32.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python3 +# coding: utf-8 + +import os +import os.path +import stat +import sys + +_suite_top_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..") +while _suite_top_dir != "/": + if os.path.isfile(os.path.join(_suite_top_dir, "tsuite")): + break + _suite_top_dir = os.path.dirname(_suite_top_dir) +sys.path.append(_suite_top_dir) +from lib.ts_common import MyTestCase, PerfStream # noqa: E402 + + +class PythonTestCase(MyTestCase): + """ + @用例ID: 20251223-170001-000000304 + @用例名称: tperf-stream-thread-32 + @用例级别: 3 + @用例标签: + @扩展属性: + @用例类型: 性能测试 + @自动化: 1 + @超时时间: 0 + @用例描述: 使用stream测试内存性能(32线程) + """ + + def tc_setup(self, *args): + self.msg("this is tc_setup") + # 设置线程数为32 + os.environ["OMP_NUM_THREADS"] = "32" + self.msg("Set OMP_NUM_THREADS=32") + + def do_test(self, *args): + self.msg("this is do_test") + + # @测试步骤: 测试内存性能(32线程) + # @预期结果: 测试正常,性能数据采集正常 + perf = PerfStream( + name="stream-thread-32", + label="L0:内存", + ) + perf.run(warmup=0, run_loop=40, result_select_percent=70) + perf.report(testcase=self) + self.assert_true(len(perf.results) > 0) + + def tc_teardown(self, *args): + self.msg("this is tc_teardown") + + +if __name__ == "__main__": + PythonTestCase().tst_main(sys.argv) diff --git a/testcase/tperf-stream-thread-4.py b/testcase/tperf-stream-thread-4.py new file mode 100755 index 0000000000000000000000000000000000000000..3a5e444b90abed9d0fb1ab49852f1234be731a45 --- /dev/null +++ b/testcase/tperf-stream-thread-4.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python3 +# coding: utf-8 + +import os +import os.path +import stat +import sys + +_suite_top_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..") +while _suite_top_dir != "/": + if os.path.isfile(os.path.join(_suite_top_dir, "tsuite")): + break + _suite_top_dir = os.path.dirname(_suite_top_dir) +sys.path.append(_suite_top_dir) +from lib.ts_common import MyTestCase, PerfStream # noqa: E402 + + +class PythonTestCase(MyTestCase): + """ + @用例ID: 20251223-170001-000000301 + @用例名称: tperf-stream-thread-4 + @用例级别: 3 + @用例标签: + @扩展属性: + @用例类型: 性能测试 + @自动化: 1 + @超时时间: 0 + @用例描述: 使用stream测试内存性能(4线程) + """ + + def tc_setup(self, *args): + self.msg("this is tc_setup") + # 设置线程数为4 + os.environ["OMP_NUM_THREADS"] = "4" + self.msg("Set OMP_NUM_THREADS=4") + + def do_test(self, *args): + self.msg("this is do_test") + + # @测试步骤: 测试内存性能(4线程) + # @预期结果: 测试正常,性能数据采集正常 + perf = PerfStream( + name="stream-thread-4", + label="L0:内存", + ) + perf.run(warmup=0, run_loop=40, result_select_percent=70) + perf.report(testcase=self) + self.assert_true(len(perf.results) > 0) + + def tc_teardown(self, *args): + self.msg("this is tc_teardown") + + +if __name__ == "__main__": + PythonTestCase().tst_main(sys.argv) diff --git a/testcase/tperf-stream-thread-8.py b/testcase/tperf-stream-thread-8.py new file mode 100755 index 0000000000000000000000000000000000000000..a7723d96bb428ca4ddeaae60f2465dca5d2f4e00 --- /dev/null +++ b/testcase/tperf-stream-thread-8.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python3 +# coding: utf-8 + +import os +import os.path +import stat +import sys + +_suite_top_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..") +while _suite_top_dir != "/": + if os.path.isfile(os.path.join(_suite_top_dir, "tsuite")): + break + _suite_top_dir = os.path.dirname(_suite_top_dir) +sys.path.append(_suite_top_dir) +from lib.ts_common import MyTestCase, PerfStream # noqa: E402 + + +class PythonTestCase(MyTestCase): + """ + @用例ID: 20251223-170001-000000302 + @用例名称: tperf-stream-thread-8 + @用例级别: 3 + @用例标签: + @扩展属性: + @用例类型: 性能测试 + @自动化: 1 + @超时时间: 0 + @用例描述: 使用stream测试内存性能(8线程) + """ + + def tc_setup(self, *args): + self.msg("this is tc_setup") + # 设置线程数为8 + os.environ["OMP_NUM_THREADS"] = "8" + self.msg("Set OMP_NUM_THREADS=8") + + def do_test(self, *args): + self.msg("this is do_test") + + # @测试步骤: 测试内存性能(8线程) + # @预期结果: 测试正常,性能数据采集正常 + perf = PerfStream( + name="stream-thread-8", + label="L0:内存", + ) + perf.run(warmup=0, run_loop=40, result_select_percent=70) + perf.report(testcase=self) + self.assert_true(len(perf.results) > 0) + + def tc_teardown(self, *args): + self.msg("this is tc_teardown") + + +if __name__ == "__main__": + PythonTestCase().tst_main(sys.argv) diff --git a/testcase/tperf-sysbench-memory-block-256k-size-10g-rndwr.py b/testcase/tperf-sysbench-memory-block-256k-size-10g-rndwr.py index c20a879f87bc5d593a7d84c53d63e0b70c3f035e..150d8575411dfb2359d200780382aaac07c8526f 100755 --- a/testcase/tperf-sysbench-memory-block-256k-size-10g-rndwr.py +++ b/testcase/tperf-sysbench-memory-block-256k-size-10g-rndwr.py @@ -36,7 +36,7 @@ class PythonTestCase(MyTestCase): # @测试步骤: 使用sysbench执行memory性能测试 # @预期结果: 性能测试正常并且可以获取到性能数据 perf = PerfSysBench( - name="tperf-sysbench-memory-block-2568k-size-10g-rndwr", + name="tperf-sysbench-memory-block-256k-size-10g-rndwr", testname="memory", label="L0:内存", general_opt="--memory-block-size=256k --memory-total-size=10G --memory-oper=write --memory-access-mode=rnd", diff --git a/testcase/tperf-sysbench-memory-block-64k-size-10g-rndrd.py b/testcase/tperf-sysbench-memory-block-64k-size-10g-rndrd.py index 14c67afc195b9c73a826c69a5afecec80136b2d1..5c0b4e0ab52cf4d553c4519c716d5e14d1eb4fe1 100755 --- a/testcase/tperf-sysbench-memory-block-64k-size-10g-rndrd.py +++ b/testcase/tperf-sysbench-memory-block-64k-size-10g-rndrd.py @@ -36,7 +36,7 @@ class PythonTestCase(MyTestCase): # @测试步骤: 使用sysbench执行memory性能测试 # @预期结果: 性能测试正常并且可以获取到性能数据 perf = PerfSysBench( - name="tperf-sysbench-memory-block-64k-size-10g-rndwr", + name="tperf-sysbench-memory-block-64k-size-10g-rndrd", testname="memory", label="L0:内存", general_opt="--memory-block-size=64k --memory-total-size=10G --memory-oper=read --memory-access-mode=rnd", diff --git a/testcase/tperf-sysbench-memory-thread-1.py b/testcase/tperf-sysbench-memory-thread-1.py new file mode 100755 index 0000000000000000000000000000000000000000..4c3df652f381448cd84f166fa0ec7a735c9387b5 --- /dev/null +++ b/testcase/tperf-sysbench-memory-thread-1.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python3 +# coding: utf-8 + +import os.path +import sys + +_suite_top_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..") +while _suite_top_dir != "/": + if os.path.isfile(os.path.join(_suite_top_dir, "tsuite")): + break + _suite_top_dir = os.path.dirname(_suite_top_dir) +sys.path.append(_suite_top_dir) +from lib.ts_common import MyTestCase, PerfSysBench # noqa: E402 + + +class PythonTestCase(MyTestCase): + """ + @用例ID: 20251217-100001-100000001 + @用例名称: tperf-sysbench-memory-thread-1 + @用例级别: 3 + @用例标签: + @扩展属性: + @用例类型: 性能测试 + @自动化: 1 + @超时时间: 0 + @用例描述: 使用sysbench工具测试内存带宽性能(单线程) + """ + + def tc_setup(self, *args): + self.msg("this is tc_setup") + + # @预置条件: 系统正常启动 + + def do_test(self, *args): + self.msg("this is do_test") + # @测试步骤: 使用sysbench执行内存性能测试(单线程) + # @预期结果: 性能测试正常并且可以获取到内存带宽数据 + perf = PerfSysBench( + name="tperf-sysbench-memory-thread-1", + testname="memory", + label="L0:内存", + general_opt="--threads=1 --time=300", + ) + perf.run(warmup=1, run_loop=1, result_select_percent=90) + perf.report(testcase=self) + self.assert_true(len(perf.results) > 0) + + def tc_teardown(self, *args): + self.msg("this is tc_teardown") + + +if __name__ == "__main__": + PythonTestCase().tst_main(sys.argv) diff --git a/testcase/tperf-sysbench-memory-thread-max.py b/testcase/tperf-sysbench-memory-thread-max.py new file mode 100755 index 0000000000000000000000000000000000000000..4c4121802538d07cfa9fccf4dc0492ee7b04c5d6 --- /dev/null +++ b/testcase/tperf-sysbench-memory-thread-max.py @@ -0,0 +1,58 @@ +#!/usr/bin/env python3 +# coding: utf-8 + +import os +import os.path +import sys + +_suite_top_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..") +while _suite_top_dir != "/": + if os.path.isfile(os.path.join(_suite_top_dir, "tsuite")): + break + _suite_top_dir = os.path.dirname(_suite_top_dir) +sys.path.append(_suite_top_dir) +from lib.ts_common import MyTestCase, PerfSysBench # noqa: E402 + + +class PythonTestCase(MyTestCase): + """ + @用例ID: 20251217-100002-100000002 + @用例名称: tperf-sysbench-memory-thread-max + @用例级别: 3 + @用例标签: + @扩展属性: + @用例类型: 性能测试 + @自动化: 1 + @超时时间: 0 + @用例描述: 使用sysbench工具测试内存带宽性能(最大线程数) + """ + + def tc_setup(self, *args): + self.msg("this is tc_setup") + + # @预置条件: 系统正常启动 + + def do_test(self, *args): + self.msg("this is do_test") + # @测试步骤: 使用sysbench执行内存性能测试(最大线程数) + # @预期结果: 性能测试正常并且可以获取到内存带宽数据 + + # 获取系统CPU核心数作为最大线程数 + max_threads = os.cpu_count() or 1 + + perf = PerfSysBench( + name="tperf-sysbench-memory-thread-max", + testname="memory", + label="L0:内存", + general_opt=f"--threads={max_threads} --time=300", + ) + perf.run(warmup=1, run_loop=1, result_select_percent=90) + perf.report(testcase=self) + self.assert_true(len(perf.results) > 0) + + def tc_teardown(self, *args): + self.msg("this is tc_teardown") + + +if __name__ == "__main__": + PythonTestCase().tst_main(sys.argv) diff --git a/testcase/tperf-sysbench-threads-16-locks-16-yields-1000.py b/testcase/tperf-sysbench-threads-16-locks-16-yields-1000.py old mode 100644 new mode 100755 diff --git a/testcase/tperf-sysbench-threads-16-locks-16-yields-10000.py b/testcase/tperf-sysbench-threads-16-locks-16-yields-10000.py old mode 100644 new mode 100755 diff --git a/testcase/tperf-sysbench-threads-16-locks-16-yields-5000.py b/testcase/tperf-sysbench-threads-16-locks-16-yields-5000.py old mode 100644 new mode 100755 diff --git a/testcase/tperf-sysbench-threads-16-locks-32-yields-1000.py b/testcase/tperf-sysbench-threads-16-locks-32-yields-1000.py old mode 100644 new mode 100755 diff --git a/testcase/tperf-sysbench-threads-16-locks-32-yields-10000.py b/testcase/tperf-sysbench-threads-16-locks-32-yields-10000.py old mode 100644 new mode 100755 diff --git a/testcase/tperf-sysbench-threads-16-locks-32-yields-5000.py b/testcase/tperf-sysbench-threads-16-locks-32-yields-5000.py old mode 100644 new mode 100755 diff --git a/testcase/tperf-sysbench-threads-16-locks-48-yields-5000.py b/testcase/tperf-sysbench-threads-16-locks-48-yields-5000.py old mode 100644 new mode 100755 diff --git a/testcase/tperf-sysbench-threads-16-locks-8-yields-1000.py b/testcase/tperf-sysbench-threads-16-locks-8-yields-1000.py old mode 100644 new mode 100755 diff --git a/testcase/tperf-sysbench-threads-16-locks-8-yields-10000.py b/testcase/tperf-sysbench-threads-16-locks-8-yields-10000.py old mode 100644 new mode 100755 diff --git a/testcase/tperf-sysbench-threads-16-locks-8-yields-5000.py b/testcase/tperf-sysbench-threads-16-locks-8-yields-5000.py old mode 100644 new mode 100755 diff --git a/testcase/tperf-sysbench-threads-16-locks-96-yields-5000.py b/testcase/tperf-sysbench-threads-16-locks-96-yields-5000.py old mode 100644 new mode 100755 diff --git a/testcase/tperf-sysbench-threads-32-locks-16-yields-1000.py b/testcase/tperf-sysbench-threads-32-locks-16-yields-1000.py old mode 100644 new mode 100755 diff --git a/testcase/tperf-sysbench-threads-32-locks-16-yields-10000.py b/testcase/tperf-sysbench-threads-32-locks-16-yields-10000.py old mode 100644 new mode 100755 diff --git a/testcase/tperf-sysbench-threads-32-locks-16-yields-5000.py b/testcase/tperf-sysbench-threads-32-locks-16-yields-5000.py old mode 100644 new mode 100755 diff --git a/testcase/tperf-sysbench-threads-32-locks-32-yields-1000.py b/testcase/tperf-sysbench-threads-32-locks-32-yields-1000.py old mode 100644 new mode 100755 diff --git a/testcase/tperf-sysbench-threads-32-locks-32-yields-10000.py b/testcase/tperf-sysbench-threads-32-locks-32-yields-10000.py old mode 100644 new mode 100755 diff --git a/testcase/tperf-sysbench-threads-32-locks-32-yields-5000.py b/testcase/tperf-sysbench-threads-32-locks-32-yields-5000.py old mode 100644 new mode 100755 diff --git a/testcase/tperf-sysbench-threads-32-locks-48-yields-5000.py b/testcase/tperf-sysbench-threads-32-locks-48-yields-5000.py old mode 100644 new mode 100755 diff --git a/testcase/tperf-sysbench-threads-32-locks-8-yields-1000.py b/testcase/tperf-sysbench-threads-32-locks-8-yields-1000.py old mode 100644 new mode 100755 diff --git a/testcase/tperf-sysbench-threads-32-locks-8-yields-10000.py b/testcase/tperf-sysbench-threads-32-locks-8-yields-10000.py old mode 100644 new mode 100755 diff --git a/testcase/tperf-sysbench-threads-32-locks-8-yields-5000.py b/testcase/tperf-sysbench-threads-32-locks-8-yields-5000.py old mode 100644 new mode 100755 diff --git a/testcase/tperf-sysbench-threads-32-locks-96-yields-5000.py b/testcase/tperf-sysbench-threads-32-locks-96-yields-5000.py old mode 100644 new mode 100755 diff --git a/testcase/tperf-sysbench-threads-8-locks-16-yields-5000.py b/testcase/tperf-sysbench-threads-8-locks-16-yields-5000.py old mode 100644 new mode 100755 diff --git a/testcase/tperf-sysbench-threads-8-locks-32-yields-5000.py b/testcase/tperf-sysbench-threads-8-locks-32-yields-5000.py old mode 100644 new mode 100755 diff --git a/testcase/tperf-sysbench-threads-8-locks-48-yields-1000.py b/testcase/tperf-sysbench-threads-8-locks-48-yields-1000.py old mode 100644 new mode 100755 diff --git a/testcase/tperf-sysbench-threads-8-locks-48-yields-10000.py b/testcase/tperf-sysbench-threads-8-locks-48-yields-10000.py old mode 100644 new mode 100755 diff --git a/testcase/tperf-sysbench-threads-8-locks-48-yields-5000.py b/testcase/tperf-sysbench-threads-8-locks-48-yields-5000.py old mode 100644 new mode 100755 diff --git a/testcase/tperf-sysbench-threads-8-locks-8-yields-5000.py b/testcase/tperf-sysbench-threads-8-locks-8-yields-5000.py old mode 100644 new mode 100755 diff --git a/testcase/tperf-sysbench-threads-8-locks-96-yields-1000.py b/testcase/tperf-sysbench-threads-8-locks-96-yields-1000.py old mode 100644 new mode 100755 diff --git a/testcase/tperf-sysbench-threads-8-locks-96-yields-5000.py b/testcase/tperf-sysbench-threads-8-locks-96-yields-5000.py old mode 100644 new mode 100755 diff --git a/tools/mlc/mlc b/tools/mlc/mlc new file mode 100755 index 0000000000000000000000000000000000000000..8e90526f0300d438d89e4d85739cc09251541fa7 Binary files /dev/null and b/tools/mlc/mlc differ diff --git a/tools/mlc/tst-build.sh b/tools/mlc/tst-build.sh new file mode 100755 index 0000000000000000000000000000000000000000..a52c761cb5fb065eb97a9f9579eaf6b46336cd85 --- /dev/null +++ b/tools/mlc/tst-build.sh @@ -0,0 +1,58 @@ +#!/bin/bash +# Time: 2025-06-26 11:31:18 +# Desc: 编译测试工具 +# Args: +# $1 -- install_dir,可选参数,指定工具安装路径 +# 说明: +# 编译脚本是名字固定为tst-build.sh的bash脚本 +# 如果不指定参数install_dir,那么默认安装在当前目录.install路径下 +# 编译失败则将.install目录重命名为.install.fail +# .install目录存在表示工具已经编译过,不再重复编译 + +g_tool_dir="$(dirname "$(realpath "$0")")" +g_install_dir="$1" + +# TODO: 编译依赖包列表 +build_dep_pkg_list=" +" + +# TODO: 实际编译动作 +build_tool() { + # mlc是intel提供的可执行文件,直接复制 + cp "${g_tool_dir}/mlc" "${g_install_dir}/mlc" +} + +# 下面代码建议保持不变 +main() { + [ -z "$g_install_dir" ] && g_install_dir="${g_tool_dir}.install" + + if [ -f "$g_install_dir" ]; then + echo "$g_install_dir not dir" + return 1 + elif [ -d "$g_install_dir" ]; then + echo "dir $g_install_dir existed, ignore rebuild" + return 0 + else + echo "build to dir $g_install_dir" + fi + mkdir -p "$g_install_dir" + + { + for pkg in $build_dep_pkg_list; do + echo "check $pkg" + rpm -q "$pkg" || yum install -y "$pkg" + done + build_tool + } 2>&1 | tee "${g_install_dir}/tst-build.log" + if [ "${PIPESTATUS[0]}" -eq 0 ]; then + echo "build $g_tool_dir success, dir $g_install_dir" + return 0 + else + [ -e "${g_install_dir}.fail" ] && rm -rf "${g_install_dir}.fail" + mv "$g_install_dir" "${g_install_dir}.fail" + echo "build $g_tool_dir fail, dir $g_install_dir" + return 1 + fi +} + +main "$@"