How to measure performance inside Kernel?
From: peter.senna@gmail.com (Peter Senna Tschudin)
Date: 2012-02-13 23:13:06
From: peter.senna@gmail.com (Peter Senna Tschudin)
Date: 2012-02-13 23:13:06
Hi Mulyadi,
I read your code and I think kmalloc can be streamlined here. I recommend that kmalloc() allocate total memory needed to handle whole q->buf[] array. something like (CMIIW): q->buf=kmalloc(sizeof(struct vb_buffer)*q->num_buffers,GFP_KERNEL) then access q->buf[1], q->buf[2] etc.
struct vb2_queue {
struct vb2_buffer *bufs[VIDEO_MAX_FRAME];
unsigned int num_buffers;
};
bufs is an array of pointers to struct vb2_buffer. I was not able to
use your kmalloc code. I get incompatible types errors when trying it.
Any ideas?
--
Peter Senna Tschudin
peter.senna at gmail.com
gpg id: 48274C36