Re: [PATCH V7] GCOV: Add config to check the preqequisites situation
Hi ALL: Not recieve more advise for a long time , Can this submission be merged recently? Cixi Geng 于2020年8月20日周四 下午8:40写道: > > Hi All: > > Does this patch need more modification? > > 于2020年7月27日周一 下午4:51写道: > > > > From: Cixi Geng > > > > Introduce new configuration option GCOV_PROFILE_PREREQS that can be > > used to check whether the prerequisites for enabling gcov profiling > > for specific files and directories are met. > > > > Only add SERIAL_GCOV for an example. > > > > Signed-off-by: Cixi Geng > > --- > > drivers/tty/serial/Kconfig | 7 +++ > > drivers/tty/serial/Makefile | 1 + > > kernel/gcov/Kconfig | 12 > > 3 files changed, 20 insertions(+) > > > > diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig > > index 780908d43557..55b128b6b31d 100644 > > --- a/drivers/tty/serial/Kconfig > > +++ b/drivers/tty/serial/Kconfig > > @@ -1576,3 +1576,10 @@ endmenu > > > > config SERIAL_MCTRL_GPIO > > tristate > > + > > +config SERIAL_GCOV > > + bool "Enable profile gcov for serial directory" > > + depends on GCOV_PROFILE_PREREQS > > + help > > + The SERIAL_GCOV will add Gcov profiling flags when kernel > > compiles. > > + Say 'Y' here if you want the gcov data for the serial directory, > > diff --git a/drivers/tty/serial/Makefile b/drivers/tty/serial/Makefile > > index d056ee6cca33..17272733db95 100644 > > --- a/drivers/tty/serial/Makefile > > +++ b/drivers/tty/serial/Makefile > > @@ -3,6 +3,7 @@ > > # Makefile for the kernel serial device drivers. > > # > > > > +GCOV_PROFILE := $(CONFIG_SERIAL_GCOV) > > obj-$(CONFIG_SERIAL_CORE) += serial_core.o > > > > obj-$(CONFIG_SERIAL_EARLYCON) += earlycon.o > > diff --git a/kernel/gcov/Kconfig b/kernel/gcov/Kconfig > > index 3110c77230c7..bb2e1fb85743 100644 > > --- a/kernel/gcov/Kconfig > > +++ b/kernel/gcov/Kconfig > > @@ -51,4 +51,16 @@ config GCOV_PROFILE_ALL > > larger and run slower. Also be sure to exclude files from profiling > > which are not linked to the kernel image to prevent linker errors. > > > > +config GCOV_PROFILE_PREREQS > > + bool "Profile Kernel for prereqs" > > + depends on GCOV_KERNEL > > + depends on !COMPILE_TEST > > + def_bool y if GCOV_KERNEL && !COMPILE_TEST > > + help > > + This options activates profiling for the specified kernel modules. > > + > > + When some modules need Gcov data, enable this config, then > > configure > > + with gcov on the corresponding modules,The directories or files of > > + these modules will be added profiling flags after kernel compile. > > + > > endmenu > > -- > > 2.17.1 > >
Re: [PATCH V7] GCOV: Add config to check the preqequisites situation
Hi All: Does this patch need more modification? 于2020年7月27日周一 下午4:51写道: > > From: Cixi Geng > > Introduce new configuration option GCOV_PROFILE_PREREQS that can be > used to check whether the prerequisites for enabling gcov profiling > for specific files and directories are met. > > Only add SERIAL_GCOV for an example. > > Signed-off-by: Cixi Geng > --- > drivers/tty/serial/Kconfig | 7 +++ > drivers/tty/serial/Makefile | 1 + > kernel/gcov/Kconfig | 12 > 3 files changed, 20 insertions(+) > > diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig > index 780908d43557..55b128b6b31d 100644 > --- a/drivers/tty/serial/Kconfig > +++ b/drivers/tty/serial/Kconfig > @@ -1576,3 +1576,10 @@ endmenu > > config SERIAL_MCTRL_GPIO > tristate > + > +config SERIAL_GCOV > + bool "Enable profile gcov for serial directory" > + depends on GCOV_PROFILE_PREREQS > + help > + The SERIAL_GCOV will add Gcov profiling flags when kernel compiles. > + Say 'Y' here if you want the gcov data for the serial directory, > diff --git a/drivers/tty/serial/Makefile b/drivers/tty/serial/Makefile > index d056ee6cca33..17272733db95 100644 > --- a/drivers/tty/serial/Makefile > +++ b/drivers/tty/serial/Makefile > @@ -3,6 +3,7 @@ > # Makefile for the kernel serial device drivers. > # > > +GCOV_PROFILE := $(CONFIG_SERIAL_GCOV) > obj-$(CONFIG_SERIAL_CORE) += serial_core.o > > obj-$(CONFIG_SERIAL_EARLYCON) += earlycon.o > diff --git a/kernel/gcov/Kconfig b/kernel/gcov/Kconfig > index 3110c77230c7..bb2e1fb85743 100644 > --- a/kernel/gcov/Kconfig > +++ b/kernel/gcov/Kconfig > @@ -51,4 +51,16 @@ config GCOV_PROFILE_ALL > larger and run slower. Also be sure to exclude files from profiling > which are not linked to the kernel image to prevent linker errors. > > +config GCOV_PROFILE_PREREQS > + bool "Profile Kernel for prereqs" > + depends on GCOV_KERNEL > + depends on !COMPILE_TEST > + def_bool y if GCOV_KERNEL && !COMPILE_TEST > + help > + This options activates profiling for the specified kernel modules. > + > + When some modules need Gcov data, enable this config, then configure > + with gcov on the corresponding modules,The directories or files of > + these modules will be added profiling flags after kernel compile. > + > endmenu > -- > 2.17.1 >
Re: kunit compile failed on um
Here I found my error rootcause: My Makefile add a Werror flag, So it wil build waring as error as the follow code ../arch/um/os-Linux/signal.c: In function \xe2\x80\x98sig_handler_common\xe2\x80\x99: ../arch/um/os-Linux/signal.c:51:1: error: the frame size of 2960 bytes is larger than 2048 bytes [-Werror=frame-larger-than=] } ^ ../arch/um/os-Linux/signal.c: In function \xe2\x80\x98timer_real_alarm_handler\xe2\x80\x99: ../arch/um/os-Linux/signal.c:95:1: error: the frame size of 2960 bytes is larger than 2048 bytes [-Werror=frame-larger-than=] } and I add the CONFIG_FRAME_WARN=4096 in arch/um/x86_64_defconfig so there was no error when I use make ARCH=um defconfig && make ARCH=um BUT I found the commit ff7b437f36b026dcd7351f86a90a0424c891dc06 has changed use make ARCH=um kunit_defconfig in kunit.py. So the error happened. Further More, I compare the different between use x86_64_defconfig and kunit_defconfig, there is a big difference. Can We use kunit_defconfig on the basis of the x86_64_defconfig ? If the answer is ok, I would like to help add this functions Brendan Higgins 于2020年7月28日周二 上午5:29写道: > > On Mon, Jul 27, 2020 at 3:01 AM Cixi Geng wrote: > > > > Hi Brendan: > > When I run kunit test in um , it failed on kernel 5.8-rc* while > > succeeded in v5.7 with same configuration. is this a bug? > > > > Here is my operation: > > gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04) > > > > the kunitconfig: > > Cixi.Geng:~/git-projects/torvals-linux$ cat .kunitconfig > > CONFIG_KUNIT=y > > CONFIG_KUNIT_TEST=y > > CONFIG_KUNIT_EXAMPLE_TEST=y > > > > command: > > Cixi.Geng:~/git-projects/torvals-linux$ ./tools/testing/kunit/kunit.py run > > > > the Error log: > > [17:51:14] Configuring KUnit Kernel ... > > [17:51:14] Building KUnit Kernel ... > > ERROR:root:b"make[1]: > > \xe8\xbf\x9b\xe5\x85\xa5\xe7\x9b\xae\xe5\xbd\x95\xe2\x80\x9c/home/cixi.geng1/git-projects/torvals-linux/.kunit\xe2\x80\x9d\n/home/cixi.geng1/git-projects/torvals-linux/Makefile:551: > > recipe for target 'outputmakefile' failed\nmake[1]: > > \xe7\xa6\xbb\xe5\xbc\x80\xe7\x9b\xae\xe5\xbd\x95\xe2\x80\x9c/home/cixi.geng1/git-projects/torvals-linux/.kunit\xe2\x80\x9d\nMakefile:185: > > recipe for target '__sub-make' failed\n" > > So we have a fix out for the cryptic error messages: > > https://patchwork.kernel.org/patch/11652711/ > > But I believe it has not been picked up yet. > > In the meantime, you should get more information by running > > ls .kunit > make ARCH=um O=.kunit > > Let us know if you have any additional questions.
kunit compile failed on um
Hi Brendan: When I run kunit test in um , it failed on kernel 5.8-rc* while succeeded in v5.7 with same configuration. is this a bug? Here is my operation: gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04) the kunitconfig: Cixi.Geng:~/git-projects/torvals-linux$ cat .kunitconfig CONFIG_KUNIT=y CONFIG_KUNIT_TEST=y CONFIG_KUNIT_EXAMPLE_TEST=y command: Cixi.Geng:~/git-projects/torvals-linux$ ./tools/testing/kunit/kunit.py run the Error log: [17:51:14] Configuring KUnit Kernel ... [17:51:14] Building KUnit Kernel ... ERROR:root:b"make[1]: \xe8\xbf\x9b\xe5\x85\xa5\xe7\x9b\xae\xe5\xbd\x95\xe2\x80\x9c/home/cixi.geng1/git-projects/torvals-linux/.kunit\xe2\x80\x9d\n/home/cixi.geng1/git-projects/torvals-linux/Makefile:551: recipe for target 'outputmakefile' failed\nmake[1]: \xe7\xa6\xbb\xe5\xbc\x80\xe7\x9b\xae\xe5\xbd\x95\xe2\x80\x9c/home/cixi.geng1/git-projects/torvals-linux/.kunit\xe2\x80\x9d\nMakefile:185: recipe for target '__sub-make' failed\n"
Re: [PATCH V6] GCOV: Add config to check the preqequisites situation
Hi All: Does this patch need more modification? > 发件人: gengc...@gmail.com > 发送时间: 2020年6月18日 18:08 > 收件人: gre...@linuxfoundation.org; jsl...@suse.com; ober...@linux.ibm.com; > linux-ser...@vger.kernel.org; linux-kernel@vger.kernel.org > 抄送: orsonz...@gmail.com; zhang.l...@gmail.com; 耿慈熙 (Cixi Geng/10039) > 主题: [PATCH V6] GCOV: Add config to check the preqequisites situation > > From: Cixi Geng > > Introduce new configuration option GCOV_PROFILE_PREREQS that can be > used to check whether the prerequisites for enabling gcov profiling > for specific files and directories are met. > > Only add SERIAL_GCOV for an example. > > Signed-off-by: Cixi Geng > --- > drivers/tty/serial/Kconfig | 7 +++ > drivers/tty/serial/Makefile | 1 + > kernel/gcov/Kconfig | 10 ++ > 3 files changed, 18 insertions(+) > > diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig > index adf9e80e7dc9..6df002370f18 100644 > --- a/drivers/tty/serial/Kconfig > +++ b/drivers/tty/serial/Kconfig > @@ -1566,3 +1566,10 @@ endmenu > > config SERIAL_MCTRL_GPIO > tristate > + > +config SERIAL_GCOV > + bool "Enable profile gcov for serial directory" > + depends on GCOV_PROFILE_PREREQS > + help > + The SERIAL_GCOV will add Gcov profiling flags when kernel compiles. > + Say 'Y' here if you want the gcov data for the serial directory, > diff --git a/drivers/tty/serial/Makefile b/drivers/tty/serial/Makefile > index d056ee6cca33..17272733db95 100644 > --- a/drivers/tty/serial/Makefile > +++ b/drivers/tty/serial/Makefile > @@ -3,6 +3,7 @@ > # Makefile for the kernel serial device drivers. > # > > +GCOV_PROFILE := $(CONFIG_SERIAL_GCOV) > obj-$(CONFIG_SERIAL_CORE) += serial_core.o > > obj-$(CONFIG_SERIAL_EARLYCON) += earlycon.o > diff --git a/kernel/gcov/Kconfig b/kernel/gcov/Kconfig > index 3941a9c48f83..f415c4aaf0ab 100644 > --- a/kernel/gcov/Kconfig > +++ b/kernel/gcov/Kconfig > @@ -51,6 +51,16 @@ config GCOV_PROFILE_ALL > larger and run slower. Also be sure to exclude files from profiling > which are not linked to the kernel image to prevent linker errors. > > +config GCOV_PROFILE_PREREQS > + bool "Profile Kernel for prereqs" > + default y if GCOV_KERNEL && !COMPILE_TEST > + help > + This options activates profiling for the specified kernel modules. > + > + When some modules need Gcov data, enable this config, then configure > + with gcov on the corresponding modules,The directories or files of > + these modules will be added profiling flags after kernel compile. > + > choice > prompt "Specify GCOV format" > depends on GCOV_KERNEL > -- > 2.17.1
Re: [RFC PATCH v4] GCOV: profile by modules
Peter Oberparleiter 于2020年5月28日周四 下午10:47写道: > > On 25.05.2020 12:00, gengc...@gmail.com wrote: > > From: Cixi Geng > > > > The CONFIG_GCOV_PROFILE_ALL will compile kernel by profiling entire > > kernel which will lead to kernel run slower.Use GCOV_PROFILE_PREREQS > > to control part of the kernel modules to open gcov. > > Maybe rephrase the commit message to make the intention more obvious: > > Introduce new configuration option GCOV_PROFILE_PREREQS that can be used > to check whether the prerequisites for enabling gcov profiling for > specific files and directories are met. > > > > > Only add SERIAL_GCOV for an example. > > > > Signed-off-by: Cixi Geng > > --- > > drivers/tty/serial/Kconfig | 7 +++ > > drivers/tty/serial/Makefile | 1 + > > kernel/gcov/Kconfig | 14 ++ > > 3 files changed, 22 insertions(+) > > > > diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig > > index adf9e80e7dc9..6df002370f18 100644 > > --- a/drivers/tty/serial/Kconfig > > +++ b/drivers/tty/serial/Kconfig > > @@ -1566,3 +1566,10 @@ endmenu > > > > config SERIAL_MCTRL_GPIO > > tristate > > + > > +config SERIAL_GCOV > > + bool "Enable profile gcov for serial directory" > > + depends on GCOV_PROFILE_PREREQS > > + help > > + The SERIAL_GCOV will add Gcov profiling flags when kernel compiles. > > + Say 'Y' here if you want the gcov data for the serial directory, > > diff --git a/drivers/tty/serial/Makefile b/drivers/tty/serial/Makefile > > index d056ee6cca33..17272733db95 100644 > > --- a/drivers/tty/serial/Makefile > > +++ b/drivers/tty/serial/Makefile > > @@ -3,6 +3,7 @@ > > # Makefile for the kernel serial device drivers. > > # > > > > +GCOV_PROFILE := $(CONFIG_SERIAL_GCOV) > > obj-$(CONFIG_SERIAL_CORE) += serial_core.o > > > > obj-$(CONFIG_SERIAL_EARLYCON) += earlycon.o > > diff --git a/kernel/gcov/Kconfig b/kernel/gcov/Kconfig > > index 3941a9c48f83..ea8b514f5676 100644 > > --- a/kernel/gcov/Kconfig > > +++ b/kernel/gcov/Kconfig > > @@ -51,6 +51,20 @@ config GCOV_PROFILE_ALL > > larger and run slower. Also be sure to exclude files from profiling > > which are not linked to the kernel image to prevent linker errors. > > > > +config GCOV_PROFILE_PREREQS > > + bool "Profile Kernel subsytem" > > + depends on !COMPILE_TEST > > + depends on GCOV_KERNEL > > + depends on !GCOV_PROFILE_ALL > > + help > > + This options activates profiling for the specified kernel modules. > > + > > + When some modules need Gcov data, enable this config, then configure > > + with gcov on the corresponding modules,The directories or files of > > + these modules will be added profiling flags after kernel compile. > > + > > + If unsure, say N. > > This is not quite what I had in mind. A user still needs to manually > select GCOV_PROFILE, then GCOV_PROFILE_PREREQS, then SERIAL_GCOV. > > My though was that you could provide an automatic config option that is > invisible in the configuration dialog, and that is automatically > selected when all prereqs for enabling GCOV in a module directory are met. > > Something like the following: > > config GCOV_PROFILE_PREREQS > bool > default y if GCOV_KERNEL && !COMPILE_TEST > default n > > There's no need to add GCOV_KERNEL_ALL here since that is about a user > choice ("I want all code compiled with profiling") vs. this new symbol > which is about an ability ("all prereqs for enabling profiling in > specific directories are met). > As far as I'm concerned, The GCOV_KERNEL_ALL will conflict with GCOV_PROFILE_PREREQS,since the GCOV_KERNEL_ALL will profing all code which contain the new config. > > > + > > choice > > prompt "Specify GCOV format" > > depends on GCOV_KERNEL > > > > > -- > Peter Oberparleiter > Linux on Z Development - IBM Germany
Re: [RFC][PATCH V3] GCOV: profile by modules
Hi Greg: DId you mean that the GCOV_PROFILE_PREREQS should add depends on !GCOV_PROFILE_ALL ,then when GCOV_PROFILE_ALL is enabled, the config GCOV_PROFILE_PREREQS will no longer works. Greg KH 于2020年5月22日周五 下午4:37写道: > > On Fri, May 22, 2020 at 03:19:17PM +0800, gengc...@gmail.com wrote: > > From: Cixi Geng > > > > The CONFIG_GCOV_PROFILE_ALL will compile kernel by profiling entire > > kernel which will lead to kernel run slower.Use GCOV_PROFILE_PREREQS > > to control part of the kernel modules to open gcov. > > > > Only add SERIAL_GCOV for an example. > > > > Signed-off-by: Cixi Geng > > --- > > drivers/tty/serial/Kconfig | 7 +++ > > drivers/tty/serial/Makefile | 1 + > > kernel/gcov/Kconfig | 13 + > > 3 files changed, 21 insertions(+) > > > > diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig > > index adf9e80e7dc9..6df002370f18 100644 > > --- a/drivers/tty/serial/Kconfig > > +++ b/drivers/tty/serial/Kconfig > > @@ -1566,3 +1566,10 @@ endmenu > > > > config SERIAL_MCTRL_GPIO > > tristate > > + > > +config SERIAL_GCOV > > + bool "Enable profile gcov for serial directory" > > + depends on GCOV_PROFILE_PREREQS > > + help > > + The SERIAL_GCOV will add Gcov profiling flags when kernel compiles. > > + Say 'Y' here if you want the gcov data for the serial directory, > > diff --git a/drivers/tty/serial/Makefile b/drivers/tty/serial/Makefile > > index d056ee6cca33..17272733db95 100644 > > --- a/drivers/tty/serial/Makefile > > +++ b/drivers/tty/serial/Makefile > > @@ -3,6 +3,7 @@ > > # Makefile for the kernel serial device drivers. > > # > > > > +GCOV_PROFILE := $(CONFIG_SERIAL_GCOV) > > obj-$(CONFIG_SERIAL_CORE) += serial_core.o > > > > obj-$(CONFIG_SERIAL_EARLYCON) += earlycon.o > > diff --git a/kernel/gcov/Kconfig b/kernel/gcov/Kconfig > > index 3941a9c48f83..4d75fa158726 100644 > > --- a/kernel/gcov/Kconfig > > +++ b/kernel/gcov/Kconfig > > @@ -51,6 +51,19 @@ config GCOV_PROFILE_ALL > > larger and run slower. Also be sure to exclude files from profiling > > which are not linked to the kernel image to prevent linker errors. > > > > +config GCOV_PROFILE_PREREQS > > + bool "Profile Kernel subsytem" > > + depends on !COMPILE_TEST > > + depends on GCOV_KERNEL > > + help > > + This options activates profiling for the specified kernel modules. > > + > > + When some modules need Gcov data, enable this config, then configure > > + with gcov on the corresponding modules,The directories or files of > > + these modules will be added profiling flags after kernel compile. > > + > > + If unsure, say N. > > + > > choice > > prompt "Specify GCOV format" > > depends on GCOV_KERNEL > > > I understand the goal here, but don't you need to have the main GCov > option depend on your new Kconfig option here? You have it switched > around here, so what keeps all code from being built with gcov support > at the moment? > > thanks, > > greg k-h
Re: [RFC][PATCH V2] GCOV: profile by modules
>> +config SERIAL_GCOV >> + bool "open gcov for serial" >What do you mean by "open"? And Kconfig entries are usually Upper Case" :) >> + depends on GCOV_PROFILE_PREREQS >> + help >> + Say Y here to enable gcov in serial. >I think we need more text here. Maybe I should use "Enable" instead of "open" for express more clearly. and I will add more description of SERIAL_GCOV Cixi Geng 于2020年5月20日周三 下午5:04写道: > > Thank you for guidances, I will fix error and upload new patch > > Greg KH 于2020年5月20日周三 下午4:51写道: > > > > On Wed, May 20, 2020 at 04:38:21PM +0800, gengc...@gmail.com wrote: > > > From: Cixi Geng > > > > > > --- > > > Replace symbol GCOV_PROFILE_MODULES with GCOV_PROFILE_PREREQS > > > --- > > > The CONFIG_GCOV_PROFILE_ALL will compile kernel by profiling entire > > > kernel which will lead to kernel run slower.Use GCOV_PROFILE_PREREQS > > > to control part of the kernel modules to open gcov. > > > > > > Only add SERIAL_GCOV for an example. > > > > > > Signed-off-by: Cixi Geng > > > --- > > > drivers/tty/serial/Kconfig | 6 ++ > > > drivers/tty/serial/Makefile | 1 + > > > kernel/gcov/Kconfig | 14 ++ > > > 3 files changed, 21 insertions(+) > > > > > > diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig > > > index adf9e80e7dc9..964df1a2989c 100644 > > > --- a/drivers/tty/serial/Kconfig > > > +++ b/drivers/tty/serial/Kconfig > > > @@ -1566,3 +1566,9 @@ endmenu > > > > > > config SERIAL_MCTRL_GPIO > > > tristate > > > + > > > +config SERIAL_GCOV > > > + bool "open gcov for serial" > > > > What do you mean by "open"? And Kconfig entries are usually Upper Case" :) > > > > > + depends on GCOV_PROFILE_PREREQS > > > + help > > > + Say Y here to enable gcov in serial. > > > > I think we need more text here. > > > > > > > diff --git a/drivers/tty/serial/Makefile b/drivers/tty/serial/Makefile > > > index d056ee6cca33..7be1202286d2 100644 > > > --- a/drivers/tty/serial/Makefile > > > +++ b/drivers/tty/serial/Makefile > > > @@ -2,6 +2,7 @@ > > > # > > > # Makefile for the kernel serial device drivers. > > > # > > > +GCOV_PROFILE := $(CONFIG_SERIAL_GCOV) > > > > > > obj-$(CONFIG_SERIAL_CORE) += serial_core.o > > > > > > diff --git a/kernel/gcov/Kconfig b/kernel/gcov/Kconfig > > > index 3941a9c48f83..91cc8f3c7c43 100644 > > > --- a/kernel/gcov/Kconfig > > > +++ b/kernel/gcov/Kconfig > > > @@ -51,6 +51,20 @@ config GCOV_PROFILE_ALL > > > larger and run slower. Also be sure to exclude files from profiling > > > which are not linked to the kernel image to prevent linker errors. > > > > > > +config GCOV_PROFILE_PREREQS > > > + bool "Profile Kernel subsytem" > > > + depends on !COMPILE_TEST > > > + depends on GCOV_KERNEL > > > + default n > > > > default is always 'n', no need to list that > > > > > + help > > > + This options activates profiling for the specified kernel modules. > > > + > > > + If unsure, say N. > > > + > > > + When some modules need Gcov data, enable this config, then configure > > > + with gcov on the corresponding modules configs.The directories or > > > files > > > > '. '? > > > > > + of these modules will be added profiling flags after kernel compile. > > > > The lines under "help" need to be indented more, right? > > > > thanks, > > > > greg k-h
Re: [RFC][PATCH V2] GCOV: profile by modules
Thank you for guidances, I will fix error and upload new patch Greg KH 于2020年5月20日周三 下午4:51写道: > > On Wed, May 20, 2020 at 04:38:21PM +0800, gengc...@gmail.com wrote: > > From: Cixi Geng > > > > --- > > Replace symbol GCOV_PROFILE_MODULES with GCOV_PROFILE_PREREQS > > --- > > The CONFIG_GCOV_PROFILE_ALL will compile kernel by profiling entire > > kernel which will lead to kernel run slower.Use GCOV_PROFILE_PREREQS > > to control part of the kernel modules to open gcov. > > > > Only add SERIAL_GCOV for an example. > > > > Signed-off-by: Cixi Geng > > --- > > drivers/tty/serial/Kconfig | 6 ++ > > drivers/tty/serial/Makefile | 1 + > > kernel/gcov/Kconfig | 14 ++ > > 3 files changed, 21 insertions(+) > > > > diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig > > index adf9e80e7dc9..964df1a2989c 100644 > > --- a/drivers/tty/serial/Kconfig > > +++ b/drivers/tty/serial/Kconfig > > @@ -1566,3 +1566,9 @@ endmenu > > > > config SERIAL_MCTRL_GPIO > > tristate > > + > > +config SERIAL_GCOV > > + bool "open gcov for serial" > > What do you mean by "open"? And Kconfig entries are usually Upper Case" :) > > > + depends on GCOV_PROFILE_PREREQS > > + help > > + Say Y here to enable gcov in serial. > > I think we need more text here. > > > > diff --git a/drivers/tty/serial/Makefile b/drivers/tty/serial/Makefile > > index d056ee6cca33..7be1202286d2 100644 > > --- a/drivers/tty/serial/Makefile > > +++ b/drivers/tty/serial/Makefile > > @@ -2,6 +2,7 @@ > > # > > # Makefile for the kernel serial device drivers. > > # > > +GCOV_PROFILE := $(CONFIG_SERIAL_GCOV) > > > > obj-$(CONFIG_SERIAL_CORE) += serial_core.o > > > > diff --git a/kernel/gcov/Kconfig b/kernel/gcov/Kconfig > > index 3941a9c48f83..91cc8f3c7c43 100644 > > --- a/kernel/gcov/Kconfig > > +++ b/kernel/gcov/Kconfig > > @@ -51,6 +51,20 @@ config GCOV_PROFILE_ALL > > larger and run slower. Also be sure to exclude files from profiling > > which are not linked to the kernel image to prevent linker errors. > > > > +config GCOV_PROFILE_PREREQS > > + bool "Profile Kernel subsytem" > > + depends on !COMPILE_TEST > > + depends on GCOV_KERNEL > > + default n > > default is always 'n', no need to list that > > > + help > > + This options activates profiling for the specified kernel modules. > > + > > + If unsure, say N. > > + > > + When some modules need Gcov data, enable this config, then configure > > + with gcov on the corresponding modules configs.The directories or > > files > > '. '? > > > + of these modules will be added profiling flags after kernel compile. > > The lines under "help" need to be indented more, right? > > thanks, > > greg k-h