diff mbox

[1/2] linux-generic: pool: add more debug print for pool_destroy

Message ID 1459259977-10978-2-git-send-email-maxim.uvarov@linaro.org
State Accepted
Commit 9ce7e0e1d0c257f2dd8fdf04815b16dc23c3670d
Headers show

Commit Message

Maxim Uvarov March 29, 2016, 1:59 p.m. UTC
Print cause and pool name on destroy to make debug more
easily.

Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
---
 platform/linux-generic/odp_pool.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Bill Fischofer March 31, 2016, 7:08 p.m. UTC | #1
On Tue, Mar 29, 2016 at 8:59 AM, Maxim Uvarov <maxim.uvarov@linaro.org>
wrote:

> Print cause and pool name on destroy to make debug more

> easily.

>

> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>

>


Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>



> ---

>  platform/linux-generic/odp_pool.c | 2 ++

>  1 file changed, 2 insertions(+)

>

> diff --git a/platform/linux-generic/odp_pool.c

> b/platform/linux-generic/odp_pool.c

> index 588362b..eb545b2 100644

> --- a/platform/linux-generic/odp_pool.c

> +++ b/platform/linux-generic/odp_pool.c

> @@ -459,6 +459,7 @@ int odp_pool_destroy(odp_pool_t pool_hdl)

>         if (pool->s.pool_shm == ODP_SHM_INVALID ||

>             pool->s.flags.predefined) {

>                 POOL_UNLOCK(&pool->s.lock);

> +               ODP_ERR("invalid shm for pool %s\n", pool->s.name);

>                 return -1;

>         }

>

> @@ -469,6 +470,7 @@ int odp_pool_destroy(odp_pool_t pool_hdl)

>         /* Call fails if pool has allocated buffers */

>         if (odp_atomic_load_u32(&pool->s.bufcount) < pool->s.buf_num) {

>                 POOL_UNLOCK(&pool->s.lock);

> +               ODP_ERR("pool %s not empty\n", pool->s.name);

>                 return -1;

>         }

>

> --

> 2.7.1.250.gff4ea60

>

> _______________________________________________

> lng-odp mailing list

> lng-odp@lists.linaro.org

> https://lists.linaro.org/mailman/listinfo/lng-odp

>
diff mbox

Patch

diff --git a/platform/linux-generic/odp_pool.c b/platform/linux-generic/odp_pool.c
index 588362b..eb545b2 100644
--- a/platform/linux-generic/odp_pool.c
+++ b/platform/linux-generic/odp_pool.c
@@ -459,6 +459,7 @@  int odp_pool_destroy(odp_pool_t pool_hdl)
 	if (pool->s.pool_shm == ODP_SHM_INVALID ||
 	    pool->s.flags.predefined) {
 		POOL_UNLOCK(&pool->s.lock);
+		ODP_ERR("invalid shm for pool %s\n", pool->s.name);
 		return -1;
 	}
 
@@ -469,6 +470,7 @@  int odp_pool_destroy(odp_pool_t pool_hdl)
 	/* Call fails if pool has allocated buffers */
 	if (odp_atomic_load_u32(&pool->s.bufcount) < pool->s.buf_num) {
 		POOL_UNLOCK(&pool->s.lock);
+		ODP_ERR("pool %s not empty\n", pool->s.name);
 		return -1;
 	}