Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754332AbdHYFs2 (ORCPT ); Fri, 25 Aug 2017 01:48:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57184 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754292AbdHYFs1 (ORCPT ); Fri, 25 Aug 2017 01:48:27 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 6BE2580F75 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=zsun@redhat.com From: "Ziqian SUN (Zamir)" To: rostedt@goodmis.org, linux-kernel@vger.kernel.org Cc: zsun@redhat.com, jkacur@redhat.com Subject: [PATCH] trace-cmd report: Fix hash.key in option -w Date: Fri, 25 Aug 2017 13:47:49 +0800 Message-Id: <1503640069-23069-1-git-send-email-zsun@redhat.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 25 Aug 2017 05:48:27 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1324 Lines: 41 From: "Ziqian SUN (Zamir)" 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 Signed-off-by: Ziqian SUN (Zamir) --- 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