SWDEV-361847 - Print 'char' parameters as 'integer'

When printing HIP API function parameters, use the integer format to
print 'char' arguments to avoid printing invalid ASCII characters
(value > 127).

Make sure the roctracer::hip_support::detail operator<< overloads are
used when printing arguments.

Change-Id: Id072c2ed19b1b4166108599e393d1cae6c54b6b0
This commit is contained in:
Laurent Morichetti
2022-10-13 17:21:28 -07:00
committed by Laurent Morichetti
parent f2fbe4938e
commit 19107858d6
2 changed files with 1040 additions and 1040 deletions
File diff suppressed because it is too large Load Diff
+4 -4
View File
@@ -559,13 +559,13 @@ def generate_prof_header(f, api_map, callback_ids, opts_map):
line_shift = ' '
f.write(line_shift)
if ptr_type != '':
f.write('if (' + var_name + ' == NULL) ' + oss_stream + 'NULL";\n' + line_shift + 'else ')
f.write('if (' + var_name + ' == NULL) ' + oss_stream + 'NULL";\n' + line_shift + 'else { ')
if pointer_ck(ptr_type) != '':
f.write(oss_stream + '" << (void*)' + var_name + '__val' + ';\n')
f.write(oss_stream + '"; roctracer::hip_support::detail::operator<<(oss, (void*)' + var_name + '__val' + '); }\n')
else:
f.write(oss_stream + '" << ' + var_name + '__val' + ';\n')
f.write(oss_stream + '"; roctracer::hip_support::detail::operator<<(oss, ' + var_name + '__val' + '); }\n')
else:
f.write(oss_stream + '" << ' + var_name + ';\n')
f.write(oss_stream + '"; roctracer::hip_support::detail::operator<<(oss, ' + var_name + ');\n')
f.write(' oss << ")";\n')
f.write(' break;\n')
f.write(' default: oss << "unknown";\n')