[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] libxencall: Improve linux syscall error messages



commit f355ed8448bc5685af749ebbd3b3816f3c8f927a
Author:     Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
AuthorDate: Mon Oct 15 15:22:53 2018 +0100
Commit:     Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
CommitDate: Tue Oct 30 17:03:31 2018 +0000

    libxencall: Improve linux syscall error messages
    
    Make the bufdev and non-bufdev messages distinct, and always print the
    non-constant argument (ie, the size).
    
    This assists diagnosis.
    
    CC: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    CC: Hans van Kranenburg <hans@xxxxxxxxxxx>
    Acked-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 tools/libs/call/linux.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/tools/libs/call/linux.c b/tools/libs/call/linux.c
index d8a6306e04..51fa4899eb 100644
--- a/tools/libs/call/linux.c
+++ b/tools/libs/call/linux.c
@@ -93,7 +93,8 @@ static void *alloc_pages_bufdev(xencall_handle *xcall, size_t 
npages)
              xcall->buf_fd, 0);
     if ( p == MAP_FAILED )
     {
-        PERROR("alloc_pages: mmap failed");
+        PERROR("alloc_pages: mmap (,%zu*%lu,...) [bufdev] failed",
+               npages, (unsigned long)PAGE_SIZE);
         p = NULL;
     }
 
@@ -110,7 +111,7 @@ static void *alloc_pages_nobufdev(xencall_handle *xcall, 
size_t npages)
     p = mmap(NULL, size, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_ANONYMOUS|MAP_LOCKED, -1, 0);
     if ( p == MAP_FAILED )
     {
-        PERROR("alloc_pages: mmap failed");
+        PERROR("alloc_pages: mmap(,%zu,...) [nobufdev] failed", size);
         return NULL;
     }
 
@@ -119,7 +120,8 @@ static void *alloc_pages_nobufdev(xencall_handle *xcall, 
size_t npages)
     rc = madvise(p, npages * PAGE_SIZE, MADV_DONTFORK);
     if ( rc < 0 )
     {
-        PERROR("alloc_pages: madvise failed");
+        PERROR("alloc_pages: madvise (,%zu*%lu,) [nobufdev] failed",
+               npages, (unsigned long)PAGE_SIZE);
         goto out;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.