pr_err("%s: failure mapping buffer to userspace\n",
__func__);
+ trace_ion_buffer_mmap("", (unsigned int)buffer, buffer->size,
+ vma->vm_start, vma->vm_end);
+
return ret;
}
+int ion_munmap(struct dma_buf *dmabuf, struct vm_area_struct *vma)
+{
+ struct ion_buffer *buffer = dmabuf->priv;
+
+ trace_ion_buffer_munmap("", (unsigned int)buffer, buffer->size,
+ vma->vm_start, vma->vm_end);
+
+ return 0;
+}
+
static void ion_dma_buf_release(struct dma_buf *dmabuf)
{
struct ion_buffer *buffer = dmabuf->priv;
TP_PROTO(const char* client, unsigned int buffer, unsigned int size, unsigned int kaddr),
TP_ARGS(client, buffer, size, kaddr));
+DECLARE_EVENT_CLASS(ion_mmap_op,
+ TP_PROTO(const char* client, unsigned int buf, unsigned int size,
+ unsigned long vm_start, unsigned long vm_end),
+ TP_ARGS(client, buf, size, vm_start, vm_end),
+ TP_STRUCT__entry(
+ __string(client, client)
+ __field(unsigned int, buf)
+ __field(unsigned int, size)
+ __field(unsigned long, vm_start)
+ __field(unsigned long, vm_end)
+ ),
+ TP_fast_assign(
+ __assign_str(client, client);
+ __entry->buf = buf;
+ __entry->size = size;
+ __entry->vm_start = vm_start;
+ __entry->vm_end = vm_end;
+ ),
+ TP_printk("client=%s,buffer=%08x:%d,vma[%08lx:%08lx]",
+ __get_str(client), __entry->buf, __entry->size,
+ __entry->vm_start, __entry->vm_end)
+);
+
+DEFINE_EVENT(ion_mmap_op, ion_buffer_mmap,
+ TP_PROTO(const char* client, unsigned int buf, unsigned int size,
+ unsigned long vm_start, unsigned long vm_end),
+ TP_ARGS(client, buf, size, vm_start, vm_end));
+DEFINE_EVENT(ion_mmap_op, ion_buffer_munmap,
+ TP_PROTO(const char* client, unsigned int buf, unsigned int size,
+ unsigned long vm_start, unsigned long vm_end),
+ TP_ARGS(client, buf, size, vm_start, vm_end));
#endif /* _TRACE_ION_H */
detach_vmas_to_be_unmapped(mm, vma, prev, end);
unmap_region(mm, vma, prev, start, end);
+#ifdef CONFIG_ARCH_ROCKCHIP
+ {
+ extern int ion_munmap(void *dmabuf, struct vm_area_struct *vma);
+ extern int dma_buf_is_dma_buf(struct file *file);
+ if (vma->vm_file && dma_buf_is_dma_buf(vma->vm_file)) {
+ ion_munmap(vma->vm_file->private_data, vma);
+ }
+ }
+#endif
+
/* Fix up all other VM information */
remove_vma_list(mm, vma);