# pmcstat only reports kernel samples



## wichtounet (Aug 20, 2020)

Hi guys, 

I have just run into an issue with pmcstat(8) on a FreeBSD 12.1 AMD box. Basically, all the samples that happen in our userland application are counted as dubious-frames. We can see the samples in the kernel, but not the samples from our application. 

Here is what we are doing for instance: 

```
pmcstat -S unhalted-core-cycles -O out.pmc /our_application
pmcstat -R out.c -z 32 -G out.stacks
```
And we can directly see the issue in the output:

```
CONVERSION STATISTICS:
  #exec/elf                                7
  #samples/total                           2321771
  #callchain/dubious-frames                930247
```
And if we run the application and run pmcstat in top mode (-T), we can see many unresolved samples that happen to be the samples from our application (they are growing quickly according to the load of the program). 

We never saw that in our previous architectures.

Does anybody has a hint at what we could be looking?

Thanks


----------



## George (Aug 20, 2020)

Pmcstat has a couple of open PRs. Maybe they are connected to your problem?




__





						Bug List
					






					bugs.freebsd.org


----------



## wichtounet (Aug 24, 2020)

Elazar That's a good idea, thanks. 

It seems that my issue could be related to https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=234325
* But it may not be entirely the same issue

I have started debugging the code and it seems that the PC reported by the PMC events are not found within the process maps. But I do not know what could cause the issue: 
* Invalid PC from hwmc (unlikely)
* Invalid process maps
* Invalid debug symbol reading

I will continue to investigate and I will gladly take your ideas


----------

