rk: ion: add caller info in snapshot if alloc failed
authorCMY <cmy@rock-chips.com>
Mon, 30 Jun 2014 06:52:36 +0000 (14:52 +0800)
committerCMY <cmy@rock-chips.com>
Mon, 30 Jun 2014 06:53:13 +0000 (14:53 +0800)
drivers/staging/android/ion/ion.c

index 8fa98adc517542cdb6feaf288185464d0ddae23a..556a3e80cdc606ce0cb508d4897d25a96ed213f2 100755 (executable)
@@ -122,7 +122,7 @@ static void ion_iommu_force_unmap(struct ion_buffer *buffer);
 #ifdef CONFIG_ION_ROCKCHIP_SNAPSHOT
 extern char *rockchip_ion_snapshot_get(unsigned *size);
 extern int rockchip_ion_snapshot_debugfs(struct dentry* root);
-static int ion_snapshot_save(struct ion_device *idev);
+static int ion_snapshot_save(struct ion_device *idev, size_t len);
 #endif
 
 bool ion_buffer_fault_user_mappings(struct ion_buffer *buffer)
@@ -522,7 +522,7 @@ struct ion_handle *ion_alloc(struct ion_client *client, size_t len,
 
        if (IS_ERR(buffer)) {
 #ifdef CONFIG_ION_ROCKCHIP_SNAPSHOT
-               ion_snapshot_save(client->dev);
+               ion_snapshot_save(client->dev, len);
 #endif
                return ERR_PTR(PTR_ERR(buffer));
        }
@@ -2029,7 +2029,7 @@ static unsigned long ion_find_max_zero_area(unsigned long *map, unsigned long si
        return max_zero_sz;
 }
 
-static int ion_snapshot_save(struct ion_device *idev)
+static int ion_snapshot_save(struct ion_device *idev, size_t len)
 {
        static struct seq_file seqf;
        struct ion_heap *heap;
@@ -2044,6 +2044,9 @@ static int ion_snapshot_save(struct ion_device *idev)
        pr_debug("%s: save snapshot 0x%x@0x%lx\n", __func__, seqf.size,
                __pa(seqf.buf));
 
+       seq_printf(&seqf, "call by comm: %s pid: %d, alloc: %uKB\n",
+               current->comm, current->pid, len>>10);
+
        down_read(&idev->lock);
 
        plist_for_each_entry(heap, &idev->heaps, node) {