Re:Re: [PATCH] translations/zh_CN: add translations to dev-tools gcov
Hi Wu X.C: From: "Wu X.C." Date: 2021-03-31 23:35:03 To: Bernard Zhao Cc: Harry Wei ,Alex Shi ,Alex Shi ,Jonathan Corbet ,Nathan Chancellor ,Nick Desaulniers ,linux-...@vger.kernel.org,linux-kernel@vger.kernel.org,clang-built-li...@googlegroups.com,opensource.ker...@vivo.com Subject: Re: [PATCH] translations/zh_CN: add translations to dev-tools gcov>Hi Bernard, > >I'd like to help Alex to make a pre-review. > >On Wed, Mar 31, 2021 at 06:14:05AM -0700, Bernard Zhao wrote: >> Add translations to dev-tools gcov >> >> Signed-off-by: Bernard Zhao >> --- >> .../translations/zh_CN/dev-tools/gcov.rst | 274 ++ >> 1 file changed, 274 insertions(+) >> create mode 100644 Documentation/translations/zh_CN/dev-tools/gcov.rst > >It seems that you are the first person who add zh translation in >zh_CN/dev-tools, so please also add the zh_CN/dev-tools/index.rst and link >it to zh_CN/index.rst, or your work will not appear when building docs. > >You could mark the un-translated docs of dev-tools in 'TodoList', just >as zh_CN/admin-guide/index.rst. Thanks for your pre-review! I will fix this and resubmit this patch. BR//Bernard >> >> diff --git a/Documentation/translations/zh_CN/dev-tools/gcov.rst >> b/Documentation/translations/zh_CN/dev-tools/gcov.rst >> new file mode 100644 >> index ..5ebbc55e5881 >> --- /dev/null >> +++ b/Documentation/translations/zh_CN/dev-tools/gcov.rst >> @@ -0,0 +1,274 @@ > ><<<<<<<<<<<<<<< > >> +Chinese translated version of Documentation/dev-tools/gcov.rst >> + >> +If you have any comment or update to the content, please contact the >> +original document maintainer directly. However, if you have a problem >> +communicating in English you can also ask the Chinese maintainer for >> +help. Contact the Chinese maintainer if this translation is outdated >> +or if there is a problem with the translation. >> + >> +Chinese maintainer: Bernard Zhao >> +- >> +Documentation/dev-tools/gcov.rst 的中文翻译 >> + >> +如果想评论或更新本文的内容,请直接联系原文档的维护者。如果你使用英文 >> +交流有困难的话,也可以向中文版维护者求助。如果本翻译更新不及时或者翻 >> +译存在问题,请联系中文版维护者。 >> + >> +中文版维护者: 赵军奎 Bernard Zhao >> +中文版翻译者: 赵军奎 Bernard Zhao >> + >> +以下为正文 >> +- > ><<<<<<<<<<<<<<< > >You seems use the old style of zh translation header. Please follow this: > >.. include:: ../disclaimer-zh_CN.rst > >:Original: Documentation/dev-tools/gcov.rst > >:Translator: 赵军奎 Bernard Zhao > >The 'include' will give the unified declaration, and use tags for other >informations. > >Example see: > Documentation/translations/zh_CN/process/1.Intro.rst > >> + >> +在Linux内核里使用gcov做代码覆盖率检查 >> +=== > >Here, = line must longer than title text. Please make before send >patch, will find a warning. And need a empty line under the = line. > >Reference: > Documentation/doc-guide/sphinx.rst > >> +gcov是linux中已经集成的一个分析模块,该模块在内核中对GCC的代码覆盖率统 >> +计提供了支持。 >> +linux内核运行时的代码覆盖率数据会以gcov兼容的格式存储在debug-fs中,可 >> +以通过如下的方式获得指定文件的代码运行覆盖率统计数据(需要跳转到内核 >> +编译路径下并且要有root权限): > ^^ >You missed "use gcov with the ``-o`` option as follows" > >'::' is a special symbol for ReST, do not use ':' to replace it. >Make test will also help with this point. > >> + >> +# cd /tmp/linux-out >> +# gcov -o /sys/kernel/debug/gcov/tmp/linux-out/kernel spinlock.c >> + >> +这个命令会在当前编译路径下创建带有注释的代码实际运行次数的计数源文件。 > >这将在当前目录中创建带有执行计数注释的源代码文件。 > >> +在获得这些统计文件后,可以使用图形化的gcov前端工具(比如lcov), >> +来实现自动化处理linux kernel的覆盖率运行数据,同时生成易于阅读的HTML格 > ^^ > 内核 > >本文所有kernel是否翻译请注意统一,建议能译全译 > >> +式文件。 >> + >> +可能的用途: >> + >> +* 调试(用来判断每一行的代码是否已经运行过) >> +* 测试改进(如何修改测试代码,尽可能地覆盖到没有运行过的代码) >> +* 内核配置优化(对于某一个config配置,如果关联的代码从来没有运行过,是 > ^^ > option选项 > >> +否还需要这个配置) >> + >> +gcov和lcov的关联网站 > >This line no need. Follow two lines are ReST tags. > >> +.. _gcov: https://gcc.gnu.org/onlinedocs/gcc/Gcov.html >> +.. _lcov: http://ltp.sourceforge.net/coverage/lcov.php > >Maybe you need to change tags for the two lines, same tag in zh and en will >cause warning. > >> + >> + >> +准备 >> +--- >> + >> +打开如下配置: >> + >> +
Re: [PATCH] translations/zh_CN: add translations to dev-tools gcov
Hi Bernard, I'd like to help Alex to make a pre-review. On Wed, Mar 31, 2021 at 06:14:05AM -0700, Bernard Zhao wrote: > Add translations to dev-tools gcov > > Signed-off-by: Bernard Zhao > --- > .../translations/zh_CN/dev-tools/gcov.rst | 274 ++ > 1 file changed, 274 insertions(+) > create mode 100644 Documentation/translations/zh_CN/dev-tools/gcov.rst It seems that you are the first person who add zh translation in zh_CN/dev-tools, so please also add the zh_CN/dev-tools/index.rst and link it to zh_CN/index.rst, or your work will not appear when building docs. You could mark the un-translated docs of dev-tools in 'TodoList', just as zh_CN/admin-guide/index.rst. > > diff --git a/Documentation/translations/zh_CN/dev-tools/gcov.rst > b/Documentation/translations/zh_CN/dev-tools/gcov.rst > new file mode 100644 > index ..5ebbc55e5881 > --- /dev/null > +++ b/Documentation/translations/zh_CN/dev-tools/gcov.rst > @@ -0,0 +1,274 @@ <<< > +Chinese translated version of Documentation/dev-tools/gcov.rst > + > +If you have any comment or update to the content, please contact the > +original document maintainer directly. However, if you have a problem > +communicating in English you can also ask the Chinese maintainer for > +help. Contact the Chinese maintainer if this translation is outdated > +or if there is a problem with the translation. > + > +Chinese maintainer: Bernard Zhao > +- > +Documentation/dev-tools/gcov.rst 的中文翻译 > + > +如果想评论或更新本文的内容,请直接联系原文档的维护者。如果你使用英文 > +交流有困难的话,也可以向中文版维护者求助。如果本翻译更新不及时或者翻 > +译存在问题,请联系中文版维护者。 > + > +中文版维护者: 赵军奎 Bernard Zhao > +中文版翻译者: 赵军奎 Bernard Zhao > + > +以下为正文 > +- <<< You seems use the old style of zh translation header. Please follow this: .. include:: ../disclaimer-zh_CN.rst :Original: Documentation/dev-tools/gcov.rst :Translator: 赵军奎 Bernard Zhao The 'include' will give the unified declaration, and use tags for other informations. Example see: Documentation/translations/zh_CN/process/1.Intro.rst > + > +在Linux内核里使用gcov做代码覆盖率检查 > +=== Here, = line must longer than title text. Please make before send patch, will find a warning. And need a empty line under the = line. Reference: Documentation/doc-guide/sphinx.rst > +gcov是linux中已经集成的一个分析模块,该模块在内核中对GCC的代码覆盖率统 > +计提供了支持。 > +linux内核运行时的代码覆盖率数据会以gcov兼容的格式存储在debug-fs中,可 > +以通过如下的方式获得指定文件的代码运行覆盖率统计数据(需要跳转到内核 > +编译路径下并且要有root权限): ^^ You missed "use gcov with the ``-o`` option as follows" '::' is a special symbol for ReST, do not use ':' to replace it. Make test will also help with this point. > + > +# cd /tmp/linux-out > +# gcov -o /sys/kernel/debug/gcov/tmp/linux-out/kernel spinlock.c > + > +这个命令会在当前编译路径下创建带有注释的代码实际运行次数的计数源文件。 这将在当前目录中创建带有执行计数注释的源代码文件。 > +在获得这些统计文件后,可以使用图形化的gcov前端工具(比如lcov), > +来实现自动化处理linux kernel的覆盖率运行数据,同时生成易于阅读的HTML格 ^^ 内核 本文所有kernel是否翻译请注意统一,建议能译全译 > +式文件。 > + > +可能的用途: > + > +* 调试(用来判断每一行的代码是否已经运行过) > +* 测试改进(如何修改测试代码,尽可能地覆盖到没有运行过的代码) > +* 内核配置优化(对于某一个config配置,如果关联的代码从来没有运行过,是 ^^ option选项 > +否还需要这个配置) > + > +gcov和lcov的关联网站 This line no need. Follow two lines are ReST tags. > +.. _gcov: https://gcc.gnu.org/onlinedocs/gcc/Gcov.html > +.. _lcov: http://ltp.sourceforge.net/coverage/lcov.php Maybe you need to change tags for the two lines, same tag in zh and en will cause warning. > + > + > +准备 > +--- > + > +打开如下配置: > + > +CONFIG_DEBUG_FS=y > +CONFIG_GCOV_KERNEL=y > + > +获取整个内核的覆盖率数据,还需要打开: > + > +CONFIG_GCOV_PROFILE_ALL=y > + > +需要注意的是,整个kernel开启覆盖率统计回造成kernel镜像文件尺寸的增大 ^^ ^^ ^ 会 > +同时kernel运行的也会变慢一些。 > +另外,并不是所有的架构都支持整个kernel开启覆盖率统计。 > + > +代码运行覆盖率数据只在debugfs挂载完成后才可以访问: ^^ :: > + > +mount -t debugfs none /sys/kernel/debug > + > + > +客制化 > +- > + > +如果要单独针对某一个路径或者文件进行代码覆盖率统计,可以在kernel相应路 ^^ > +径的Makefile中增加如下的配置: > + > +- 单独统计单个文件(例如main.o) > + > + GCOV_PROFILE_main.o := y > + > +- 单独统计某一个路径 > + > + GCOV_PROFILE := y > + > +如果要在整个kernel的覆盖率统计(开启CONFIG_GCOV_PROFILE_ALL)中单独排除 > +某一个文件或者路径,可以使用如下的方法: ^^ :: > + > +- 不统计单个文件(例如main.o) Please do not change original content structure. If you want to change that, please modify en version first. GCOV_PROFILE_main.o := n 和:: GCOV_PROFILE := n > + > + GCOV_PROFILE_main.o := n > + > +- 不统计某一个路径 > + > + GCOV_PROFILE := n > + Missed follow sentence:
[PATCH] translations/zh_CN: add translations to dev-tools gcov
Add translations to dev-tools gcov Signed-off-by: Bernard Zhao --- .../translations/zh_CN/dev-tools/gcov.rst | 274 ++ 1 file changed, 274 insertions(+) create mode 100644 Documentation/translations/zh_CN/dev-tools/gcov.rst diff --git a/Documentation/translations/zh_CN/dev-tools/gcov.rst b/Documentation/translations/zh_CN/dev-tools/gcov.rst new file mode 100644 index ..5ebbc55e5881 --- /dev/null +++ b/Documentation/translations/zh_CN/dev-tools/gcov.rst @@ -0,0 +1,274 @@ +Chinese translated version of Documentation/dev-tools/gcov.rst + +If you have any comment or update to the content, please contact the +original document maintainer directly. However, if you have a problem +communicating in English you can also ask the Chinese maintainer for +help. Contact the Chinese maintainer if this translation is outdated +or if there is a problem with the translation. + +Chinese maintainer: Bernard Zhao +- +Documentation/dev-tools/gcov.rst ??? + +?? +?? + + +? ? Bernard Zhao +? ? Bernard Zhao + +??? +- + +???Linux???gcov +=== +gcov???linux???GCC? +? +linux?gcovdebug-fs? +?? +???root + +# cd /tmp/linux-out +# gcov -o /sys/kernel/debug/gcov/tmp/linux-out/kernel spinlock.c + +? +?gcov?lcov?? +linux kernel??HTML??? + + +?? + +* ??? +* ?? +* config? +??? + +gcov???lcov??? +.. _gcov: https://gcc.gnu.org/onlinedocs/gcc/Gcov.html +.. _lcov: http://ltp.sourceforge.net/coverage/lcov.php + + +?? +--- + +? + +CONFIG_DEBUG_FS=y +CONFIG_GCOV_KERNEL=y + +? + +CONFIG_GCOV_PROFILE_ALL=y + +???kernel??kernel?? +??kernel?? +kernel + +?debugfs? + +mount -t debugfs none /sys/kernel/debug + + +? +- + +???kernel? +??Makefile??? + +- ?main.o??? + + GCOV_PROFILE_main.o := y + +- ??? + + GCOV_PROFILE := y + +??kernel???CONFIG_GCOV_PROFILE_ALL?? + + +- ??main.o??? + + GCOV_PROFILE_main.o := n + +- + + GCOV_PROFILE := n + + +??? +- + +gcov???debugfs? + +``/sys/kernel/debug/gcov`` +gcov + +``/sys/kernel/debug/gcov/reset`` +gcov???gcov???0 + +``/sys/kernel/debug/gcov/path/to/compile/dir/file.gcda`` +gcov + +``/sys/kernel/debug/gcov/path/to/compile/dir/file.gcno`` + gcov +???gcc??-ftest-coverage??? + + +??module? +--- + +kernel?? +gcov +debugfs?