aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrzej Janik <[email protected]>2021-12-08 00:29:00 +0100
committerAndrzej Janik <[email protected]>2021-12-08 00:29:00 +0100
commit50e793e869a35875e7ea25d8ad1e9123e89f745f (patch)
tree79c453e724785205c70c1c1b2497e83860a22c00
parentdd915688bdee6cd3f9d1496a0639e280f488a570 (diff)
downloadZLUDA-50e793e869a35875e7ea25d8ad1e9123e89f745f.tar.gz
ZLUDA-50e793e869a35875e7ea25d8ad1e9123e89f745f.zip
Improve logging of dumps
-rw-r--r--zluda_dump/src/dark_api.rs3
-rw-r--r--zluda_dump/src/log.rs14
2 files changed, 14 insertions, 3 deletions
diff --git a/zluda_dump/src/dark_api.rs b/zluda_dump/src/dark_api.rs
index b9fd9c2..3ae50ed 100644
--- a/zluda_dump/src/dark_api.rs
+++ b/zluda_dump/src/dark_api.rs
@@ -491,7 +491,8 @@ unsafe fn record_submodules(
if fatbin_file_kind == FATBIN_FILE_HEADER_KIND_PTX {
let decompressed = decompress_kernel_module(fatbin_file);
match decompressed {
- Some(decompressed) => {
+ Some(mut decompressed) => {
+ decompressed.pop(); // remove trailing zero
state.record_new_submodule(module, version, &*decompressed, fn_logger, "ptx")
}
None => fn_logger.log(log::LogEntry::Lz4DecompressionFailure),
diff --git a/zluda_dump/src/log.rs b/zluda_dump/src/log.rs
index a7dc399..b7416af 100644
--- a/zluda_dump/src/log.rs
+++ b/zluda_dump/src/log.rs
@@ -368,7 +368,7 @@ impl Display for LogEntry {
observed,
} => write!(
f,
- "Unexected field {}. Expected: [{}], observed: {}",
+ #"Unexected field {}. Expected one of: {{{}}}, observed: {}"#,
field_name,
expected
.iter()
@@ -381,7 +381,17 @@ impl Display for LogEntry {
arg_name,
expected,
observed,
- } => write!(f, "Unexected argument"),
+ } => write!(
+ f,
+ "Unexpected argument {}. Expected one of: {{{}}}, observed: {}",
+ arg_name,
+ expected
+ .iter()
+ .map(|x| x.to_string())
+ .collect::<Vec<_>>()
+ .join(", "),
+ observed
+ ),
LogEntry::MalformedFunctionName(e) => e.fmt(f),
LogEntry::FunctionParameter { name, value } => write!(f, "{}: {}", name, value),
}