From: Stefan Hajnoczi <stefanha@gmail.com>
To: Tanish Desai <tanishdesai37@gmail.com>
Cc: qemu-devel@nongnu.org, pbonzini@redhat.com, Mads Ynddal <mads@ynddal.dk>
Subject: Re: [PATCH] trace/simple: seperate hot paths of tracing fucntions
Date: Tue, 20 May 2025 15:01:34 -0400 [thread overview]
Message-ID: <CAJSP0QVOSGKnt8YCay5r+HR2O6xCz9Nb5Hp4TOzsSHE9fpYgHw@mail.gmail.com> (raw)
In-Reply-To: <20250519185108.14412-1-tanishdesai37@gmail.com>
On Mon, May 19, 2025 at 2:52 PM Tanish Desai <tanishdesai37@gmail.com> wrote:
>
> Remove hot paths from .c file and added it in .h file to keep it inline.
Please include performance results in the commit description so it's
clear what impact this change has.
>
> Signed-off-by: Tanish Desai <tanishdesai37@gmail.com>
> ---
> scripts/tracetool/backend/simple.py | 23 ++++++++++-------------
Please use scripts/get_maintainer.pl to find the emails to CC:
$ scripts/get_maintainer.pl -f scripts/tracetool/backend/simple.py
Stefan Hajnoczi <stefanha@redhat.com> (maintainer:Tracing)
Mads Ynddal <mads@ynddal.dk> (reviewer:Tracing)
qemu-devel@nongnu.org (open list:All patches CC here)
qemu-devel is a high-traffic list and maintainers may not see your
patches unless you CC them.
> 1 file changed, 10 insertions(+), 13 deletions(-)
>
> diff --git a/scripts/tracetool/backend/simple.py b/scripts/tracetool/backend/simple.py
> index a74d61fcd6..2688d4b64b 100644
> --- a/scripts/tracetool/backend/simple.py
> +++ b/scripts/tracetool/backend/simple.py
> @@ -36,8 +36,17 @@ def generate_h_begin(events, group):
>
>
> def generate_h(event, group):
> - out(' _simple_%(api)s(%(args)s);',
> + event_id = 'TRACE_' + event.name.upper()
> + if "vcpu" in event.properties:
> + # already checked on the generic format code
> + cond = "true"
> + else:
> + cond = "trace_event_get_state(%s)" % event_id
> + out(' if (%(cond)s) {',
> + ' _simple_%(api)s(%(args)s);',
> + ' }',
> api=event.api(),
> + cond=cond,
> args=", ".join(event.args.names()))
>
>
> @@ -72,22 +81,10 @@ def generate_c(event, group):
> if len(event.args) == 0:
> sizestr = '0'
>
> - event_id = 'TRACE_' + event.name.upper()
> - if "vcpu" in event.properties:
> - # already checked on the generic format code
> - cond = "true"
> - else:
> - cond = "trace_event_get_state(%s)" % event_id
> -
> out('',
> - ' if (!%(cond)s) {',
> - ' return;',
> - ' }',
> - '',
> ' if (trace_record_start(&rec, %(event_obj)s.id, %(size_str)s)) {',
> ' return; /* Trace Buffer Full, Event Dropped ! */',
> ' }',
> - cond=cond,
> event_obj=event.api(event.QEMU_EVENT),
> size_str=sizestr)
>
> --
> 2.34.1
>
>
next prev parent reply other threads:[~2025-05-20 19:02 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-19 18:51 [PATCH] trace/simple: seperate hot paths of tracing fucntions Tanish Desai
2025-05-20 19:01 ` Stefan Hajnoczi [this message]
2025-05-20 20:51 ` Paolo Bonzini
2025-05-21 18:16 ` Stefan Hajnoczi
2025-05-27 2:51 ` Tanish Desai
2025-05-28 18:06 ` Stefan Hajnoczi
2025-05-28 19:30 ` Tanish Desai
-- strict thread matches above, loose matches on Subject: below --
2025-05-28 19:25 Tanish Desai
2025-06-02 22:25 ` Stefan Hajnoczi
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=CAJSP0QVOSGKnt8YCay5r+HR2O6xCz9Nb5Hp4TOzsSHE9fpYgHw@mail.gmail.com \
--to=stefanha@gmail.com \
--cc=mads@ynddal.dk \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=tanishdesai37@gmail.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).