From patchwork Tue Aug 28 02:46:03 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nishanth Peethambaran X-Patchwork-Id: 10981 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 2AE2623F18 for ; Tue, 28 Aug 2012 02:46:44 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 94CE5A18EB3 for ; Tue, 28 Aug 2012 02:46:15 +0000 (UTC) Received: by iafj25 with SMTP id j25so6992688iaf.11 for ; Mon, 27 Aug 2012 19:46:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf :dkim-signature:mime-version:date:message-id:from:to:content-type :subject:x-beenthere:x-mailman-version:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :sender:errors-to:x-gm-message-state; bh=f58Q7ab8aqlazeFkDxoycRe7jt6BtcWkObh6BmT8H6k=; b=JqysOW3rY716L1a1GOAyuPS9GirswQRsrhV4k9h1w52B1V/C6MOBzmeErQNq0pFfpM oCAbZ0a5osd1l7azN1jo9NHVoIQNir+7Nqi1bG0aIhvaBaIV0TYY0+zVjhQO3nXUh5sn EdoKQNVpMRJszATNBdcQbqL6xiCY+uDnfZPT9JQrkQ6MvX+4x/WsgzGth5On+Bl3fugi x6/M2M6d+F3vhqkxESlX/6PN0R3UxM64yuJ+O41cFhUS65UyeVDuSpxwcCEJ6+OIuk8z a2cfC0gmBXx89Na9WG7L/TcA4TJ2dnasrEBpJ+O92zpejlVvd4UqMHWD5eVoNGjIkyQZ LITg== Received: by 10.50.207.106 with SMTP id lv10mr12270264igc.0.1346122002862; Mon, 27 Aug 2012 19:46:42 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.184.232 with SMTP id ex8csp3191igc; Mon, 27 Aug 2012 19:46:40 -0700 (PDT) Received: by 10.205.135.146 with SMTP id ig18mr4302942bkc.80.1346122000042; Mon, 27 Aug 2012 19:46:40 -0700 (PDT) Received: from mombin.canonical.com (mombin.canonical.com. [91.189.95.16]) by mx.google.com with ESMTP id ha18si12032636bkc.61.2012.08.27.19.46.08; Mon, 27 Aug 2012 19:46:39 -0700 (PDT) Received-SPF: neutral (google.com: 91.189.95.16 is neither permitted nor denied by best guess record for domain of linaro-mm-sig-bounces@lists.linaro.org) client-ip=91.189.95.16; Authentication-Results: mx.google.com; spf=neutral (google.com: 91.189.95.16 is neither permitted nor denied by best guess record for domain of linaro-mm-sig-bounces@lists.linaro.org) smtp.mail=linaro-mm-sig-bounces@lists.linaro.org; dkim=neutral (body hash did not verify) header.i=@gmail.com Received: from localhost ([127.0.0.1] helo=mombin.canonical.com) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1T6Bob-0006bL-L8; Tue, 28 Aug 2012 02:46:05 +0000 Received: from mail-bk0-f42.google.com ([209.85.214.42]) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1T6Boa-0006ax-RV for linaro-mm-sig@lists.linaro.org; Tue, 28 Aug 2012 02:46:04 +0000 Received: by bkcjm19 with SMTP id jm19so2854164bkc.1 for ; Mon, 27 Aug 2012 19:46:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=1LnQaPhNPM3W80wyGpjM+gDY+pCKvyUPlQaW0+6CW60=; b=LpylfcjdUk1Wr8T0HLg7P+HN1QCuuKeA8rRn1Sy2KSrJ6yx1MesMC4H+Ooxnm82Bck Ik/8vCsFvEhuD/7voQ5JRiMl88sPuhx1yEMtuPOzjHcMWVpyuGtZmFAL/Rk/rq0Bb+6z UpTJmXSgFXod1bPHYmnLEB+2BYlmBy5qOdzCMgBW8Qpby9so7vKdwRLkgFSmFcNMpK5Y i9Co//QDCO5U4B7pid68KHCtqRJ0LkL/r9b7WuHSaIG9WlZNgDoh8mB+OiIfqkzEw7dj /eaUCbo4Qz20ctkzncYoJTbh+Juy6g6lWyNoXUh23YCsQJR4z+k6ciZFBSHLdm9XnLTW 3/PA== MIME-Version: 1.0 Received: by 10.205.139.6 with SMTP id iu6mr4501914bkc.20.1346121964323; Mon, 27 Aug 2012 19:46:04 -0700 (PDT) Received: by 10.204.169.199 with HTTP; Mon, 27 Aug 2012 19:46:03 -0700 (PDT) Date: Tue, 28 Aug 2012 08:16:03 +0530 Message-ID: From: Nishanth Peethambaran To: linaro-mm-sig@lists.linaro.org Subject: [Linaro-mm-sig] Patch to show debugfs output for every heap->id instead of heap->type X-BeenThere: linaro-mm-sig@lists.linaro.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Unified memory management interest group." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linaro-mm-sig-bounces@lists.linaro.org Errors-To: linaro-mm-sig-bounces@lists.linaro.org X-Gm-Message-State: ALoCoQn3RH8NZIy1FmQ+nx1y3kDThe5jzwYFzm72LsrnzmyWUdwl040dKFcasLq2O/PG/eruxn8f Hi, ION debugfs currently shows/groups output based on type. But, it is possible to have multiple heaps of the same type - for CMA and carveout types. It is more useful to get usage information for individual heaps. - Nishanth Peethambaran >From fa819b42fb69321a8e5db260ba9fd8ce7a2f16d2 Mon Sep 17 00:00:00 2001 From: Nishanth Peethambaran Date: Tue, 28 Aug 2012 07:57:37 +0530 Subject: [PATCH] gpu: ion: Update debugfs to show for each id Update the debugfs read of client and heap to show based on 'id' instead of 'type'. Multiple heaps of the same type can be present, but id is unique. --- drivers/gpu/ion/ion.c | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) @@ -1121,7 +1121,7 @@ static const struct file_operations ion_fops = { }; static size_t ion_debug_heap_total(struct ion_client *client, - enum ion_heap_type type) + int id) { size_t size = 0; struct rb_node *n; @@ -1131,7 +1131,7 @@ static size_t ion_debug_heap_total(struct ion_client *client, struct ion_handle *handle = rb_entry(n, struct ion_handle, node); - if (handle->buffer->heap->type == type) + if (handle->buffer->heap->id == id) size += handle->buffer->size; } mutex_unlock(&client->lock); @@ -1149,7 +1149,7 @@ static int ion_debug_heap_show(struct seq_file *s, void *unused) for (n = rb_first(&dev->clients); n; n = rb_next(n)) { struct ion_client *client = rb_entry(n, struct ion_client, node); - size_t size = ion_debug_heap_total(client, heap->type); + size_t size = ion_debug_heap_total(client, heap->id); if (!size) continue; if (client->task) { diff --git a/drivers/gpu/ion/ion.c b/drivers/gpu/ion/ion.c index 34c12df..65cedee 100644 --- a/drivers/gpu/ion/ion.c +++ b/drivers/gpu/ion/ion.c @@ -547,11 +547,11 @@ static int ion_debug_client_show(struct seq_file *s, void *unused) for (n = rb_first(&client->handles); n; n = rb_next(n)) { struct ion_handle *handle = rb_entry(n, struct ion_handle, node); - enum ion_heap_type type = handle->buffer->heap->type; + int id = handle->buffer->heap->id; - if (!names[type]) - names[type] = handle->buffer->heap->name; - sizes[type] += handle->buffer->size; + if (!names[id]) + names[id] = handle->buffer->heap->name; + sizes[id] += handle->buffer->size; } mutex_unlock(&client->lock);