# Missing samples in profiler?

**URL:** <https://discourse.julialang.org/t/missing-samples-in-profiler/59430>\
**Category:** New to Julia\
**Tags:** profiling\
**Created:** [April 16, 2021, 6:26pm UTC](https://discourse.julialang.org/t/missing-samples-in-profiler/59430 "2021-04-16T18:26:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ross\_Boylan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ross_boylan/32/9210_2.png) [@Ross\_Boylan](https://discourse.julialang.org/u/Ross_Boylan)\
**Post date:** [April 16, 2021, 6:26pm UTC](https://discourse.julialang.org/t/missing-samples-in-profiler/59430/1 "2021-04-16T18:26:09Z")

</div>

Using julia 1.6 it seems the the number reported for the top level of the call I make in `@profile` is often much smaller than the reported number of samples:

```julia
julia> @profile (for i=1:100; RBSilly.fit(RBSilly.yx, 0.0002, 4); end)

julia> Profile.print()
Overhead ╎ [+additional indent] Count File:Line; Function
=========================================================
  ╎64 @Base/task.jl:406; (::VSCodeServer.var"#60#61")()
  ╎ 64 @VSCodeServer/src/eval.jl:34; macro expansion
.....
Total snapshots: 130

```

If there are 130 snapshots, how do I end up with only 64 observations of my top-level call?

The sum of all values in the overhead column (whose meaning is unclear to me [and others](https://discourse.julialang.org/t/meaning-of-overhead-column-in-profile/51648)), is 64, oddly identical to the 64 shown above. If I add the overhead to the top-level count of 64 it’s 128, which is close to, but still not quite, the 130 snapshots.

The line with the largest overhead is

```julia
17╎ ╎ ╎ ╎ ╎ ╎ 17 ...stdlib/v1.6/LinearAlgebra/src/blas.jl:844; symv!(uplo::Char, alpha::Float64, A::Matrix{Float64}, x::V...

```

which looks as if the overhead is time spent in an external BLAS library. It also looks as if the two 17’s are reporting the same thing, in which case adding the overheads to the call count as I did above is double-counting.

---

<div class="post-metadata">

**Author:** ![jameson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jameson/32/23_2.png) [@jameson](https://discourse.julialang.org/u/jameson)\
**Post date:** [April 16, 2021, 10:20pm UTC](https://discourse.julialang.org/t/missing-samples-in-profiler/59430/2 "2021-04-16T22:20:08Z")

</div>

Some libraries do not report where they are called from. You can see the extra frames by passing C=true. Though IIRC, there was a linux bug which made us double-count the number of snapshots, but I thought the fix for that was included in v1.6. Are you on macOS?–more system libraries are compiled without caller info there.

---

<div class="post-metadata">

**Author:** ![Ross\_Boylan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ross_boylan/32/9210_2.png) [@Ross\_Boylan](https://discourse.julialang.org/u/Ross_Boylan)\
**Post date:** [April 16, 2021, 10:36pm UTC](https://discourse.julialang.org/t/missing-samples-in-profiler/59430/3 "2021-04-16T22:36:07Z")

</div>

I’m on linux.
