Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimization clang with Propeller: create_llvm_prof fails #180

Open
foxtran opened this issue Oct 26, 2023 · 0 comments
Open

Optimization clang with Propeller: create_llvm_prof fails #180

foxtran opened this issue Oct 26, 2023 · 0 comments

Comments

@foxtran
Copy link

foxtran commented Oct 26, 2023

I have tried to reproduce optimization clang with Propeller.

After some modification described in #179, the build of AutoFDO was successful.
Unfortunately, script was failed at converting profile stage.

Manual running says the following (I did not notice any difference between absolute and relative paths to binaries):

$ ../create_llvm_prof_build/build/create_llvm_prof --format=propeller \
>   --binary=../labels_clang_build/bin/clang-17 \
>   --profile=perf.data --out=cluster.txt  --propeller_symorder=symorder.txt
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1698228404.425475 1190220 perfdata_reader.cc:222] '../labels_clang_build/bin/clang-17' is PIE: true
WARNING: Logging before InitGoogleLogging() is written to STDERR
I20231025 19:06:44.425645 1190220 llvm_propeller_whole_program_info.cc:240] Parsing [1/1] perf.data ...
I20231025 19:06:44.425750 1190221 llvm_propeller_whole_program_info.cc:702] Started reading the binary info from: ../labels_clang_build/bin/clang-17
[WARNING:/dev/shm/ger/propeller_optimize_clang.dir/create_llvm_prof_build/autofdo/third_party/perf_data_converter/src/quipper/perf_reader.cc:1322] Skipping 1132 bytes of metadata: HEADER_CPU_TOPOLOGY
[WARNING:/dev/shm/ger/propeller_optimize_clang.dir/create_llvm_prof_build/autofdo/third_party/perf_data_converter/src/quipper/perf_reader.cc:1069] Skipping unsupported event PERF_RECORD_CPU_MAP
[INFO:/dev/shm/ger/propeller_optimize_clang.dir/create_llvm_prof_build/autofdo/third_party/perf_data_converter/src/quipper/perf_reader.cc:1060] Number of events stored: 2455
[INFO:/dev/shm/ger/propeller_optimize_clang.dir/create_llvm_prof_build/autofdo/third_party/perf_data_converter/src/quipper/perf_parser.cc:272] Parser processed: 1328 MMAP/MMAP2 events, 112 COMM events, 110 FORK events, 111 EXIT events, 0 SAMPLE events, 0 of these were mapped, 0 SAMPLE events with a data address, 0 of these were mapped
[INFO:/dev/shm/ger/propeller_optimize_clang.dir/create_llvm_prof_build/autofdo/third_party/perf_data_converter/src/quipper/perf_parser.cc:288] Input perf.data has no sample events due to PERF_RECORD_SAMPLE being skipped.
I0000 00:00:1698228404.537408 1190220 perfdata_reader.cc:270] No Build Id found in '../labels_clang_build/bin/clang-17'.
E0000 00:00:1698228404.537441 1190220 perfdata_reader.cc:309] ../labels_clang_build/bin/clang-17 has no build-id. Use '--profiled_binary_name' to force name matching.
W20231025 19:06:44.537940 1190220 llvm_propeller_whole_program_info.cc:243] Skipped profile [1/1] perf.data, because reading file failed or no mmap found.
W20231025 19:06:44.537971 1190220 llvm_propeller_whole_program_info.cc:273] Too few branch records in perf data.
I20231025 19:06:45.014181 1190221 llvm_propeller_whole_program_info.cc:710] Finished reading the binary info from: ../labels_clang_build/bin/clang-17
E0000 00:00:1698228405.014371 1190220 llvm_propeller_profile_writer.cc:160] FAILED_PRECONDITION: No perf file is parsed, cannot proceed.
E20231025 19:06:45.053442 1190220 create_llvm_prof.cc:199] INTERNAL: Failed to create PropellerProfWriter object

According to logs, it suggested me to add --profiled_binary_name=... flag. So, I added --profiled_binary_name=${PATH_TO_LABELS_CLANG_BUILD}/bin/clang-${CLANG_VERSION} \ to my propeller_optimize_clang.sh script.

The related error:

E0000 00:00:1698228404.537441 1190220 perfdata_reader.cc:309] ../labels_clang_build/bin/clang-17 has no build-id. Use '--profiled_binary_name' to force name matching.

The diff is the following (only related to this issue, without patches for #179):

--- propeller_optimize_clang.sh.orig	2023-10-26 16:54:07.550679311 +0900
+++ propeller_optimize_clang.sh	2023-10-26 17:11:04.873511091 +0900
@@ -111,6 +111,7 @@ ls perf.data
 cd ${BENCHMARKING_CLANG_BUILD}
 ${PATH_TO_CREATE_LLVM_PROF}/build/create_llvm_prof --format=propeller \
   --binary=${PATH_TO_LABELS_CLANG_BUILD}/bin/clang-${CLANG_VERSION} \
+  --profiled_binary_name=${PATH_TO_LABELS_CLANG_BUILD}/bin/clang-${CLANG_VERSION} \
   --profile=perf.data --out=cluster.txt  --propeller_symorder=symorder.txt 2>/dev/null 1>/dev/null
 ls cluster.txt symorder.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant