All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Tosatti <mtosatti@redhat.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-trace-devel@vger.kernel.org
Subject: [PATCH] tracecmd: --poll option is not passed down to guest
Date: Fri, 24 Oct 2025 14:43:37 -0300	[thread overview]
Message-ID: <aPu6yVSp0BtyNXc2@tpad> (raw)


commit e7ffcbda9d62855ec30dc36ef5bebcb669321073 added the
--poll option to avoid waking up the trace buffer reader
from an isolated CPU:

    trace-cmd: Add option to poll trace buffers

    Waiting for data to be available on the trace ring-buffers may trigger
    IPIs. This might generate unacceptable trace noise when debugging low
    latency or real time systems. So introduce the poll option. When
    enabled, it forces trace-cmd to use O_NONBLOCK. The drawback to using it
    is that traces will be extracted by busy waiting, which will
    unnecessarily hog the CPUs, so only use when really needed.

    Link: https://lore.kernel.org/linux-trace-devel/20210602090803.12233-1-nsaenzju@redhat.com

    Signed-off-by: Nicolas Saenz Julienne <nsaenzju@redhat.com>
    Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>

However the --poll option is not passed down to the guest, which can cause
the wakeup (and associated latency) in the guest:

84221.535329: kvm_entry:             vcpu 1 rip 0xfff0
84221.535341: write_msr:            6e0, value 97374f0241f8
84221.535343: sched_switch:         cyclictest:6563 [4] S ==> swapper/1:0 [120]
84221.535343: ipi_send_cpu:         cpu=1 callsite=irq_work_queue+0x2f callback=rb_wake_up_waiters+0x0
84221.535344: write_msr:            83f, value f6
84221.535345: irq_work_entry:       vector=246

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>


diff --git a/tracecmd/trace-record.c b/tracecmd/trace-record.c
index 4e1157c9..ac42d428 100644
--- a/tracecmd/trace-record.c
+++ b/tracecmd/trace-record.c
@@ -6220,9 +6220,16 @@ static void add_arg(struct buffer_instance *instance,
 {
 	char *ptr, *arg;
 	int i, ret;
+	int long_opt;
+
+	long_opt = 0;
+	for (i = 0; long_options[i].name; i++) {
+		if (long_options[i].val == c)
+			long_opt = 1;
+	}
 
 	/* Short or long arg */
-	if (!(c & 0x80)) {
+	if (long_opt == 0) {
 		ptr = strchr(opts, c);
 		if (!ptr)
 			return; /* Not found? */


             reply	other threads:[~2025-10-24 17:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-24 17:43 Marcelo Tosatti [this message]
2025-12-04 21:23 ` [PATCH] tracecmd: --poll option is not passed down to guest Steven Rostedt

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=aPu6yVSp0BtyNXc2@tpad \
    --to=mtosatti@redhat.com \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=rostedt@goodmis.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.