linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] trace-cmd report: Fix hash.key in option -w
@ 2017-08-25  5:47 Ziqian SUN (Zamir)
  2017-08-25 14:22 ` Steven Rostedt
  0 siblings, 1 reply; 2+ messages in thread
From: Ziqian SUN (Zamir) @ 2017-08-25  5:47 UTC (permalink / raw)
  To: rostedt, linux-kernel; +Cc: zsun, jkacur

From: "Ziqian SUN (Zamir)" <zsun@redhat.com>

In add_wakeup function the hash list is created with hash.key = value.
This makes add_sched function will never find a match with the key which
results in trace-cmd report will never show the average latency with the
following command:
trace-cmd report -w -F 'sched_switch,sched_wakeup'
With this patch, the command will show average latency as it used to be
in v2.4.2 like

Average wakeup latency: 28.460 usecs
Maximum Latency: 669.268 usecs at timestamp: 16337.629767
Minimum Latency: 2.153 usecs at timestamp: 16337.533735

RT task timings:

Average wakeup latency: 23.106 usecs
Maximum Latency: 57.482 usecs at timestamp: 16337.187531
Minimum Latency: 4.127 usecs at timestamp: 16336.945209

Reported-by: Joe Mario <jmario@redhat.com>
Signed-off-by: Ziqian SUN (Zamir) <zsun@redhat.com>
---
 trace-read.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/trace-read.c b/trace-read.c
index ebb2368..350a843 100644
--- a/trace-read.c
+++ b/trace-read.c
@@ -610,7 +610,7 @@ static void add_wakeup(unsigned int val, unsigned long long start)
 	info = malloc(sizeof(*info));
 	if (!info)
 		die("Failed to allocate wakeup info");
-	info->hash.key = val;
+	info->hash.key = key;
 	info->start = start;
 	trace_hash_add(&wakeup_hash, &info->hash);
 }
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] trace-cmd report: Fix hash.key in option -w
  2017-08-25  5:47 [PATCH] trace-cmd report: Fix hash.key in option -w Ziqian SUN (Zamir)
@ 2017-08-25 14:22 ` Steven Rostedt
  0 siblings, 0 replies; 2+ messages in thread
From: Steven Rostedt @ 2017-08-25 14:22 UTC (permalink / raw)
  To: Ziqian SUN (Zamir); +Cc: linux-kernel, jkacur

On Fri, 25 Aug 2017 13:47:49 +0800
"Ziqian SUN (Zamir)" <zsun@redhat.com> wrote:

> From: "Ziqian SUN (Zamir)" <zsun@redhat.com>
> 
> In add_wakeup function the hash list is created with hash.key = value.
> This makes add_sched function will never find a match with the key which
> results in trace-cmd report will never show the average latency with the
> following command:
> trace-cmd report -w -F 'sched_switch,sched_wakeup'
> With this patch, the command will show average latency as it used to be
> in v2.4.2 like
> 
> Average wakeup latency: 28.460 usecs
> Maximum Latency: 669.268 usecs at timestamp: 16337.629767
> Minimum Latency: 2.153 usecs at timestamp: 16337.533735
> 
> RT task timings:
> 
> Average wakeup latency: 23.106 usecs
> Maximum Latency: 57.482 usecs at timestamp: 16337.187531
> Minimum Latency: 4.127 usecs at timestamp: 16336.945209
> 
> Reported-by: Joe Mario <jmario@redhat.com>
> Signed-off-by: Ziqian SUN (Zamir) <zsun@redhat.com>

Thanks a lot Ziqian! Added. Will push out soon.

I need to update the stables too.

-- Steve

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-08-25 14:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-25  5:47 [PATCH] trace-cmd report: Fix hash.key in option -w Ziqian SUN (Zamir)
2017-08-25 14:22 ` Steven Rostedt

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).