From: William Breathitt Gray <william.gray@linaro.org>
To: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
Cc: lee@kernel.org, alexandre.torgue@foss.st.com,
linux-iio@vger.kernel.org,
linux-stm32@st-md-mailman.stormreply.com,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/6] tools/counter: add a flexible watch events tool
Date: Tue, 3 Oct 2023 21:37:53 -0400 [thread overview]
Message-ID: <ZRzB8f/SF4LSLS3c@fedora> (raw)
In-Reply-To: <20230922143920.3144249-2-fabrice.gasnier@foss.st.com>
[-- Attachment #1.1: Type: text/plain, Size: 3387 bytes --]
On Fri, Sep 22, 2023 at 04:39:15PM +0200, Fabrice Gasnier wrote:
> This adds a new counter tool to be able to test various watch events.
> A flexible watch array can be populated from command line, each field
> may be tuned with a dedicated command line sub-option in "--watch" string.
> Several watch events can be defined, each can have specific watch options,
> by using "--watch <watch 1 options> --watch <watch 2 options>".
> Watch options is a comma separated list.
>
> It also comes with a simple default watch (to monitor overflow/underflow
> events), used when no watch parameters are provided. It's equivalent to:
> counter_watch_events -w comp_count,scope_count,evt_ovf_udf
>
> The print_usage() routine proposes another example, from the command line,
> which generates a 2 elements watch array, to monitor:
> - overflow underflow events
> - capture events, on channel 3, that reads read captured data by
> specifying the component id (capture3_component_id being 7 here).
>
> Signed-off-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
Hi Fabrice,
This tool is independent from the rest of the patches in this patchset,
so I suggest separating and submitting the next revision of this patch
independently.
> ---
> Changes in v2:
> Review comments from William:
> - revisit watch options to be less error prone: add --watch with
> sub-options to properly define each watch one by one, as a comma
> separated list
> - by the way, drop string/array parsing routines, replaced by getsubopt()
> - Improve command-line interface descriptions, e.g. like "-h, --help"
> - Makefile: adopt ARRAY_SIZE from tools/include/linux.kernel.h (via CFLAG)
> - remove reference to counter_example
> - clarify commit message, code comment: Index/overflow/underflow event
> - check calloc return value
> - Makefile: sort count_watch_events in alphabetic order
> - Makefile: add a clean rule to delete .*.o.cmd files
It looks like you implemented all the changes I requested in the first
review so I don't have much to comment inline for this revision.
It looks like the memory allocated (via calloc()) for the watches array
is never freed, so fix that in the next revision.
Also, add a MAINTAINERS entry with at least you as the point of contact
or someone else (an ST engineer?) who is willing to respond to any
bug reports the mailing list could get for this utility.
Regarding watch options, I looked up how a few other utilities handle
similar situations. Some utilities like the nftables nft command line
utility takes in a configuration file where you can specify the verbose
rule-sets, while others such as bfptrace allows entire programs to be
specified via one-liner constructs passed in a single option ("-e").
Although powerful, I found those approaches to be far too complex for
our simple test utility here. Instead, uilities with a simpler interface
take an approach similar to yours by providing several well-defined
sub-options; for example, to filter tcpdump packets users can provide
the particular sub-options they desire ("-i eth0 port 22").
The watch option solution here with sub-options is simple and clear, so
for now let's go with it as you have it. If the need arises in the
future for a more complex option interface, we'll tackle it as it comes.
Thanks,
William Breathitt Gray
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-10-04 1:38 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-22 14:39 [PATCH v2 0/6] counter: fix, improvements and stm32 timer events support Fabrice Gasnier
2023-09-22 14:39 ` [PATCH v2 1/6] tools/counter: add a flexible watch events tool Fabrice Gasnier
2023-10-04 1:37 ` William Breathitt Gray [this message]
2023-09-22 14:39 ` [PATCH v2 2/6] counter: stm32-timer-cnt: rename quadrature signal Fabrice Gasnier
2023-09-22 14:39 ` [PATCH v2 3/6] counter: stm32-timer-cnt: rename counter Fabrice Gasnier
2023-09-22 14:39 ` [PATCH v2 4/6] counter: stm32-timer-cnt: introduce clock signal Fabrice Gasnier
2023-10-13 21:22 ` William Breathitt Gray
2023-09-22 14:39 ` [PATCH v2 5/6] counter: stm32-timer-cnt: populate capture channels and check encoder Fabrice Gasnier
2023-10-13 22:48 ` William Breathitt Gray
2023-12-15 17:13 ` Fabrice Gasnier
2023-12-18 17:58 ` William Breathitt Gray
2023-09-22 14:39 ` [PATCH v2 6/6] counter: stm32-timer-cnt: add support for events Fabrice Gasnier
2023-10-13 23:03 ` William Breathitt Gray
2023-10-13 22:57 ` [PATCH v2 0/6] counter: fix, improvements and stm32 timer events support William Breathitt Gray
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=ZRzB8f/SF4LSLS3c@fedora \
--to=william.gray@linaro.org \
--cc=alexandre.torgue@foss.st.com \
--cc=fabrice.gasnier@foss.st.com \
--cc=lee@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.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;
as well as URLs for NNTP newsgroup(s).