Linux-Trace-Devel Archive on lore.kernel.org
 help / color / Atom feed
From: "Yordan Karadzhov (VMware)" <y.karadz@gmail.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-trace-devel@vger.kernel.org
Subject: Re: [PATCH 1/4] kernel-shark :Fix all build warnings for gcc 10.2.1
Date: Wed, 30 Sep 2020 16:55:45 +0300
Message-ID: <bd59b018-df9c-fa0d-5b6a-7de2ba4c30fc@gmail.com> (raw)
In-Reply-To: <20200929170555.3f45e952@gandalf.local.home>



On 30.09.20 г. 0:05 ч., Steven Rostedt wrote:
> 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.
> 

Yes, this is wrong. Thanks a lot Steven!
Do you prefer to re-send the entire patch-set or only this one?

thanks,
Yordan

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

  reply index

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-16  6:50 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 ` [PATCH 1/4] kernel-shark :Fix all build warnings for gcc 10.2.1 Steven Rostedt
2020-09-30 13:55   ` Yordan Karadzhov (VMware) [this message]
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=bd59b018-df9c-fa0d-5b6a-7de2ba4c30fc@gmail.com \
    --to=y.karadz@gmail.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

Linux-Trace-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-trace-devel/0 linux-trace-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-trace-devel linux-trace-devel/ https://lore.kernel.org/linux-trace-devel \
		linux-trace-devel@vger.kernel.org
	public-inbox-index linux-trace-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-trace-devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git