# Problem with PVRScope using JNI.

**URL:** <https://forums.imgtec.com/t/problem-with-pvrscope-using-jni/2208>\
**Category:** PowerVR Insider\
**Tags:** pvrmonitor, pvrscope\
**Created:** [November 19, 2014, 1:46am UTC](https://forums.imgtec.com/t/problem-with-pvrscope-using-jni/2208 "2014-11-19T01:46:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bubonger163-com](https://avatars.discourse-cdn.com/v4/letter/b/b19c9b/32.png) [@bubonger163-com](https://forums.imgtec.com/u/bubonger163-com)\
**Post date:** [November 19, 2014, 1:46am UTC](https://forums.imgtec.com/t/problem-with-pvrscope-using-jni/2208/1 "2014-11-19T01:46:20Z")

</div>

I am using JNI(Java Native Interface) to access PVRScope, in order to access the counter values. The whole 3D program is written in Jave using OpenGL ES 2.0. I open a new thread in Java to regularily sample the PVRScope. I have tried to sample it for different time cycles like 1ms, 2ms, 4ms, 10ms, 16ms, 20ms.  
  
However, all values of counter I got seems random.  
  
Here is a group(active group 0) of data i got:  
  
Group -1: Frame time: 1.1171633  
  
Group -1: Frames per second (FPS): 0.8951243  
  
Group -1: GPU task load: 2D: 57434.145  
  
Group -1: GPU task load: Compute: 57434.145  
  
Group -1: GPU task load: Renderer: 57462.2  
  
Group -1: GPU task load: Tiler: 57459.887  
  
Group -1: GPU task time per frame: 2D: 641.6332  
  
Group -1: GPU task time per frame: Compute: 641.6332  
  
Group -1: GPU task time per frame: Renderer: 641.9466  
  
Group -1: GPU task time per frame: Tiler: 641.9208  
  
Group -1: GPU task time: 2D: 2566.5327  
  
Group -1: GPU task time: Compute: 2566.5327  
  
Group -1: GPU task time: Renderer: 2567.7864  
  
Group -1: GPU task time: Tiler: 2567.683  
  
Group -1: SPM: 0.0  
  
Group 0: ISP load: 0.27483493  
  
Group 0: Shader clock cycles per pixel: 1.0891527  
  
Group 0: Shader clock cycles per vertex: 42.2029  
  
Group 0: Shader load: Pixel: 0.49096373  
  
Group 0: Shader load: Vertex: 0.0014539474  
  
Group 0: Tiler load: 0.35116774  
  
Group 0: Vertices per frame: 69.0  
  
Group 0: Vertices per second: 61.76358  
  
  
  
It seems all the data make no sense. If I run the same program again, the data would be different. And some data such as Shader clock cycles per pixel & Shader clock cycles per vertex is stable and make sense.  
  
What is wrong with PVRScope? Why can PVRScopeExample get the correct data but I cannot.  
  
My device is Samsung Galaxy S4 with PowerVR SGX 544MP

---

<div class="post-metadata">

**Author:** ![JoeDavis](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.imgtec.com/joedavis/32/71_2.png) [@JoeDavis](https://forums.imgtec.com/u/JoeDavis)\
**Post date:** [November 20, 2014, 1:04pm UTC](https://forums.imgtec.com/t/problem-with-pvrscope-using-jni/2208/2 "2014-11-20T13:04:18Z")

</div>

Hi,  
  
  
  
PVRScope returns the average counter values since the previous sampling period. I would recommend reading our [Getting started with PVRScopeStats](https://www.imgtec.com/blog/powervr/powervr-graphics-sdk-tools-explained-getting-started-pvrscopestats) blog post to familiarise yourself with the behaviour of PVRScope’s counter retrieval process.  
  
  
  
We are planning to release the source code of our [PVRMonitor](https://play.google.com/store/apps/details?id=com.powervr.PVRMonitor)utility soon. I’ll update this discussion when that source code is live.  
  
  
  
Thanks,  
  
Joe

---

<div class="post-metadata">

**Author:** ![pauls](https://avatars.discourse-cdn.com/v4/letter/p/b3f665/32.png) [@pauls](https://forums.imgtec.com/u/pauls)\
**Post date:** [November 20, 2014, 4:26pm UTC](https://forums.imgtec.com/t/problem-with-pvrscope-using-jni/2208/3 "2014-11-20T16:26:37Z")

</div>

Hello Bubonger,  
  
  
  
We have now released the source code for our PVRMonitor utility:  
  
[https://github.com/powervr-graphics/PVRMonitor](https://github.com/powervr-graphics/PVRMonitor)  
  
  
  
The source code demonstrates accessing performance counters using jni.  
  
  
  
Please let me know if you have any further questions.  
  
  
  
Thanks,  
  
Paul
