I get the frame information of a running application through dumpsys SurfaceFlinger --latency SurfaceView.  
Now, I want to get the same information in a piece of code I have written for kernel. How could I access the information provided by dumpsys or dumpsys SurfaceFlinger in kernel? I have read that it is not a good idea to make system calls from within the kernel. What are the other options I have?