From 7e73fa02ed361a9c0c08f61d00421671bf10ce9f Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 28 May 2012 08:16:43 +0100 Subject: [PATCH] sna: Add some debugging to show count of outstanding requests during retire Signed-off-by: Chris Wilson --- src/sna/kgem.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/sna/kgem.c b/src/sna/kgem.c index 00ef82df..9d2fd991 100644 --- a/src/sna/kgem.c +++ b/src/sna/kgem.c @@ -1306,6 +1306,14 @@ static bool kgem_retire__flushing(struct kgem *kgem) kgem_bo_free(kgem, bo); } } +#if DEBUG_KGEM + { + int count = 0; + list_for_each_entry(bo, &kgem->flushing, request) + count++; + ErrorF("%s: %d bo on flushing list\n", __FUNCTION__, count); + } +#endif return retired; } @@ -1394,6 +1402,24 @@ static bool kgem_retire__requests(struct kgem *kgem) free(rq); } +#if DEBUG_KGEM + { + int count = 0; + + list_for_each_entry(bo, &kgem->requests, request) + count++; + + bo = NULL; + if (!list_is_empty(&kgem->requests)) + bo = list_first_entry(&kgem->requests, + struct kgem_request, + list)->bo; + + ErrorF("%s: %d outstanding requests, oldest=%d\n", + __FUNCTION__, count, bo ? bo->handle : 0); + } +#endif + return retired; }