e1000: whitespace changes
[dpdk.git] / lib / librte_malloc / rte_malloc.h
index 687ab16..b094b66 100644 (file)
 extern "C" {
 #endif
 
+/**
+ *  Structure to hold heap statistics obtained from rte_malloc_get_socket_stats function.
+ */
+struct rte_malloc_socket_stats {
+       size_t heap_totalsz_bytes; /**< Total bytes on heap */
+       size_t heap_freesz_bytes;  /**< Total free bytes on heap */
+       size_t greatest_free_size; /**< Size in bytes of largest free block */
+       unsigned free_count;       /**< Number of free elements on heap */
+       unsigned alloc_count;      /**< Number of allocated elements on heap */
+       size_t heap_allocsz_bytes; /**< Total allocated bytes on heap */
+};
+
 /**
  * This function allocates memory from the huge-page area of memory. The memory
  * is not cleared. In NUMA systems, the memory allocated resides on the same
@@ -263,6 +275,21 @@ rte_free(void *ptr);
 int
 rte_malloc_validate(void *ptr, size_t *size);
 
+/**
+ * Get heap statistics for the specified heap.
+ *
+ * @param socket
+ *   An unsigned integer specifying the socket to get heap statistics for
+ * @param socket_stats
+ *   A structure which provides memory to store statistics
+ * @return
+ *   Null on error
+ *   Pointer to structure storing statistics on success
+ */
+int
+rte_malloc_get_socket_stats(int socket,
+               struct rte_malloc_socket_stats *socket_stats);
+
 /**
  * Dump statistics.
  *