All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: "Yordan Karadzhov (VMware)" <y.karadz@gmail.com>
Cc: linux-trace-devel@vger.kernel.org
Subject: Re: [PATCH 1/4] kernel-shark :Fix all build warnings for gcc 10.2.1
Date: Tue, 29 Sep 2020 17:05:55 -0400	[thread overview]
Message-ID: <20200929170555.3f45e952@gandalf.local.home> (raw)
In-Reply-To: <20200916065007.9755-1-y.karadz@gmail.com>

On Wed, 16 Sep 2020 09:50:04 +0300
"Yordan Karadzhov (VMware)" <y.karadz@gmail.com> wrote:

> @@ -606,21 +603,17 @@ void KsTraceGraph::_updateGraphLegends()
>  void KsTraceGraph::_updateTimeLegends()
>  {
>  	uint64_t sec, usec, tsMid;
> -	QString tMin, tMid, tMax;
>  
>  	kshark_convert_nano(_glWindow.model()->histo()->min, &sec, &usec);
> -	tMin.sprintf("%" PRIu64 ".%06" PRIu64 "", sec, usec);
> -	_labelXMin.setText(tMin);
> +	_labelXMin.setText(_t2str(sec, usec));
>  
>  	tsMid = (_glWindow.model()->histo()->min +
>  		 _glWindow.model()->histo()->max) / 2;
>  	kshark_convert_nano(tsMid, &sec, &usec);
> -	tMid.sprintf("%" PRIu64 ".%06" PRIu64 "", sec, usec);
> -	_labelXMid.setText(tMid);
> +	_labelXMid.setText(_t2str(sec, usec));
>  
>  	kshark_convert_nano(_glWindow.model()->histo()->max, &sec, &usec);
> -	tMax.sprintf("%" PRIu64 ".%06" PRIu64 "", sec, usec);
> -	_labelXMax.setText(tMax);
> +	_labelXMax.setText(_t2str(sec, usec));
>  }
>  
>  /**
> diff --git a/kernel-shark/src/KsTraceGraph.hpp b/kernel-shark/src/KsTraceGraph.hpp
> index c53258c..8abc06b 100644
> --- a/kernel-shark/src/KsTraceGraph.hpp
> +++ b/kernel-shark/src/KsTraceGraph.hpp
> @@ -108,6 +108,10 @@ private:
>  
>  	void _markerReDraw();
>  
> +	QString _t2str(uint64_t sec, uint64_t usec) {
> +		return QString::number(sec) + "." + QString::number(usec);

Hmm, if sec is 5 and usec is 1, would the above work? That is, would it
give:

	"5.000001"

Or would it give:

	"5.1"

which would be wrong.

-- Steve

> +	};
> +
>  	enum class GraphActions {
>  		ZoomIn,
>  		ZoomOut,

  parent reply	other threads:[~2020-09-29 21:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-16  6:50 [PATCH 1/4] kernel-shark :Fix all build warnings for gcc 10.2.1 Yordan Karadzhov (VMware)
2020-09-16  6:50 ` [PATCH 2/4] kernel-shark: Have correct screen geometry on high-resolution screens Yordan Karadzhov (VMware)
2020-09-16  6:50 ` [PATCH 3/4] kernel-shark: Check if Qt has been found when building the examples Yordan Karadzhov (VMware)
2020-09-16  6:50 ` [PATCH 4/4] kernel-shark: Fix dependency (symbol resolving) issue Yordan Karadzhov (VMware)
2020-09-29 21:05 ` Steven Rostedt [this message]
2020-09-30 13:55   ` [PATCH 1/4] kernel-shark :Fix all build warnings for gcc 10.2.1 Yordan Karadzhov (VMware)
2020-09-30 14:03     ` 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=20200929170555.3f45e952@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=y.karadz@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 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.