Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
PGO kernel using GCC?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
gso321
n00b
n00b


Joined: 02 Jan 2023
Posts: 15

PostPosted: Wed Mar 15, 2023 1:13 am    Post subject: PGO kernel using GCC? Reply with quote

Does anyone here have manage to use Profile Guided Optimizations for modern Linux kernel with GCC?

Most websites i seen are either outdated or not specific like coolypf and Yuan's paper. I decided to follow Yuan's approach till i got stuck part at "a shell script is used to collect
profile data files from DebugFS
" in phase 2. My original question was going to be "What is the shell script is used to collect profile data files from DebugFS?" but i didn't want to get blamed for taking the XY problem.

To be more specific, i used sys-kernel/gentoo-sources-6.2.5 with experimental use flag. I turn on CONFIG_GCOV_KERNEL and CONFIG_GCOV_PROFILE_ALL, complied the kernel, then reboot. The *.gcda files show up in /sys/kernel/debug/gcov/usr/src/linux. I disable CONFIG_GCOV_KERNEL and CONFIG_GCOV_PROFILE_ALL. Then i edit
Code:
KCFLAGS = "fprofile-use -fprofile-correction"
and, after compiling, the problem occurs with
Code:
error: ‘/usr/src/linux-6.2.5-gentoo/tools/objtool/weak.gcda’ profile count data file not found
Back to top
View user's profile Send private message
kuhitori
n00b
n00b


Joined: 24 May 2023
Posts: 1

PostPosted: Wed May 24, 2023 12:00 pm    Post subject: Reply with quote

gso321, I use 6.1.28 wtih PGO, you need to copy the .gcda files to /usr/src/kernel before compiling.

Please read this for proper use of GCC PGO

Kuhitori
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum