# FlameGraph ProfileView not showing matrix operations

**URL:** https://discourse.julialang.org/t/flamegraph-profileview-not-showing-matrix-operations/100359
**Category:** Performance
**Tags:** profiling
**Created:** [June 14, 2023, 7:27pm UTC](https://discourse.julialang.org/t/flamegraph-profileview-not-showing-matrix-operations/100359 "2023-06-14T19:27:18Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![hsgg](https://avatars.discourse-cdn.com/v4/letter/h/838e76/32.png) [@hsgg](https://discourse.julialang.org/u/hsgg)
#### Post date: [June 14, 2023, 7:27pm UTC](https://discourse.julialang.org/t/flamegraph-profileview-not-showing-matrix-operations/100359/1 "2023-06-14T19:27:18Z")

</div>

Hi, I am using [FlameGraphs.jl](https://github.com/timholy/FlameGraphs.jl) and [ProfileView.jl](https://github.com/timholy/ProfileView.jl) to profile my code with matrix operations. I am fairly new to these profiling tools.

On MacOS M1 the matrix operations are not showing up in the flame graph. Here is a MWE:

```julia
using Profile, ProfileView, FlameGraphs

function do_blas_work(N, n1, n2)
    A = rand(n1, n2)
    b = rand(n2)
    c = rand(n1)
    for _ in 1:N
        x = A * b .+ c
    end
end

@profview do_blas_work(10, 10_000, 7000) # compile
@profview do_blas_work(10, 10_000, 7000) # compile again
ProfileView.closeall()

@profview do_blas_work(100, 10_000, 7000)

```

The result shows only the time spent on drawing the random samples:

 ![Screenshot 2023-06-14 at 12.16.34 PM](https://global.discourse-cdn.com/julialang/original/3X/5/4/543578a70a5b339309f62197f858394a210c7338.png)

How can I show the matrix operations as well?

```julia
julia> versioninfo()
Julia Version 1.9.0
Commit 8e630552924 (2023-05-07 11:25 UTC)
Platform Info:
  OS: macOS (arm64-apple-darwin22.4.0)
  CPU: 10 × Apple M1 Max
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, apple-m1)
  Threads: 1 on 8 virtual cores

julia> using LinearAlgebra; BLAS.get_config()
LinearAlgebra.BLAS.LBTConfig
Libraries: 
└ [ILP64] libopenblas64_.dylib

```

---

<div class="post-metadata">

### Author: ![tim.holy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tim.holy/32/52_2.png) [@tim.holy](https://discourse.julialang.org/u/tim.holy)
#### Post date: [June 14, 2023, 8:23pm UTC](https://discourse.julialang.org/t/flamegraph-profileview-not-showing-matrix-operations/100359/2 "2023-06-14T20:23:19Z")

</div>

This is a known upstream (libunwind) bug.

---

<div class="post-metadata">

### Author: ![hsgg](https://avatars.discourse-cdn.com/v4/letter/h/838e76/32.png) [@hsgg](https://discourse.julialang.org/u/hsgg)
#### Post date: [June 15, 2023, 9:54pm UTC](https://discourse.julialang.org/t/flamegraph-profileview-not-showing-matrix-operations/100359/3 "2023-06-15T21:54:04Z")

</div>

Thanks for the answer, I think for the purposes of this forum, the reference to the bug is the “solution”.

However, the only bug I could find is this closed one: [Profiling on MacOS suffering a lot of detached samples · Issue #38350 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/issues/38350). The summary is that it is fixed for x86, but maybe not for M1, and there is no bug for the M1 version of the bug?
