From: Alex Shi <seakeel@gmail.com>
To: Yanteng Si <siyanteng@loongson.cn>, alexs@kernel.org, bobwxc@email.cn
Cc: corbet@lwn.net, chenhuacai@kernel.org, jiaxun.yang@flygoat.com,
linux-doc@vger.kernel.org, siyanteng01@gmail.com,
zhoubinbin@loongson.cn, yizhou.tang@shopee.com,
wanjiabing@vivo.com, leoyang.li@nxp.com, src.res@email.cn
Subject: Re: [PATCH 4/8] Docs/zh_CN: Update the translation of testing-overview to 5.19-rc8
Date: Wed, 27 Jul 2022 10:18:04 +0800 [thread overview]
Message-ID: <49e9c2c2-0cc0-de41-c7dc-03d866cb38ee@gmail.com> (raw)
In-Reply-To: <61d805454b69bebfcba7b6df1b94d3811edefddc.1658740151.git.siyanteng@loongson.cn>
Reviewed-by: Alex Shi <alexs@kernel.org>
On 7/25/22 17:23, Yanteng Si wrote:
> Update to commit 12379401c000 ("Documentation: dev-tools:
> Add a section for static analysis tools")
>
> Signed-off-by: Yanteng Si <siyanteng@loongson.cn>
> ---
> .../zh_CN/dev-tools/testing-overview.rst | 25 +++++++++++++++++++
> 1 file changed, 25 insertions(+)
>
> diff --git a/Documentation/translations/zh_CN/dev-tools/testing-overview.rst b/Documentation/translations/zh_CN/dev-tools/testing-overview.rst
> index b7a1d13da6c6..d6f2c65ed511 100644
> --- a/Documentation/translations/zh_CN/dev-tools/testing-overview.rst
> +++ b/Documentation/translations/zh_CN/dev-tools/testing-overview.rst
> @@ -107,3 +107,28 @@ Documentation/dev-tools/kcov.rst 是能够构建在内核之中,用于在每
> 之后你就能确保这些错误在测试过程中都不会发生了。
>
> 一些工具与KUnit和kselftest集成,并且在检测到问题时会自动打断测试。
> +
> +静态分析工具
> +============
> +
> +除了测试运行中的内核,我们还可以使用**静态分析**工具直接分析内核的源代
> +码(**在编译时**)。内核中常用的工具允许人们检查整个源代码树或其中的特
> +定文件。它们使得在开发过程中更容易发现和修复问题。
> +
> + Sparse可以通过执行类型检查、锁检查、值范围检查来帮助测试内核,此外还
> + 可以在检查代码时报告各种错误和警告。关于如何使用它的细节,请参阅
> + Documentation/translations/zh_CN/dev-tools/sparse.rst。
> +
> + Smatch扩展了Sparse,并提供了对编程逻辑错误的额外检查,如开关语句中
> + 缺少断点,错误检查中未使用的返回值,忘记在错误路径的返回中设置错误代
> + 码等。Smatch也有针对更严重问题的测试,如整数溢出、空指针解除引用和内
> + 存泄漏。见项目页面http://smatch.sourceforge.net/。
> +
> + Coccinelle是我们可以使用的另一个静态分析器。Coccinelle经常被用来
> + 帮助源代码的重构和并行演化,但它也可以帮助避免常见代码模式中出现的某
> + 些错误。可用的测试类型包括API测试、内核迭代器的正确使用测试、自由操
> + 作的合理性检查、锁定行为的分析,以及已知的有助于保持内核使用一致性的
> + 进一步测试。详情请见Documentation/dev-tools/coccinelle.rst。
> +
> + 不过要注意的是,静态分析工具存在**假阳性**的问题。在试图修复错误和警
> + 告之前,需要仔细评估它们。
next prev parent reply other threads:[~2022-07-27 2:18 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-25 9:20 [PATCH 0/8] Docs/zh_CN: Update some translation to 5.19-rc8 Yanteng Si
2022-07-25 9:20 ` [PATCH 1/8] Docs/zh_CN: Update the translation of iio_configfs " Yanteng Si
2022-07-26 5:51 ` Alex Shi
2022-07-25 9:20 ` [PATCH 2/8] Docs/zh_CN: Update the translation of kasan " Yanteng Si
2022-07-27 2:15 ` Alex Shi
2022-07-28 1:17 ` YanTeng Si
2022-07-25 9:20 ` [PATCH 3/8] Docs/zh_CN: Update the translation of sparse " Yanteng Si
2022-07-27 2:16 ` Alex Shi
2022-07-25 9:23 ` [PATCH 4/8] Docs/zh_CN: Update the translation of testing-overview " Yanteng Si
2022-07-27 2:18 ` Alex Shi [this message]
2022-07-25 9:24 ` [PATCH 5/8] Docs/zh_CN: Update the translation of usage " Yanteng Si
2022-07-27 2:18 ` Alex Shi
2022-07-25 9:24 ` [PATCH 6/8] Docs/zh_CN: Update the translation of pci-iov-howto " Yanteng Si
2022-07-27 2:19 ` Alex Shi
2022-07-25 9:24 ` [PATCH 7/8] Docs/zh_CN: Update the translation of pci " Yanteng Si
2022-07-26 16:19 ` Wu XiangCheng
2022-07-27 2:20 ` Alex Shi
2022-07-25 9:24 ` [PATCH 8/8] Docs/zh_CN: Update the translation of sched-stats " Yanteng Si
2022-07-26 15:06 ` Wu XiangCheng
2022-07-27 2:20 ` Alex Shi
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=49e9c2c2-0cc0-de41-c7dc-03d866cb38ee@gmail.com \
--to=seakeel@gmail.com \
--cc=alexs@kernel.org \
--cc=bobwxc@email.cn \
--cc=chenhuacai@kernel.org \
--cc=corbet@lwn.net \
--cc=jiaxun.yang@flygoat.com \
--cc=leoyang.li@nxp.com \
--cc=linux-doc@vger.kernel.org \
--cc=siyanteng01@gmail.com \
--cc=siyanteng@loongson.cn \
--cc=src.res@email.cn \
--cc=wanjiabing@vivo.com \
--cc=yizhou.tang@shopee.com \
--cc=zhoubinbin@loongson.cn \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.