From: "Maciej Wieczór-Retman" <maciej.wieczor-retman@intel.com>
To: Shuah Khan <skhan@linuxfoundation.org>
Cc: <akpm@linux-foundation.org>, <christian@kellner.me>,
<fenghua.yu@intel.com>, <keescook@chromium.org>,
<ndesaulniers@google.com>, <coltonlewis@google.com>,
<dmatlack@google.com>, <vipinsh@google.com>, <seanjc@google.com>,
<brauner@kernel.org>, <pbonzini@redhat.com>, <shuah@kernel.org>,
<hannes@cmpxchg.org>, <nphamcs@gmail.com>,
<reinette.chatre@intel.com>, <ilpo.jarvinen@linux.intel.com>,
<linux-kselftest@vger.kernel.org>, <kvm@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <linux-mm@kvack.org>
Subject: Re: [PATCH v4 0/8] Add printf attribute to kselftest functions
Date: Tue, 10 Oct 2023 07:53:18 +0200 [thread overview]
Message-ID: <fqfwpd5u3yjnnbojzwonvnesltves7pm6jx2cov5vaqyqsrael@m6bxnoskb6la> (raw)
In-Reply-To: <cb1dfcc1-e03e-4517-8f77-d08f10aa507c@linuxfoundation.org>
On 2023-10-09 at 11:28:30 -0600, Shuah Khan wrote:
>On 10/9/23 04:28, Maciej Wieczor-Retman wrote:
>> Kselftest.h declares many variadic functions that can print some
>> formatted message while also executing selftest logic. These
>> declarations don't have any compiler mechanism to verify if passed
>> arguments are valid in comparison with format specifiers used in
>> printf() calls.
>>
>> Attribute addition can make debugging easier, the code more consistent
>> and prevent mismatched or missing variables.
>>
>> Add a __printf() macro that validates types of variables passed to the
>> format string. The macro is similarly used in other tools in the kernel.
>>
>> Add __printf() attributes to function definitions inside kselftest.h that
>> use printing.
>>
>> Adding the __printf() macro exposes some mismatches in format strings
>> across different selftests.
>>
>> Fix the mismatched format specifiers in multiple tests.
>>
>> Series is based on kselftests next branch.
>
>How did you find these problems? I don't see any information
>how these problems are found in the commit logs.
>
>thanks,
>-- Shuah
I wrote the first patch that adds the check to functions with format
specifiers and I compiled all selftests. Then I just corrected any
warnings that were found by the __printf attribute.
Should I mention the methodology in the cover letter?
--
Kind regards
Maciej Wieczór-Retman
prev parent reply other threads:[~2023-10-10 5:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-09 10:28 Maciej Wieczor-Retman
2023-10-09 10:30 ` [PATCH v4 2/8] selftests/cachestat: Fix print_cachestat format Maciej Wieczor-Retman
2023-10-09 10:30 ` [PATCH v4 7/8] selftests/mm: Substitute attribute with a macro Maciej Wieczor-Retman
2023-10-09 17:28 ` [PATCH v4 0/8] Add printf attribute to kselftest functions Shuah Khan
2023-10-10 5:53 ` Maciej Wieczór-Retman [this message]
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=fqfwpd5u3yjnnbojzwonvnesltves7pm6jx2cov5vaqyqsrael@m6bxnoskb6la \
--to=maciej.wieczor-retman@intel.com \
--cc=akpm@linux-foundation.org \
--cc=brauner@kernel.org \
--cc=christian@kellner.me \
--cc=coltonlewis@google.com \
--cc=dmatlack@google.com \
--cc=fenghua.yu@intel.com \
--cc=hannes@cmpxchg.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=keescook@chromium.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ndesaulniers@google.com \
--cc=nphamcs@gmail.com \
--cc=pbonzini@redhat.com \
--cc=reinette.chatre@intel.com \
--cc=seanjc@google.com \
--cc=shuah@kernel.org \
--cc=skhan@linuxfoundation.org \
--cc=vipinsh@google.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