public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Wu X.C." <bobwxc@email.cn>
To: Fangrui Song <maskray@google.com>
Cc: Alex Shi <seakeel@gmail.com>, Alex Shi <alexs@kernel.org>,
	Bernard Zhao <bernard@vivo.com>, Jonathan Corbet <corbet@lwn.net>,
	YanTeng Si <sterlingteng@gmail.com>,
	Nathan Chancellor <nathan@kernel.org>,
	Nick Desaulniers <ndesaulniers@google.com>,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	clang-built-linux@googlegroups.com
Subject: Re: [PATCH v5] docs/zh_CN: add translations in zh_CN/dev-tools/gcov
Date: Thu, 15 Apr 2021 13:38:20 +0800	[thread overview]
Message-ID: <20210415053820.GA26262@bobwxc.top> (raw)
In-Reply-To: <20210415050755.onbtp7ftzawftrud@google.com>

[-- Attachment #1: Type: text/plain, Size: 3423 bytes --]

On Wed, Apr 14, 2021 at 10:07:55PM -0700, Fangrui Song wrote:
> Reviewed-by: Fangrui Song <maskray@google.com>
> 
> Inlined some suggestions.

Thanks for your review!

> 
> On 2021-04-14, Alex Shi wrote:
> > Reviewed-by: Alex Shi <alexs@kernel.org>
> > 
> > On 2021/4/14 下午9:21, Wu XiangCheng wrote:
> > > From: Bernard Zhao <bernard@vivo.com>
> > > 
> > > Add new zh translations
> > > * zh_CN/dev-tools/gcov.rst
> > > * zh_CN/dev-tools/index.rst
> > > and link them to zh_CN/index.rst
> > > 
> > > Signed-off-by: Bernard Zhao <bernard@vivo.com>
> > > Reviewed-by: Wu XiangCheng <bobwxc@email.cn>
> > > Signed-off-by: Wu XiangCheng <bobwxc@email.cn>
> > > ---
> > > +
[...]
> > > +在Linux内核里使用gcov做代码覆盖率检查
> > > +=====================================
> > > +
> > > +gcov是linux中已经集成的一个分析模块,该模块在内核中对GCC的代码覆盖率统
> 
> instrumentation 一般译作 插桩,而非 分析。

Have rewrited this paragraph.
Here is "gcov profiling kernel",gcov分析核心

> 
> > > +计提供了支持。
> > > +linux内核运行时的代码覆盖率数据会以gcov兼容的格式存储在debug-fs中,可
> 
> 专有名词 Linux 应大写。

Done.

> 
> > > +以通过gcov的 ``-o`` 选项(如下示例)获得指定文件的代码运行覆盖率统计数据
> > > +(需要跳转到内核编译路径下并且要有root权限)::
> > > +
> > > +    # cd /tmp/linux-out
> > > +    # gcov -o /sys/kernel/debug/gcov/tmp/linux-out/kernel spinlock.c
> > > +
> > > +这将在当前目录中创建带有执行计数注释的源代码文件。
> > > +在获得这些统计文件后,可以使用图形化的 gcov_ 前端工具(比如 lcov_ ),来实现
> > > +自动化处理linux内核的覆盖率运行数据,同时生成易于阅读的HTML格式文件。
> > > +
> > > +可能的用途:
> > > +
> > > +* 调试(用来判断每一行的代码是否已经运行过)
> > > +* 测试改进(如何修改测试代码,尽可能地覆盖到没有运行过的代码)
> > > +* 内核配置优化(对于某一个选项配置,如果关联的代码从来没有运行过,是
> > > +  否还需要这个配置)
> 
> minimizing: 优化 -> 最小化/简化

Done.

> 
> > > +.. _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
> > > +
> > > +需要注意的是,整个内核开启覆盖率统计会造成内核镜像文件尺寸的增大,
> > > +同时内核运行的也会变慢一些。
> 
> s/的//

Done.

> 
> > > +另外,并不是所有的架构都支持整个内核开启覆盖率统计。
> > > +
> > > +代码运行覆盖率数据只在debugfs挂载完成后才可以访问::
> > > +
[...]
> > > +
> > > +编译机和测试机分离
> > > +------------------
> > > +
> > > +gcov的内核分析架构支持内核的编译和运行是在同一台机器上,也可以编译和运
> 
> 分析 -> 插桩

Done.

> 
> > > +行是在不同的机器上。
[...]

Thanks!

Wu

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

  reply	other threads:[~2021-04-15  5:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-14  8:23 [patch v3] translations/zh_CN: add translations to dev-tools gcov Bernard Zhao
2021-04-14 11:24 ` [PATCH v4] docs/zh_CN: add translations in zh_CN/dev-tools/gcov Wu XiangCheng
2021-04-14 12:11   ` Alex Shi
2021-04-14 13:21 ` [PATCH v5] " Wu XiangCheng
2021-04-14 13:56   ` Alex Shi
2021-04-15  5:07     ` Fangrui Song
2021-04-15  5:38       ` Wu X.C. [this message]
2021-04-15  4:01   ` 答复: " Zengtao (B)
2021-04-15  5:39     ` Wu X.C.
2021-04-15  5:43 ` [PATCH v6] " Wu XiangCheng
2021-04-15 20:51   ` Jonathan Corbet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210415053820.GA26262@bobwxc.top \
    --to=bobwxc@email.cn \
    --cc=alexs@kernel.org \
    --cc=bernard@vivo.com \
    --cc=clang-built-linux@googlegroups.com \
    --cc=corbet@lwn.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maskray@google.com \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=seakeel@gmail.com \
    --cc=sterlingteng@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox