qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Pierrick Bouvier <pierrick.bouvier@linaro.org>
To: Richard Henderson <richard.henderson@linaro.org>, qemu-devel@nongnu.org
Cc: "Alexandre Iooss" <erdnaxe@crans.org>,
	"Mahmoud Mandour" <ma.mandourr@gmail.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Alex Bennée" <alex.bennee@linaro.org>
Subject: Re: [PATCH v2 4/5] plugins: conditional callbacks
Date: Wed, 13 Mar 2024 11:53:28 +0400	[thread overview]
Message-ID: <1fd3ffb1-be5f-447a-84ea-385697304fbc@linaro.org> (raw)
In-Reply-To: <e1618313-4698-4661-b5d5-dcb38f60ed52@linaro.org>

On 3/13/24 01:25, Richard Henderson wrote:
> On 3/11/24 21:54, Pierrick Bouvier wrote:
>> +/**
>> + * enum qemu_plugin_cond - condition to enable callback
>> + *
>> + * @QEMU_PLUGIN_COND_NEVER: false
>> + * @QEMU_PLUGIN_COND_ALWAYS: true
>> + * @QEMU_PLUGIN_COND_EQ: is equal?
>> + * @QEMU_PLUGIN_COND_NE: is not equal?
>> + * @QEMU_PLUGIN_COND_LT: is less than?
>> + * @QEMU_PLUGIN_COND_LE: is less than or equal?
>> + * @QEMU_PLUGIN_COND_GT: is greater than?
>> + * @QEMU_PLUGIN_COND_GE: is greater than or equal?
>> + */
>> +enum qemu_plugin_cond {
>> +    QEMU_PLUGIN_COND_NEVER,
>> +    QEMU_PLUGIN_COND_ALWAYS,
>> +    QEMU_PLUGIN_COND_EQ,
>> +    QEMU_PLUGIN_COND_NE,
>> +    QEMU_PLUGIN_COND_LT,
>> +    QEMU_PLUGIN_COND_LE,
>> +    QEMU_PLUGIN_COND_GT,
>> +    QEMU_PLUGIN_COND_GE,
>> +};
> 
> Do you really need to expose ALWAYS/NEVER?

Not mandatory, but offers possibility to have a condition (based on a 
plugin command line parameter for instance), without using necessarily 
conditional callbacks (if option=off,option=on or other value).

> I guess these are all unsigned?  Would it be clearer to add "U" suffixes?
> 

For now we only have conditional callbacks/inline ops with unsigned type 
(qemu_plugin_u64). Found this to be redundant, but we can always add 
this suffix if you think it's better.

> 
> r~


  reply	other threads:[~2024-03-13  7:54 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-12  7:54 [PATCH v2 0/5] TCG plugins new inline operations Pierrick Bouvier
2024-03-12  7:54 ` [PATCH v2 1/5] plugins: prepare introduction of new inline ops Pierrick Bouvier
2024-03-12 21:01   ` Richard Henderson
2024-03-12  7:54 ` [PATCH v2 2/5] plugins: add new inline op STORE_U64 Pierrick Bouvier
2024-03-12 21:15   ` Richard Henderson
2024-03-13  7:58     ` Pierrick Bouvier
2024-03-12  7:54 ` [PATCH v2 3/5] tests/plugin/inline: add test for STORE_U64 inline op Pierrick Bouvier
2024-03-12  7:54 ` [PATCH v2 4/5] plugins: conditional callbacks Pierrick Bouvier
2024-03-12 21:25   ` Richard Henderson
2024-03-13  7:53     ` Pierrick Bouvier [this message]
2024-03-12  7:54 ` [PATCH v2 5/5] tests/plugin/inline: add test for condition callback Pierrick Bouvier

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=1fd3ffb1-be5f-447a-84ea-385697304fbc@linaro.org \
    --to=pierrick.bouvier@linaro.org \
    --cc=alex.bennee@linaro.org \
    --cc=erdnaxe@crans.org \
    --cc=ma.mandourr@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.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).