From f41e9632b800c9fa72e9eb276bffc2f23a352f33 Mon Sep 17 00:00:00 2001 From: Daniel Hill Date: Mon, 5 Jun 2023 16:08:57 -0700 Subject: [PATCH] fixing utf-8 for html and add TMA version (#38) --- README.md | 2 +- _version.txt | 2 +- perf-collect.py | 2 +- perf-postprocess.py | 8 +++++--- release_notes | 12 ------------ 5 files changed, 8 insertions(+), 18 deletions(-) delete mode 100644 release_notes diff --git a/README.md b/README.md index 06ac41b..591ae5d 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [Quick Start](#quick-start-requires-perf-installed) | [Output](#output) | [Requirements](#requirements) | [Build from source](#build-from-source) | [Caveats](#caveats) | [How to contribute](#how-to-contribute) -PerfSpect is a system performance characterization tool built on top of linux perf. It contains two parts +PerfSpect is a system performance characterization tool built on top of linux perf. Most metrics and events come from [perfmon](https://github.com/intel/perfmon) and [TMA v4.5](https://www.intel.com/content/www/us/en/docs/vtune-profiler/cookbook/2023-1/top-down-microarchitecture-analysis-method.html). It contains two parts: perf-collect: Collects harware events diff --git a/_version.txt b/_version.txt index c114700..f2ae0b4 100644 --- a/_version.txt +++ b/_version.txt @@ -1 +1 @@ -1.2.11 +1.2.12 diff --git a/perf-collect.py b/perf-collect.py index 42cc642..d6366f6 100644 --- a/perf-collect.py +++ b/perf-collect.py @@ -362,7 +362,7 @@ def validate_file(fname): start = time.time() subprocess.call(perfargs) # nosec end = time.time() - if end - start < 5: + if end - start < 5.2: logging.warning( "PerfSpect was run for less than 5 seconds, some events make be zero because they didn't get scheduled" ) diff --git a/perf-postprocess.py b/perf-postprocess.py index c53386a..00a384c 100644 --- a/perf-postprocess.py +++ b/perf-postprocess.py @@ -584,7 +584,7 @@ def write_html(time_series_df, perf_mode, out_file_path): crash("Unknown application type") html = "" - with open(html_file, "r") as f_html: + with open(html_file, "r", encoding="utf-8") as f_html: html = f_html.read() # only show TMA if system-wide mode @@ -618,7 +618,9 @@ def write_html(time_series_df, perf_mode, out_file_path): ]: html = html.replace(number[0], str(avg.loc[number[1], 0])) - with open(os.path.splitext(out_file_path)[0] + ".html", "w") as file: + with open( + os.path.splitext(out_file_path)[0] + ".html", "w", encoding="utf-8" + ) as file: file.write(html) @@ -657,7 +659,7 @@ def generate_metrics( group_to_start_end_indexes = {} for time_slice, item in time_slice_groups: time_slice_float = float(time_slice) - if time_slice_float - prev_time_slice < 5: + if time_slice_float - prev_time_slice < 4.5: logging.warning("throwing out last sample because it was too short") continue time_slice_df = time_slice_groups.get_group(time_slice).copy() diff --git a/release_notes b/release_notes deleted file mode 100644 index 0431e60..0000000 --- a/release_notes +++ /dev/null @@ -1,12 +0,0 @@ -RELEASE NOTES - -PerfSpect - -* v1.2.0 -PerfSpect supports BDX, SKX, CLX, ICX and SPR - -* v1.1.1 -Added support for AWS instances using cloud and cloudtype flag - -* v1.1.0 -PerfSpect supports BDX, SKX, CLX and ICX \ No newline at end of file