[Pdbg] [PATCH 2/2] kernel: Log scom read/write errors only at debug level
Alistair Popple
alistair at popple.id.au
Fri Aug 2 13:52:00 AEST 2019
Thanks Amitay, I ran into this issue the other day and have a patch for it in
my private tree. But I will take this one!
Reviewed-by: Alistair Popple <alistair at popple.id.au>
On Friday, 2 August 2019 12:26:43 PM AEST Amitay Isaacs wrote:
> 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;
>
More information about the Pdbg
mailing list