linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Linux Trace Devel <linux-trace-devel@vger.kernel.org>
Subject: [PATCH] trace-cmd: Only support tsc2nsec if multiplier or shift is non-zero
Date: Wed, 31 Mar 2021 13:24:23 -0400	[thread overview]
Message-ID: <20210331132423.485ab869@gandalf.local.home> (raw)

From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>

perf on KVM guests does not support the multiplier or shift even though the
page has those fields. Instead, they are set to zeros. Only consider the
tsc2nsec supported if one of those is non-zero.

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---

This applies on top of:

   https://patchwork.kernel.org/project/linux-trace-devel/list/?series=457305

 tracecmd/trace-record.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tracecmd/trace-record.c b/tracecmd/trace-record.c
index bebecdbd..f642a5e3 100644
--- a/tracecmd/trace-record.c
+++ b/tracecmd/trace-record.c
@@ -5808,7 +5808,8 @@ static int get_tsc_nsec(int *shift, int *mult)
 	if (i < cpus)
 		return -1;
 
-	supported = 1;
+	if (cpu_shift || cpu_mult)
+		supported = 1;
 out:
 	if (supported < 0)
 		return -1;
-- 
2.29.2


                 reply	other threads:[~2021-03-31 17:25 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20210331132423.485ab869@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=linux-trace-devel@vger.kernel.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).