add FILE argument to debug functions
[dpdk.git] / lib / librte_eal / common / eal_common_memzone.c
index a1fcdfd..2a69c49 100644 (file)
@@ -199,6 +199,7 @@ memzone_reserve_aligned_thread_unsafe(const char *name, size_t len,
 
                /* bad socket ID */
                if (socket_id != SOCKET_ID_ANY &&
+                   free_memseg[i].socket_id != SOCKET_ID_ANY &&
                    socket_id != free_memseg[i].socket_id)
                        continue;
 
@@ -259,9 +260,6 @@ memzone_reserve_aligned_thread_unsafe(const char *name, size_t len,
                        return memzone_reserve_aligned_thread_unsafe(name,
                                len, socket_id, 0, align, bound);
 
-               RTE_LOG(ERR, EAL, "%s(%s, %zu, %d): "
-                       "No appropriate segment found\n",
-                       __func__, name, requested_len, socket_id);
                rte_errno = ENOMEM;
                return NULL;
        }
@@ -387,7 +385,7 @@ rte_memzone_lookup(const char *name)
 
 /* Dump all reserved memory zones on console */
 void
-rte_memzone_dump(void)
+rte_memzone_dump(FILE *f)
 {
        struct rte_mem_config *mcfg;
        unsigned i = 0;
@@ -400,7 +398,7 @@ rte_memzone_dump(void)
        for (i=0; i<RTE_MAX_MEMZONE; i++) {
                if (mcfg->memzone[i].addr == NULL)
                        break;
-               printf("Zone %u: name:<%s>, phys:0x%"PRIx64", len:0x%zx"
+               fprintf(f, "Zone %u: name:<%s>, phys:0x%"PRIx64", len:0x%zx"
                       ", virt:%p, socket_id:%"PRId32", flags:%"PRIx32"\n", i,
                       mcfg->memzone[i].name,
                       mcfg->memzone[i].phys_addr,