qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Alex Bennée" <alex.bennee@linaro.org>,
	minyihh@uci.edu, robhenry@microsoft.com, vilanova@imperial.ac.uk,
	mahmoudabdalghany@outlook.com, aaron@os.amperecomputing.com,
	cota@braap.org, stefanha@redhat.com, mohamad.gebai@gmail.com,
	kuhn.chenqun@huawei.com, matheus.ferst@eldorado.org.br
Subject: [PATCH  v1 6/7] scripts/tracetool: don't barf validating TCG types
Date: Wed,  5 May 2021 10:22:58 +0100	[thread overview]
Message-ID: <20210505092259.8202-7-alex.bennee@linaro.org> (raw)
In-Reply-To: <20210505092259.8202-1-alex.bennee@linaro.org>

TCG types will be transformed into the appropriate host types later on
in the tool. For example adding the following trace point:

  tcg goto_ptr(TCGv_ptr ptr) "", "ptr=%p"

would trigger:

  ValueError: Error at /home/alex/lsrc/qemu.git/./trace-events:149: Argument type 'TCGv_ptr' is not allowed. Only standard C types and fixed size integer types should be used. struct, union, and other complex pointer types should be declared as 'void *'

Rather than expand ALLOWED_TYPES just directly handle TCGv types in validate_type.

Fixes: 73ff061032 ("trace: only permit standard C types and fixed size integer types")
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Cc: Matheus Ferst <matheus.ferst@eldorado.org.br>
Message-Id: <20210406165307.5993-1-alex.bennee@linaro.org>

---
v2
  - do workaround directly in validate_type
---
 scripts/tracetool/__init__.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/scripts/tracetool/__init__.py b/scripts/tracetool/__init__.py
index 5bc94d95cf..ce5fd23191 100644
--- a/scripts/tracetool/__init__.py
+++ b/scripts/tracetool/__init__.py
@@ -87,10 +87,9 @@ def out(*lines, **kwargs):
     "ssize_t",
     "uintptr_t",
     "ptrdiff_t",
-    # Magic substitution is done by tracetool
-    "TCGv",
 ]
 
+
 def validate_type(name):
     bits = name.split(" ")
     for bit in bits:
@@ -99,6 +98,10 @@ def validate_type(name):
             continue
         if bit == "const":
             continue
+        # Magic substitution of TCGv types will be done later
+        # using tracetool.transform.TCG_2_HOST
+        if bit.startswith("TCGv") and bit != "TCGv_vec":
+            continue
         if bit not in ALLOWED_TYPES:
             raise ValueError("Argument type '%s' is not allowed. "
                              "Only standard C types and fixed size integer "
-- 
2.20.1



  parent reply	other threads:[~2021-05-05  9:34 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-05  9:22 [PATCH v1 0/7] plugins/next (windows, leaks, tcg tracing) Alex Bennée
2021-05-05  9:22 ` [PATCH v1 1/7] plugins: Update qemu-plugins.symbols to match qemu-plugins.h Alex Bennée
2021-05-05  9:22 ` [PATCH v1 2/7] plugins: Move all typedef and type declaration to the front of the qemu-plugin.h Alex Bennée
2021-05-05  9:22 ` [PATCH v1 3/7] plugins/hotblocks: Properly freed the hash table values Alex Bennée
2021-05-05  9:22 ` [PATCH v1 4/7] plugins/hotpages: " Alex Bennée
2021-05-05  9:22 ` [PATCH v1 5/7] docs: mark intention to deprecate TCG tracing functionality Alex Bennée
2021-05-05  9:33   ` Daniel P. Berrangé
2021-05-05 10:35     ` Alex Bennée
2021-05-05 10:41       ` Alex Bennée
2021-05-05 10:52         ` Daniel P. Berrangé
2021-05-17 10:47           ` Alex Bennée
2021-05-17 13:44             ` Stefan Hajnoczi
2021-05-05  9:22 ` Alex Bennée [this message]
2021-05-05  9:22 ` [PATCH v1 7/7] tcg: add trace events for [exit|goto]_tb and goto_ptr Alex Bennée

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=20210505092259.8202-7-alex.bennee@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=aaron@os.amperecomputing.com \
    --cc=cota@braap.org \
    --cc=kuhn.chenqun@huawei.com \
    --cc=mahmoudabdalghany@outlook.com \
    --cc=matheus.ferst@eldorado.org.br \
    --cc=minyihh@uci.edu \
    --cc=mohamad.gebai@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=robhenry@microsoft.com \
    --cc=stefanha@redhat.com \
    --cc=vilanova@imperial.ac.uk \
    /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).