From cc4ee3d1ba433915c11b4b2fda5c847fa8cfb1bf Mon Sep 17 00:00:00 2001 From: Dmitrii Golovanov Date: Tue, 19 Aug 2025 15:59:07 +0200 Subject: [PATCH 1/2] sof_perf_analyzer: fix float_format not callable error Fix float_format string passed to pandas to_csv() and to_html() to be a callable object resolving 'TypeError: 'str' object is not callable' observed with pandas==2.1.4 Signed-off-by: Dmitrii Golovanov --- tools/sof_perf_analyzer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/sof_perf_analyzer.py b/tools/sof_perf_analyzer.py index 471ed773..4b8916ee 100755 --- a/tools/sof_perf_analyzer.py +++ b/tools/sof_perf_analyzer.py @@ -263,10 +263,10 @@ def print_perf_info(): print(stats) if args.out2csv is not None: - stats.to_csv(args.out2csv, sep=',', float_format='%.3f', index=False) + stats.to_csv(args.out2csv, sep=',', float_format='{:.3f}'.format, index=False) if args.out2html is not None: - stats.to_html(args.out2html, float_format='%.3f', index=False) + stats.to_html(args.out2html, float_format='{:.3f}'.format, index=False) def parse_args(): '''Parse command line arguments''' From 111f7bccd25de159720ac841d8bff6a55529bc5f Mon Sep 17 00:00:00 2001 From: Dmitrii Golovanov Date: Tue, 19 Aug 2025 16:10:24 +0200 Subject: [PATCH 2/2] sof_perf_analyzer: fix missing return statement Fix missing return statement at skip_to_first_trace() pylint R1710 'inconsistent return statement'. Signed-off-by: Dmitrii Golovanov --- tools/sof_perf_analyzer.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/sof_perf_analyzer.py b/tools/sof_perf_analyzer.py index 4b8916ee..42654fb4 100755 --- a/tools/sof_perf_analyzer.py +++ b/tools/sof_perf_analyzer.py @@ -106,6 +106,7 @@ def skip_to_first_trace(trace_item_gen: TraceItemGenerator): # The first trace must have a timestamp with integral part equals to 0. if int(item.timestamp) == 0: return item + return next(trace_item_gen) def make_trace_item(fileio: TextIO) -> TraceItemGenerator: '''Filter and parse a line of trace in string form into TraceItem object, for example: