From 1a5f6cc6eb12313513032af94443adcee0ccaad8 Mon Sep 17 00:00:00 2001 From: Jian Zhao Date: Sat, 27 Dec 2025 23:53:55 +0800 Subject: [PATCH 1/6] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dlat=5Fpipe?= =?UTF-8?q?=E7=94=A8=E4=BE=8B=E5=90=8D=E7=A7=B0=E4=B8=8D=E5=8C=B9=E9=85=8D?= =?UTF-8?q?=E5=B9=B6=E4=BF=AE=E6=AD=A3L0=E6=A0=87=E7=AD=BE=E5=88=86?= =?UTF-8?q?=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修复tperf-lmbench-lat_pipe-n11用例名称错误,从"tperf-lmbench-lat_pipe"改为"tperf-lmbench-lat_pipe-n11" - 为n11用例添加-N 11参数,与文件名保持一致 - 将所有lat_pipe用例(n3/n5/n7/n9/n11)的L0标签从"net"改为"sched" 修复后CSV模板中的用例名可以正确匹配到对应的测试用例文件,解决执行失败问题。 --- testcase/tperf-lmbench-lat_pipe-n11.py | 6 +++--- testcase/tperf-lmbench-lat_pipe-n3.py | 2 +- testcase/tperf-lmbench-lat_pipe-n5.py | 2 +- testcase/tperf-lmbench-lat_pipe-n7.py | 2 +- testcase/tperf-lmbench-lat_pipe-n9.py | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/testcase/tperf-lmbench-lat_pipe-n11.py b/testcase/tperf-lmbench-lat_pipe-n11.py index 24cce1b..de96d0c 100755 --- a/testcase/tperf-lmbench-lat_pipe-n11.py +++ b/testcase/tperf-lmbench-lat_pipe-n11.py @@ -18,7 +18,7 @@ from lib.ts_common import MyTestCase, PerfLMbench # noqa: E402 class PythonTestCase(MyTestCase): """ @用例ID: 20250715-200002-000000037 - @用例名称: tperf-lmbench-lat_pipe + @用例名称: tperf-lmbench-lat_pipe-n11 @用例级别: 3 @用例标签: @用例类型: 性能测试 @@ -39,8 +39,8 @@ class PythonTestCase(MyTestCase): perf = PerfLMbench( name="lat_pipe", testname=self.tc_name, - label="L0:net", - general_opt="-P 1" + label="L0:sched", + general_opt="-P 1 -N 11" ) perf.run(warmup=0, run_loop=30, result_select_percent=70) perf.report(testcase=self) diff --git a/testcase/tperf-lmbench-lat_pipe-n3.py b/testcase/tperf-lmbench-lat_pipe-n3.py index 57863cf..fd7c0bc 100755 --- a/testcase/tperf-lmbench-lat_pipe-n3.py +++ b/testcase/tperf-lmbench-lat_pipe-n3.py @@ -39,7 +39,7 @@ class PythonTestCase(MyTestCase): perf = PerfLMbench( name="lat_pipe", testname=self.tc_name, - label="L0:net", + label="L0:sched", general_opt="-P 1 -N 3" ) perf.run(warmup=0, run_loop=30, result_select_percent=70) diff --git a/testcase/tperf-lmbench-lat_pipe-n5.py b/testcase/tperf-lmbench-lat_pipe-n5.py index 0a5d463..4a20ce3 100755 --- a/testcase/tperf-lmbench-lat_pipe-n5.py +++ b/testcase/tperf-lmbench-lat_pipe-n5.py @@ -39,7 +39,7 @@ class PythonTestCase(MyTestCase): perf = PerfLMbench( name="lat_pipe", testname=self.tc_name, - label="L0:net", + label="L0:sched", general_opt="-P 1 -N 5" ) perf.run(warmup=0, run_loop=30, result_select_percent=70) diff --git a/testcase/tperf-lmbench-lat_pipe-n7.py b/testcase/tperf-lmbench-lat_pipe-n7.py index f006ae7..a1d2e7c 100755 --- a/testcase/tperf-lmbench-lat_pipe-n7.py +++ b/testcase/tperf-lmbench-lat_pipe-n7.py @@ -39,7 +39,7 @@ class PythonTestCase(MyTestCase): perf = PerfLMbench( name="lat_pipe", testname=self.tc_name, - label="L0:net", + label="L0:sched", general_opt="-P 1 -N 7" ) perf.run(warmup=0, run_loop=30, result_select_percent=70) diff --git a/testcase/tperf-lmbench-lat_pipe-n9.py b/testcase/tperf-lmbench-lat_pipe-n9.py index d0597b0..161a121 100755 --- a/testcase/tperf-lmbench-lat_pipe-n9.py +++ b/testcase/tperf-lmbench-lat_pipe-n9.py @@ -39,7 +39,7 @@ class PythonTestCase(MyTestCase): perf = PerfLMbench( name="lat_pipe", testname=self.tc_name, - label="L0:net", + label="L0:sched", general_opt="-P 1 -N 9" ) perf.run(warmup=0, run_loop=30, result_select_percent=70) -- Gitee From bb02964275cafb94f4910a97e773a91f4c8ab353 Mon Sep 17 00:00:00 2001 From: Jian Zhao Date: Sun, 28 Dec 2025 00:05:02 +0800 Subject: [PATCH 2/6] =?UTF-8?q?fix:=20=E7=A1=AE=E4=BF=9D=E5=8D=B3=E4=BD=BF?= =?UTF-8?q?=E6=9C=89=E5=A4=B1=E8=B4=A5=E7=9A=84=E7=94=A8=E4=BE=8B=E4=B9=9F?= =?UTF-8?q?=E8=BE=93=E5=87=BA=E8=BD=AE=E6=AC=A1=E8=80=97=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 使用try-finally结构,确保无论run_tperf()是否抛出异常, 都会在finally块中计算并输出轮次耗时信息。 修复前:当有失败的用例时,run_tperf()抛出RuntimeError, 导致轮次耗时计算代码不执行,无法看到执行时间。 修复后:即使有异常,也会输出类似"loop 1 cost X hours Y minutes Z seconds"的耗时信息。 --- tperf.py | 45 ++++++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/tperf.py b/tperf.py index fea136b..e5bda5f 100755 --- a/tperf.py +++ b/tperf.py @@ -577,28 +577,31 @@ def main(): result_dict = {} for loop in range(1, args.loop + 1): time_loop_start = time.time() - msg(f"run loop {loop}/{args.loop}") - data_dir = os.path.join(tperf_top_dir, "logs", "perf") - case_log_dir = os.path.join(tperf_top_dir, "logs", "testcase") - if os.path.exists(data_dir): - shutil.rmtree(data_dir) - if os.path.exists(case_log_dir): - shutil.rmtree(case_log_dir) loop_dir = os.path.join(result_dir, f"loop-{loop:03}") - os.makedirs(loop_dir) - with open(os.path.join(loop_dir, "env-info.json"), "w") as f: - json.dump(get_node_env_info(config=config), f, indent=4, ensure_ascii=False) - result_dict[loop] = run_tperf(template=template, runner_id=runner_id) - dbg(result_dict[loop]) - shutil.move(src=data_dir, dst=os.path.join(loop_dir, "perf")) - shutil.move(src=case_log_dir, dst=os.path.join(loop_dir, "testcase")) - with open(f"{loop_dir}.json", "w") as f: - json.dump(result_dict[loop], f, indent=4, ensure_ascii=False) - time_loop_cost = time.time() - time_loop_start - loop_hour = int(time_loop_cost / 3600) - loop_min = int((time_loop_cost % 3600) / 60) - loop_sec = int(time_loop_cost % 60) - msg(f"loop {loop} cost {loop_hour} hours {loop_min} minutes {loop_sec} seconds, dir: {loop_dir}") + try: + msg(f"run loop {loop}/{args.loop}") + data_dir = os.path.join(tperf_top_dir, "logs", "perf") + case_log_dir = os.path.join(tperf_top_dir, "logs", "testcase") + if os.path.exists(data_dir): + shutil.rmtree(data_dir) + if os.path.exists(case_log_dir): + shutil.rmtree(case_log_dir) + os.makedirs(loop_dir) + with open(os.path.join(loop_dir, "env-info.json"), "w") as f: + json.dump(get_node_env_info(config=config), f, indent=4, ensure_ascii=False) + result_dict[loop] = run_tperf(template=template, runner_id=runner_id) + dbg(result_dict[loop]) + shutil.move(src=data_dir, dst=os.path.join(loop_dir, "perf")) + shutil.move(src=case_log_dir, dst=os.path.join(loop_dir, "testcase")) + with open(f"{loop_dir}.json", "w") as f: + json.dump(result_dict[loop], f, indent=4, ensure_ascii=False) + finally: + # 即使有异常也输出轮次耗时 + time_loop_cost = time.time() - time_loop_start + loop_hour = int(time_loop_cost / 3600) + loop_min = int((time_loop_cost % 3600) / 60) + loop_sec = int(time_loop_cost % 60) + msg(f"loop {loop} cost {loop_hour} hours {loop_min} minutes {loop_sec} seconds, dir: {loop_dir}") dbg(json.dumps(result_dict, indent=4, ensure_ascii=False)) result_json = os.path.join(result_dir, f"report-{runner_id}.json") -- Gitee From b7d4842c1a25dd2cbb70019f00366646388f1fe7 Mon Sep 17 00:00:00 2001 From: Jian Zhao Date: Sun, 28 Dec 2025 23:10:34 +0800 Subject: [PATCH 3/6] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0parse=5Fresult=5F?= =?UTF-8?q?json.py=E8=84=9A=E6=9C=AC=E7=94=A8=E4=BA=8E=E8=A7=A3=E6=9E=90?= =?UTF-8?q?=E5=92=8C=E7=BB=9F=E8=AE=A1JSON=E6=B5=8B=E8=AF=95=E7=BB=93?= =?UTF-8?q?=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 支持解析loop-001.json或base.json等JSON结果文件 - 统计测试case和指标数量,按L0维度(调度、内存、存储、网络)分类 - 按子系统前缀进行详细统计,内存子系统自动合并相同前缀的case - 支持显示top N耗时最长的case(默认top 10) - 计算所有case的duration总和并转换为小时、分钟、秒格式 Signed-off-by: Jian Zhao --- base/parse_result_json.py | 193 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 193 insertions(+) create mode 100755 base/parse_result_json.py diff --git a/base/parse_result_json.py b/base/parse_result_json.py new file mode 100755 index 0000000..8f99bb5 --- /dev/null +++ b/base/parse_result_json.py @@ -0,0 +1,193 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +""" +解析loop-001.json或者base.json文件,统计测试case和指标信息 +""" + +import json +import argparse +from collections import defaultdict +from typing import Dict, List, Tuple + + +def parse_json_file(file_path: str) -> Dict: + """读取并解析JSON文件""" + with open(file_path, 'r', encoding='utf-8') as f: + return json.load(f) + + +def extract_case_prefix(case_name: str, l0: str = None) -> str: + """从case名称中提取前缀(子系统名称) + 例如: tperf-fio-ext4-randread4K -> tperf-fio-ext4 + 对于内存子系统,去掉第三字段的下划线和后面的内容 + 例如: tperf-libmicro-mallocT2_100k -> tperf-libmicro-mallocT2 + """ + parts = case_name.split('-') + if len(parts) >= 3: + prefix = '-'.join(parts[:3]) + # 如果是内存子系统,去掉第三字段的下划线和后面的内容 + if l0 == '内存' and '_' in parts[2]: + parts[2] = parts[2].split('_')[0] + prefix = '-'.join(parts[:3]) + return prefix + return case_name + + +def analyze_cases(data: Dict) -> Tuple[Dict, Dict, Dict, float]: + """ + 分析case数据 + 返回: + - l0_stats: 按L0分类的统计 {L0: {'cases': set, 'metrics': int}} + - prefix_stats: 按case前缀分类的统计 {prefix: {'cases': set, 'metrics': int, 'l0': str}} + - case_durations: case名称和duration的列表 [(case_name, duration, l0), ...] + - total_duration: 总duration + """ + l0_stats = defaultdict(lambda: {'cases': set(), 'metrics': 0}) + prefix_stats = defaultdict(lambda: {'cases': set(), 'metrics': 0, 'l0': None}) + case_durations = [] + total_duration = 0.0 + + for case_name, case_data in data.items(): + duration = case_data.get('duration', 0.0) + total_duration += duration + + result = case_data.get('result', {}) + + # 获取该case的L0分类(从第一个指标中获取) + l0 = None + for metric_name, metric_data in result.items(): + if isinstance(metric_data, dict): + l0 = metric_data.get('L0', '') + break + + if l0 is None: + l0 = '未知' + + # 统计指标数量 + metric_count = len(result) + + # 更新L0统计 + l0_stats[l0]['cases'].add(case_name) + l0_stats[l0]['metrics'] += metric_count + + # 更新前缀统计 + prefix = extract_case_prefix(case_name, l0) + prefix_stats[prefix]['cases'].add(case_name) + prefix_stats[prefix]['metrics'] += metric_count + prefix_stats[prefix]['l0'] = l0 + + # 记录duration信息 + case_durations.append((case_name, duration, l0)) + + return l0_stats, prefix_stats, case_durations, total_duration + + +def format_duration(seconds: float) -> str: + """将秒数转换为小时、分钟、秒格式""" + hours = int(seconds // 3600) + minutes = int((seconds % 3600) // 60) + secs = seconds % 60 + return f"{hours}小时 {minutes}分钟 {secs:.3f}秒" + + +def print_summary(l0_stats: Dict, prefix_stats: Dict, case_durations: List[Tuple], + total_duration: float, top_n: int = 10, reverse: bool = True): + """打印统计结果 + Args: + l0_stats: L0分类统计 + prefix_stats: 前缀分类统计 + case_durations: case duration列表 + total_duration: 总duration + top_n: 显示top N耗时case + reverse: True表示降序(耗时最长的在前),False表示升序(耗时最短的在前) + """ + # 计算总数 + total_cases = sum(len(stats['cases']) for stats in l0_stats.values()) + total_metrics = sum(stats['metrics'] for stats in l0_stats.values()) + + print(f"总Case数: {total_cases}") + print(f"总指标数: {total_metrics}") + print() + + # 各维度统计 + print("各维度统计:") + print("-" * 80) + for l0 in sorted(l0_stats.keys()): + stats = l0_stats[l0] + case_count = len(stats['cases']) + metric_count = stats['metrics'] + print(f"{l0:8s} : Case={case_count:4d}, 指标={metric_count:4d}") + print() + + # 各子系统详细统计 + print("=" * 80) + print("各子系统详细统计:") + print("=" * 80) + print() + + # 按L0分组打印 + l0_prefixes = defaultdict(list) + for prefix, stats in prefix_stats.items(): + l0 = stats['l0'] or '未知' + l0_prefixes[l0].append((prefix, stats)) + + for l0 in sorted(l0_prefixes.keys()): + print(f"{l0}子系统:") + print("-" * 80) + + prefixes = sorted(l0_prefixes[l0], key=lambda x: x[0]) + for prefix, stats in prefixes: + case_count = len(stats['cases']) + metric_count = stats['metrics'] + print(f" {prefix:50s} : Case={case_count:4d}, 指标={metric_count:4d}") + + # 计算该L0的总数 + l0_case_total = sum(len(s['cases']) for _, s in prefixes) + l0_metric_total = sum(s['metrics'] for _, s in prefixes) + print(f"{' ':50s} Case共{l0_case_total}, 指标共{l0_metric_total}") + print() + + # Top N耗时Case + if top_n > 0: + print("=" * 80) + order_desc = "降序" if reverse else "升序" + print(f"Top {top_n} 耗时Case ({order_desc}):") + print("=" * 80) + print() + + sorted_cases = sorted(case_durations, key=lambda x: x[1], reverse=reverse) + for i, (case_name, duration, l0) in enumerate(sorted_cases[:top_n], 1): + percentage = (duration / total_duration * 100) if total_duration > 0 else 0 + print(f"{i:3d}. {case_name:60s} | {l0:4s} | duration={duration:10.3f} | 占比={percentage:6.2f}%") + print() + + # 总duration + print("=" * 80) + print(f"所有Case的duration总和: {total_duration:.3f}秒 ({format_duration(total_duration)})") + if total_cases > 0: + avg_duration = total_duration / total_cases + avg_percentage = (avg_duration / total_duration) * 100 if total_duration > 0 else 0 + print(f"平均每个Case耗时: {avg_duration:.3f}秒 ({format_duration(avg_duration)}), 占比: {avg_percentage:.4f}%") + print("=" * 80) + + +def main(): + parser = argparse.ArgumentParser(description='解析JSON结果文件,统计测试case和指标信息') + parser.add_argument('json_file', help='JSON文件路径') + parser.add_argument('--top', type=int, default=10, help='显示top N耗时最长的case(默认10,设为0可禁用)') + parser.add_argument('--asc', action='store_true', help='Top N耗时Case按升序排列(耗时最短的在前),默认是降序') + + args = parser.parse_args() + + # 解析JSON文件 + data = parse_json_file(args.json_file) + + # 分析数据 + l0_stats, prefix_stats, case_durations, total_duration = analyze_cases(data) + + # 打印结果 + print_summary(l0_stats, prefix_stats, case_durations, total_duration, args.top, reverse=not args.asc) + + +if __name__ == '__main__': + main() -- Gitee From 8fcbd830a48267039c1151356f3d5a23b0a230a2 Mon Sep 17 00:00:00 2001 From: Jian Zhao Date: Sun, 28 Dec 2025 23:21:19 +0800 Subject: [PATCH 4/6] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96stat=5Ftperf=5Fcs?= =?UTF-8?q?v.py=E6=B7=BB=E5=8A=A0=E9=87=8D=E5=A4=8D=E6=A3=80=E6=B5=8B?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=B9=B6=E4=BF=AE=E5=A4=8DCSV=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在stat_tperf_csv.py中添加重复检测功能: * 检测重复的Case名(跨子系统或同一子系统内重复) * 检测重复的指标名(同一Case内重复) * 输出详细的告警信息,包括Case名、子系统、指标名和出现位置(行号) - 修复templates/tperf.csv中重复的tperf-stream-single case数据 - 帮助及时发现和修复CSV配置文件中的数据重复问题 Signed-off-by: Jian Zhao --- templates/stat_tperf_csv.py | 76 +++++++++++++++++++++++++++++++++++++ templates/tperf.csv | 4 -- 2 files changed, 76 insertions(+), 4 deletions(-) diff --git a/templates/stat_tperf_csv.py b/templates/stat_tperf_csv.py index 2506e89..ed0252f 100755 --- a/templates/stat_tperf_csv.py +++ b/templates/stat_tperf_csv.py @@ -53,6 +53,12 @@ def stat_csv(csv_file): current_dimension = None current_case_name = None + # 用于检测重复的字典 + case_to_dimension = {} # case名 -> 维度列表(可能有多个维度) + case_positions = defaultdict(list) # case名 -> 行号列表 + metric_to_cases = defaultdict(set) # 指标名 -> case名集合 + case_metrics = defaultdict(lambda: defaultdict(list)) # case名 -> {指标名: [行号列表]} + with open(csv_file, 'r', encoding='utf-8') as f: # 跳过前5行说明 for _ in range(5): @@ -81,9 +87,16 @@ def stat_csv(csv_file): if case_name: total_cases += 1 current_case_name = case_name + # 记录case的位置和维度 + case_positions[case_name].append(line_num) if dimension: case_count_by_dimension[dimension] += 1 current_dimension = dimension + # 记录case所属的维度 + if case_name not in case_to_dimension: + case_to_dimension[case_name] = [] + if dimension not in case_to_dimension[case_name]: + case_to_dimension[case_name].append(dimension) case_type = extract_case_type(case_name, dimension) if case_type: case_stats_by_dimension[dimension][case_type]['cases'] += 1 @@ -91,6 +104,11 @@ def stat_csv(csv_file): # 统计指标(所有行都算指标,但需要有效的指标名) if metric_name: total_metrics += 1 + # 记录指标和case的关联关系 + if current_case_name: + metric_to_cases[metric_name].add(current_case_name) + # 记录每个case中的指标名和行号 + case_metrics[current_case_name][metric_name].append(line_num) # 如果当前行没有维度,使用上一个 Case 的维度 if dimension: metric_count_by_dimension[dimension] += 1 @@ -111,6 +129,10 @@ def stat_csv(csv_file): 'case_count_by_dimension': dict(case_count_by_dimension), 'metric_count_by_dimension': dict(metric_count_by_dimension), 'case_stats_by_dimension': dict(case_stats_by_dimension), + 'case_to_dimension': case_to_dimension, + 'case_positions': dict(case_positions), + 'metric_to_cases': dict(metric_to_cases), + 'case_metrics': dict(case_metrics), } def main(): @@ -182,6 +204,60 @@ def main(): print() print("=" * 80) + # 检测重复的case名 + duplicate_cases = [] + for case_name, dimensions in stats['case_to_dimension'].items(): + if len(dimensions) > 1: + # case出现在多个维度中 + duplicate_cases.append((case_name, dimensions, stats['case_positions'][case_name])) + elif len(stats['case_positions'][case_name]) > 1: + # case在同一维度中出现多次 + duplicate_cases.append((case_name, dimensions, stats['case_positions'][case_name])) + + # 检测重复的指标名(同一个case中重复的指标名) + duplicate_metrics = [] + for case_name, metrics_dict in stats['case_metrics'].items(): + for metric_name, positions in metrics_dict.items(): + if len(positions) > 1: + # 获取case所属的子系统 + case_dims = stats['case_to_dimension'].get(case_name, ['未知']) + dim_str = ', '.join(case_dims) if case_dims else '未知' + duplicate_metrics.append((case_name, metric_name, dim_str, positions)) + + # 输出告警信息 + if duplicate_cases or duplicate_metrics: + print() + print("=" * 80) + print("⚠️ 重复检测告警:") + print("=" * 80) + print() + + if duplicate_cases: + print("❌ 发现重复的Case名:") + print("-" * 80) + for case_name, dimensions, positions in duplicate_cases: + if len(dimensions) > 1: + print(f" Case名: {case_name}") + print(f" 出现在多个子系统: {', '.join(dimensions)}") + print(f" 出现位置(行号): {', '.join(map(str, positions))}") + else: + print(f" Case名: {case_name}") + print(f" 子系统: {dimensions[0]}") + print(f" 重复出现 {len(positions)} 次,位置(行号): {', '.join(map(str, positions))}") + print() + + if duplicate_metrics: + print("❌ 发现重复的指标名:") + print("-" * 80) + for case_name, metric_name, dim_str, positions in duplicate_metrics: + print(f" Case名: {case_name}") + print(f" 子系统: {dim_str}") + print(f" 指标名: {metric_name}") + print(f" 重复出现 {len(positions)} 次,位置(行号): {', '.join(map(str, positions))}") + print() + + print("=" * 80) + except FileNotFoundError: print(f"错误: 文件 {csv_file} 不存在", file=sys.stderr) sys.exit(1) diff --git a/templates/tperf.csv b/templates/tperf.csv index a229c92..5d65af2 100644 --- a/templates/tperf.csv +++ b/templates/tperf.csv @@ -820,10 +820,6 @@ tperf-rt-tests-hackbench-thread-socket-fds40-groups10,tperf-rt-tests-hackbench-t tperf-rt-tests-hackbench-thread-socket-fds5-groups100,tperf-rt-tests-hackbench-thread-socket-fds5-groups100,调度,,,60 tperf-rt-tests-hackbench-thread-socket-fds60-groups10,tperf-rt-tests-hackbench-thread-socket-fds60-groups10,调度,,,30 tperf-rt-tests-hackbench-thread-socket-fds80-groups10,tperf-rt-tests-hackbench-thread-socket-fds80-groups10,调度,,,40 -tperf-stream-single,stream-single-thread-Add,内存,,,50 -,stream-single-thread-Copy,内存,,,50 -,stream-single-thread-Scale,内存,,,50 -,stream-single-thread-Triad,内存,,,50 tperf-sysbench-threads-16-locks-48-yields-1000,tperf-sysbench-threads-16-locks-48-yields-1000,调度,,,30 tperf-sysbench-threads-16-locks-48-yields-10000,tperf-sysbench-threads-16-locks-48-yields-10000,调度,,,90 tperf-sysbench-threads-16-locks-96-yields-1000,tperf-sysbench-threads-16-locks-96-yields-1000,调度,,,30 -- Gitee From 26fa97d21dd4fa2e3267f4795293add07c844a1f Mon Sep 17 00:00:00 2001 From: Jian Zhao Date: Sun, 28 Dec 2025 23:50:50 +0800 Subject: [PATCH 5/6] =?UTF-8?q?refactor:=20=E5=B0=86lmbench=20lat=5Fpipe?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=94=A8=E4=BE=8B=E4=BB=8En11=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E4=B8=BAn1=E5=B9=B6=E6=9B=B4=E6=96=B0=E6=9D=83?= =?UTF-8?q?=E9=87=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 重命名testcase文件:tperf-lmbench-lat_pipe-n11.py -> tperf-lmbench-lat_pipe-n1.py - 更新templates/tperf.csv: * 将tperf-lmbench-lat_pipe-n11改为tperf-lmbench-lat_pipe-n1,权重从90调整为20 * 调整其他lat_pipe用例权重:n3(20->40), n5(40->60), n7(60->80), n9(80->90) - 更新templates/tperf.daily.csv: * 将tperf-lmbench-lat_pipe-n11改为tperf-lmbench-lat_pipe-n1,权重从90调整为20 - 统一测试用例命名和权重配置 Signed-off-by: Jian Zhao --- templates/tperf.csv | 10 +++++----- templates/tperf.daily.csv | 2 +- ...ch-lat_pipe-n11.py => tperf-lmbench-lat_pipe-n1.py} | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) rename testcase/{tperf-lmbench-lat_pipe-n11.py => tperf-lmbench-lat_pipe-n1.py} (94%) diff --git a/templates/tperf.csv b/templates/tperf.csv index 5d65af2..3492f14 100644 --- a/templates/tperf.csv +++ b/templates/tperf.csv @@ -779,11 +779,11 @@ tperf-lmbench-lat_ctx-8k-3p,tperf-lmbench-lat_ctx-8k-3p,调度,,,10 tperf-lmbench-lat_ctx-8k-48p,tperf-lmbench-lat_ctx-8k-48p,调度,,,80 tperf-lmbench-lat_ctx-8k-6p,tperf-lmbench-lat_ctx-8k-6p,调度,,,20 tperf-lmbench-lat_ctx-8k-96p,tperf-lmbench-lat_ctx-8k-96p,调度,,,90 -tperf-lmbench-lat_pipe-n11,tperf-lmbench-lat_pipe-n11,调度,,,90 -tperf-lmbench-lat_pipe-n3,tperf-lmbench-lat_pipe-n3,调度,,,20 -tperf-lmbench-lat_pipe-n5,tperf-lmbench-lat_pipe-n5,调度,,,40 -tperf-lmbench-lat_pipe-n7,tperf-lmbench-lat_pipe-n7,调度,,,60 -tperf-lmbench-lat_pipe-n9,tperf-lmbench-lat_pipe-n9,调度,,,80 +tperf-lmbench-lat_pipe-n11,tperf-lmbench-lat_pipe-n1,调度,,,20 +tperf-lmbench-lat_pipe-n3,tperf-lmbench-lat_pipe-n3,调度,,,40 +tperf-lmbench-lat_pipe-n5,tperf-lmbench-lat_pipe-n5,调度,,,60 +tperf-lmbench-lat_pipe-n7,tperf-lmbench-lat_pipe-n7,调度,,,80 +tperf-lmbench-lat_pipe-n9,tperf-lmbench-lat_pipe-n9,调度,,,90 tperf-rt-tests-hackbench-process-pipe-fds100-groups10,tperf-rt-tests-hackbench-process-pipe-fds100-groups10,调度,,,50 tperf-rt-tests-hackbench-process-pipe-fds10-groups100,tperf-rt-tests-hackbench-process-pipe-fds10-groups100,调度,,,70 tperf-rt-tests-hackbench-process-pipe-fds15-groups100,tperf-rt-tests-hackbench-process-pipe-fds15-groups100,调度,,,80 diff --git a/templates/tperf.daily.csv b/templates/tperf.daily.csv index c7a90bc..e103f4a 100644 --- a/templates/tperf.daily.csv +++ b/templates/tperf.daily.csv @@ -125,7 +125,7 @@ tperf-lmbench-lat_ctx-64k-48p,tperf-lmbench-lat_ctx-64k-48p,调度,,,80 tperf-lmbench-lat_ctx-64k-96p,tperf-lmbench-lat_ctx-64k-96p,调度,,,90 tperf-lmbench-lat_mmap,tperf-lmbench-lat_mmap,内存,,,50 tperf-lmbench-lat_pagefault,tperf-lmbench-lat_pagefault,内存,,,50 -tperf-lmbench-lat_pipe-n11,tperf-lmbench-lat_pipe-n11,调度,,,90 +tperf-lmbench-lat_pipe-n1,tperf-lmbench-lat_pipe-n1,调度,,,20 tperf-lmbench-lat_proc-exec,tperf-lmbench-lat_proc-exec,内存,,,50 tperf-lmbench-lat_proc-fork,tperf-lmbench-lat_proc-fork,内存,,,50 tperf-lmbench-lat_proc-shell,tperf-lmbench-lat_proc-shell,内存,,,50 diff --git a/testcase/tperf-lmbench-lat_pipe-n11.py b/testcase/tperf-lmbench-lat_pipe-n1.py similarity index 94% rename from testcase/tperf-lmbench-lat_pipe-n11.py rename to testcase/tperf-lmbench-lat_pipe-n1.py index de96d0c..ba15298 100755 --- a/testcase/tperf-lmbench-lat_pipe-n11.py +++ b/testcase/tperf-lmbench-lat_pipe-n1.py @@ -18,7 +18,7 @@ from lib.ts_common import MyTestCase, PerfLMbench # noqa: E402 class PythonTestCase(MyTestCase): """ @用例ID: 20250715-200002-000000037 - @用例名称: tperf-lmbench-lat_pipe-n11 + @用例名称: tperf-lmbench-lat_pipe-n1 @用例级别: 3 @用例标签: @用例类型: 性能测试 @@ -40,7 +40,7 @@ class PythonTestCase(MyTestCase): name="lat_pipe", testname=self.tc_name, label="L0:sched", - general_opt="-P 1 -N 11" + general_opt="-P 1 -N 1" ) perf.run(warmup=0, run_loop=30, result_select_percent=70) perf.report(testcase=self) -- Gitee From ae82aacdb2f61a1932525591ccdc6da90073ed67 Mon Sep 17 00:00:00 2001 From: Jian Zhao Date: Mon, 29 Dec 2025 10:37:55 +0800 Subject: [PATCH 6/6] =?UTF-8?q?feat:=20=E5=9C=A8configure=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E4=B8=AD=E6=B7=BB=E5=8A=A0Python=E4=BE=9D=E8=B5=96?= =?UTF-8?q?=E5=8C=85=E5=AE=89=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加numpy和openpyxl的pip3安装 - 支持测试结果解析和Excel导出功能 Signed-off-by: Jian Zhao --- configure | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 4b6b8bb..f020833 100755 --- a/configure +++ b/configure @@ -16,10 +16,19 @@ main() { libtool glibc-devel numactl - numactl-devel" + numactl-devel + python3-pip" # shellcheck disable=SC2086 yum install --skip-broken -y $pkg_to_install + pip3_packages="numpy openpyxl" + for pkg in $pip3_packages; do + pip3 install "$pkg" || { + echo "Warning: Failed to install $pkg" + _main_ret=1 + } + done + return ${_main_ret} } -- Gitee