Analyzers
Talk to fellow users of Intel Analyzer tools (Intel VTune™ Profiler, Intel Advisor)
5135 Discussions

DWARF5 and split-dwarf - no source file info

JoeH
Beginner
1,486 Views

I'm trying to profile an executable using split-dwarf flag.

Recently, when switching from DWARF4 to DWARF5, I noticed that source file info disappeared in VTune.

Is this a known issue in VTune?

 

I'm using VTune for Linux: Intel(R) VTune(TM) Profiler 2024.0.0 (build 626834)

This is local (non-remote) profiling.

clang version 17.0.1.

 

Here is a small repro.

If this code below is compiled with dwarf4, I see source file info:

clang -O3 -g2 -gdwarf-4 -gsplit-dwarf -lstdc++ /tmp/main.cpp -o /tmp/main 

Screenshot 2024-01-12 at 10.54.55 AM.png

But if I switch to dwarf5, source info disappears:

clang -O3 -g2 -gdwarf-5 -gsplit-dwarf -lstdc++ /tmp/main.cpp -o /tmp/main

Screenshot 2024-01-12 at 10.53.57 AM.png

Code for repro: 

#include <iostream>

int fibonacci(int n) {
  if (n == 0) {
    return 0;
  }

  int t1 = 0;
  int t2 = 1;
  int nextTerm;

  for (int i = 1; i <= n; ++i) {
    nextTerm = t1 + t2;
    t1 = t2;
    t2 = nextTerm;
  }

  return nextTerm;
}

int main(int argc, char* argv[]) {
  int f;
  for (auto i = 0; i < 2000000000; ++i) {
    f = fibonacci(i % 30);
  }

  return f;
}

 

 

5 Replies
yuzhang3_intel
Moderator
1,441 Views

Thanks for reporting the issue. The issue can be observed in local, i will discuss the issue with development team. We will have update later. Thanks.

0 Kudos
yuzhang3_intel
Moderator
1,408 Views

Did you  try with icpx instead? I just use icpx with option gdwarf-5 like below, using VTune can view the source.

 

$ icpx -gdwarf-5 -O2 -o main main.cpp

source.png

0 Kudos
JoeH
Beginner
1,367 Views

Unfortunately, it is not easy to try different compilers in our build, so I have to use clang.

0 Kudos
clevels
Moderator
1,339 Views

Hello - I have accepted this case and I will also review this issue. Thank you for your patience.


0 Kudos
clevels
Moderator
1,125 Views

We have been able to reproduce this issue in the following configurations:

  • not specifying -gdwarf-[4,5] or -gsplit-dwarf displays source
  • specifying -gdwarf-4 with and without -gsplit-dwarf, -gsplit-dwarf=[single.split] displays source
  • specifying -gdwarf-5 without -gsplit-dwarf or -gsplit-dwarf=[single,split] displays source
  • specifying -gdwarf-5 with -gsplit-dwarf or -gsplit-dwarf=[single,split] only displays source assembly, not C


We have provided the reproducer to the development team for fixing.


0 Kudos
Reply