From 3cfbfe2264c6fe60d1084034fabcb64208ec54e9 Mon Sep 17 00:00:00 2001 From: Giovanni LB Date: Tue, 21 Mar 2023 09:54:23 -0300 Subject: [PATCH] Limited filenames size for ATT plugin (cherry picked from commit e31b7466c3bf9d8e69311752a617097f81d51355) Change-Id: I2efd25e23a7c836df7526f743d68288b696d23b1 [ROCm/rocprofiler commit: 140dc5bb1adac5b966f0abb365efa75dc12ac22e] --- projects/rocprofiler/.gitignore | 1 + projects/rocprofiler/plugin/att/att.cpp | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/projects/rocprofiler/.gitignore b/projects/rocprofiler/.gitignore index 7f0b629fdd..e35a85685c 100644 --- a/projects/rocprofiler/.gitignore +++ b/projects/rocprofiler/.gitignore @@ -2,3 +2,4 @@ build compile_commands.json .cache .DS_Store +plugin/att/__pycache__ diff --git a/projects/rocprofiler/plugin/att/att.cpp b/projects/rocprofiler/plugin/att/att.cpp index 2a3a03c22a..1b5cd9fe64 100644 --- a/projects/rocprofiler/plugin/att/att.cpp +++ b/projects/rocprofiler/plugin/att/att.cpp @@ -45,6 +45,8 @@ #include "rocprofiler_plugin.h" #include "../utils.h" +#define ATT_FILENAME_MAXBYTES 96 + namespace { class att_plugin_t { @@ -79,6 +81,10 @@ class att_plugin_t { std::string name_demangled = rocmtools::truncate_name(rocmtools::cxx_demangle(kernel_name_c)); + if (name_demangled.size() > ATT_FILENAME_MAXBYTES) { // Limit filename size + name_demangled = name_demangled.substr(0, ATT_FILENAME_MAXBYTES); + } + // Get the number of shader engine traces int se_num = att_tracer_record->shader_engine_data_count; std::string outpath;