From ac660e2c9227b844a4bf0003de09aedc37313eea Mon Sep 17 00:00:00 2001 From: Kiumars Sabeti Date: Tue, 24 Jan 2023 18:27:58 -0500 Subject: [PATCH] SWDEV-360818: Reserved fields of hip structures are undefined. Because of that, reserved fields may contain special characters that are not readable by postprocessing Python script. To patch this issue, here we modify script that generates hip_ostream_ops.h to set reserved fields of hip structures to 0. Change-Id: I0cda5cedfa30b140f121803dd8c066107ae0756e [ROCm/roctracer commit: 397b3b10af05a8cfc3dbfa6949cf32e8e9e07f14] --- projects/roctracer/script/gen_ostream_ops.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/projects/roctracer/script/gen_ostream_ops.py b/projects/roctracer/script/gen_ostream_ops.py index 2e4e662083..8239f5860b 100755 --- a/projects/roctracer/script/gen_ostream_ops.py +++ b/projects/roctracer/script/gen_ostream_ops.py @@ -154,7 +154,10 @@ def process_struct(file_handle, cppHeader_struct, cppHeader, parent_hier_name, a str += " if (std::string(\"" + cppHeader_struct + "::" + name + "\").find(" + apiname.upper() + "_structs_regex" + ") != std::string::npos) {\n" indent = " " str += indent + " std::operator<<(out, \"" + name + "=\");\n" - str += indent + " roctracer::" + apiname.lower() + "_support::detail::operator<<(out, v." + name + ");\n" + if (name == 'reserved' and apiname.upper() == 'HIP'): + str += indent + " roctracer::" + apiname.lower() + "_support::detail::operator<<(out, 0);\n" + else: + str += indent + " roctracer::" + apiname.lower() + "_support::detail::operator<<(out, v." + name + ");\n" str += indent + " std::operator<<(out, \", \");\n" str += " }\n" if "void" not in mtype: