diff mbox series

[2/2] libpdbg: Add diagnostic trace information for FSI

Message ID 20200327013016.31197-2-alistair@popple.id.au
State Accepted
Headers show
Series [1/2] libpdbg: Improve diagnostic traces for PIB access | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success Successfully applied on branch master (8b4611b5d8e7e2279fe4aa80c892fcfe10aa398d)
snowpatch_ozlabs/build-multiarch success Test build-multiarch on branch master

Commit Message

Alistair Popple March 27, 2020, 1:30 a.m. UTC
Signed-off-by: Alistair Popple <alistair@popple.id.au>
---
 libpdbg/target.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/libpdbg/target.c b/libpdbg/target.c
index 8cc6f7f..501e019 100644
--- a/libpdbg/target.c
+++ b/libpdbg/target.c
@@ -226,22 +226,31 @@  int opb_write(struct pdbg_target *opb_dt, uint32_t addr, uint32_t data)
 int fsi_read(struct pdbg_target *fsi_dt, uint32_t addr, uint32_t *data)
 {
 	struct fsi *fsi;
+	int rc;
 	uint64_t addr64 = addr;
 
 	fsi_dt = get_class_target_addr(fsi_dt, "fsi", &addr64);
 	fsi = target_to_fsi(fsi_dt);
-	return fsi->read(fsi, addr64, data);
+
+	rc = fsi->read(fsi, addr64, data);
+	PR_DEBUG("rc = %d, addr = 0x%05" PRIx64 ", data = 0x%08" PRIx32 ", target = %s\n",
+		 rc, addr64, *data, pdbg_target_path(&fsi->target));
+	return rc;
 }
 
 int fsi_write(struct pdbg_target *fsi_dt, uint32_t addr, uint32_t data)
 {
 	struct fsi *fsi;
+	int rc;
 	uint64_t addr64 = addr;
 
 	fsi_dt = get_class_target_addr(fsi_dt, "fsi", &addr64);
 	fsi = target_to_fsi(fsi_dt);
 
-	return fsi->write(fsi, addr64, data);
+	rc = fsi->write(fsi, addr64, data);
+	PR_DEBUG("rc = %d, addr = 0x%05" PRIx64 ", data = 0x%08" PRIx32 ", target = %s\n",
+		 rc, addr64, data, pdbg_target_path(&fsi->target));
+	return rc;
 }
 
 int fsi_write_mask(struct pdbg_target *fsi_dt, uint32_t addr, uint32_t data, uint32_t mask)