Beispiel #1
0
void ion_debug_mem_map_create(struct seq_file *s, struct ion_heap *heap,
			      struct rb_root *mem_map)
{
	struct ion_device *dev = heap->dev;
	struct rb_node *n;

	for (n = rb_first(&dev->buffers); n; n = rb_next(n)) {
		struct ion_buffer *buffer =
				rb_entry(n, struct ion_buffer, node);
		if (buffer->heap->id == heap->id) {
			struct mem_map_data *data =
					kzalloc(sizeof(*data), GFP_KERNEL);
			if (!data) {
				seq_printf(s, "ERROR: out of memory. "
					   "Part of memory map will not be logged\n");
				break;
			}
			data->addr = buffer->priv_phys;
			data->addr_end = buffer->priv_phys + buffer->size-1;
			data->size = buffer->size;
			data->client_name = ion_debug_locate_owner(dev, buffer);
			ion_debug_mem_map_add(mem_map, data);
		}
	}
}
Beispiel #2
0
void ion_debug_mem_map_create(struct seq_file *s, struct ion_heap *heap,
			      struct rb_root *mem_map)
{
	struct ion_device *dev = heap->dev;
	struct rb_node *n;

	for (n = rb_first(&dev->buffers); n; n = rb_next(n)) {
		struct ion_buffer *buffer =
				rb_entry(n, struct ion_buffer, node);
		if (buffer->heap->id == heap->id) {
			struct mem_map_data *data =
					kzalloc(sizeof(*data), GFP_KERNEL);
			if (!data) {
				seq_printf(s, "ERROR: out of memory. "
					   "Part of memory map will not be logged\n");
				break;
			}
			if (heap->id == ION_IOMMU_HEAP_ID) {
				data->addr = (unsigned long)buffer;
			} else {
				data->addr = buffer->priv_phys;
				data->addr_end = buffer->priv_phys + buffer->size-1;
			}
			data->size = buffer->size;
			data->client_name = ion_debug_locate_owner(dev, buffer);

			{
				
				struct rb_node *p = NULL;
				struct ion_client *entry = NULL;

				for (p = rb_first(&dev->clients); p && !data->creator_name;
						p = rb_next(p)) {
					entry = rb_entry(p, struct ion_client, node);
					if (entry == buffer->creator)
						data->creator_name = entry->name;
				}
			}
			ion_debug_mem_map_add(mem_map, data);
		}
	}
}