From: Sven Schnelle <svens@stackframe.org>
To: "Alex Bennée" <alex.bennee@linaro.org>
Cc: Alexandre Iooss <erdnaxe@crans.org>,
Mahmoud Mandour <ma.mandourr@gmail.com>,
Pierrick Bouvier <pierrick.bouvier@linaro.org>,
qemu-devel@nongnu.org, deller@gmx.de
Subject: Re: [PATCH 3/3] plugins/execlog: add address range matching
Date: Thu, 29 Feb 2024 19:04:08 +0100 [thread overview]
Message-ID: <87il27xi3r.fsf@t14.stackframe.org> (raw)
In-Reply-To: <874jdr6vp5.fsf@draig.linaro.org> ("Alex Bennée"'s message of "Thu, 29 Feb 2024 17:12:38 +0000")
Hi Alex,
Alex Bennée <alex.bennee@linaro.org> writes:
> Sven Schnelle <svens@stackframe.org> writes:
>> +static void parse_vaddr_match(GArray **matches, char *token)
>> {
>> - uint64_t v = g_ascii_strtoull(match, NULL, 16);
>> + uint64_t low, high;
>> + gchar *endp;
>>
>> - if (!matches) {
>> - *matches = g_array_new(false, true, sizeof(uint64_t));
>> + low = g_ascii_strtoull(token, &endp, 16);
>> + if (endp == token) {
>> + fprintf(stderr, "Invalid address(range) specified: %s\n", token);
>> + return;
>> + }
>> +
>> + if (*endp != '-') {
>> + high = low;
>> + } else {
>> + high = g_ascii_strtoull(endp + 1, &endp, 16);
>> + if (endp == token) {
>> + fprintf(stderr, "Invalid address(range) specified: %s\n", token);
>> + return;
>> + }
>> + }
>> +
>> + if (!*matches) {
>> + *matches = g_array_new(false, true, sizeof(struct address_match));
>> }
>> - g_array_append_val(*matches, v);
>> + struct address_match *match = g_new(struct address_match, 1);
>> + match->low = low;
>> + match->high = high;
>> + g_array_append_val(*matches, match);
>
> This is almost but not quite qemu_set_dfilter_ranges(). I wonder if it
> would be worth a light re-factoring and then exposing the parser as a
> helper function?
Thanks, I'll take a look. I wasn't aware of qemu_set_dfilter_ranges().
next prev parent reply other threads:[~2024-02-29 18:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-29 15:07 [PATCH 0/3] plugins/execlog: add data address match and address range support Sven Schnelle
2024-02-29 15:07 ` [PATCH 2/3] plugins/execlog: add data address match Sven Schnelle
2024-02-29 15:07 ` [PATCH 3/3] plugins/execlog: add address range matching Sven Schnelle
2024-02-29 17:12 ` Alex Bennée
2024-02-29 18:04 ` Sven Schnelle [this message]
2024-02-29 17:08 ` [PATCH 0/3] plugins/execlog: add data address match and address range support Alex Bennée
2024-02-29 19:40 ` Sven Schnelle
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=87il27xi3r.fsf@t14.stackframe.org \
--to=svens@stackframe.org \
--cc=alex.bennee@linaro.org \
--cc=deller@gmx.de \
--cc=erdnaxe@crans.org \
--cc=ma.mandourr@gmail.com \
--cc=pierrick.bouvier@linaro.org \
--cc=qemu-devel@nongnu.org \
/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).