[Pdbg] [PATCH 2/2] kernel: Log scom read/write errors only at debug level

Amitay Isaacs amitay at ozlabs.org
Fri Aug 2 12:26:43 AEST 2019


Library really should not log errors, but return the right error code so
user application can generate the appropriate error log.  However, it is
a good idea to log all errors at debug level from library to help debug.

Signed-off-by: Amitay Isaacs <amitay at ozlabs.org>
---
 libpdbg/kernel.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libpdbg/kernel.c b/libpdbg/kernel.c
index 0f37602..4cc0334 100644
--- a/libpdbg/kernel.c
+++ b/libpdbg/kernel.c
@@ -157,7 +157,7 @@ static int kernel_pib_getscom(struct pib *pib, uint64_t addr, uint64_t *value)
 	rc = pread(pib->fd, value, 8, addr);
 	if (rc < 0) {
 		rc = errno;
-		PR_ERROR("Failed to read scom");
+		PR_DEBUG("Failed to read scom addr 0x%016"PRIx64"\n", addr);
 		return rc;
 	}
 	return 0;
@@ -170,7 +170,7 @@ static int kernel_pib_putscom(struct pib *pib, uint64_t addr, uint64_t value)
 	rc = pwrite(pib->fd, &value, 8, addr);
 	if (rc < 0) {
 		rc = errno;
-		PR_ERROR("Failed to write scom");
+		PR_DEBUG("Failed to write scom addr 0x%016"PRIx64"\n", addr);
 		return rc;
 	}
 	return 0;
-- 
2.21.0



More information about the Pdbg mailing list