create_llvm_prof fails with "Error reading profile"
- Dominant language
- C++
- Stars
- 619
- Forks
- 127
- PR merge metrics
- No merged PRs in 30d
Description
I've never used FDO before, so it's possible that I'm just doing something wrong. This is what happened:
First I built my program, including the `-g` option. Then I ran it under `perf record -b` as specified in the Clang User's Manual, like this:
```
perf record -F 96 -b /tmp/kaladont_bin/slim_false_clang nomi < ./data/connected_partitioned_word_lists/list_020468_000001.txt
```
I stopped the program (and perf) after letting it run for about 5 minutes, and I stopped it with a single control-C on the terminal that was running it. (This is the way that the program that I'm trying to optimize is supposed to be stopped, so I hope it's not an issue.) Perf then reported this, which seems OK:
```
[ perf record: Woken up 117 times to write data ]
[ perf record: Captured and wrote 29.252 MB perf.data (37557 samples) ]
```
Afterwards I copied `create_llvm_prof` to a directory in my PATH, and ran it like this:
```
create_llvm_prof --binary=/tmp/kaladont_bin/slim_false_clang --out=slim_false_clang.prof
```
Sadly, `create_llvm_prof` reported several errors, without producing a `slim_false_clang.prof` file:
```
[WARNING:../third_party/perf_data_converter/src/quipper/perf_reader.cc:1244] Skipping 104 bytes of metadata: HEADER_CPU_TOPOLOGY
[ERROR:../third_party/perf_data_converter/src/quipper/perf_data_utils.cc:488] Non-zero remaining event size 24 received for event PERF_RECORD_TIME_CONV with no varaible payload event data or sample info data
[ERROR:../third_party/perf_data_converter/src/quipper/perf_reader.cc:1092] Couldn't get variable payload size for event PERF_RECORD_TIME_CONV
[ERROR:../third_party/perf_data_converter/src/quipper/perf_reader.cc:1020] Couldn't read event PERF_RECORD_TIME_CONV
WARNING: Logging before InitGoogleLogging() is written to STDERR
E20210507 21:47:24.928634 243508 profile_creator.cc:176] Error reading profile.
```
Software versions:
* autofdo is git cloned a few hours ago: 089a86405a2ad508893591340cef5ee5bb16d606
* Clang and LLVM are at 11.1.0
* Perf is version 5.12
* Linux is version 5.11.16
Contributor guide
Assessment
This issue has not been assessed yet.