Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp41412ybx; Mon, 4 Nov 2019 15:28:24 -0800 (PST) X-Google-Smtp-Source: APXvYqw+RI8VU1DE0ghLK91T/MGbxutizbsA/QjVzWa6SFI971jXg8xnkUf/0hmVeatElxniGanN X-Received: by 2002:a17:906:a94e:: with SMTP id hh14mr26930411ejb.164.1572910104021; Mon, 04 Nov 2019 15:28:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572910104; cv=none; d=google.com; s=arc-20160816; b=rDt9vEIn/PT1AhEypc3GhEsq44r68DN2t7lV4l6kdJk8W/n+gBePG8mGqBIjmZvZo8 xmN3wsFeXA/EFBNxK8bQmtpMvpnjlNzeyXiso4CnMsjKbRKF8V91VKNV7p2ySXYemOjx bNhvybdz0+iLuQ/UMxS3ls77GOJFeIFl4uOHJOLVHS8F9Rj7JAOoyz6UUXtqxBvIAPj7 aJMHV2A9JgWxuyqBVvIRKoEUhVNn96HAyYLv0t22AUFmu4Ad2WU+WugIr0Je9GzM2VR0 jTC1TH90Dvzn3Ni1ZF9hFprMYBlmYbk9OBk8b7/jXxzPoLhUNp1cmG1JYyqjGB9JLQcB F69w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=wMo1nYFUQpcoRTlz7VrUoX6YymoUpgpYzV2bLN85S5Y=; b=HFNnQ6qDrf62p2sIRX15Y03gAvJpz7jUGsi0p+4CuceAcEXyjUNgkKY6yIQXXqpAIj HcbSOOr9nL4s2r06GfiElDloATG8HTIKFVAt+gJ1PNm4rGgRcd2bmZ4Mgr+oQbIyq+Vt ExeLGhqfrzs+vlxIEXR8RAZeJTgcpe3SHkOnKtZlaP4JucUJGGT/9D/ovU9rCAPcZ4My /q/Avzxhf343PYjM+dk6nOMAtg29sjvT29Exolj2ULJqzaaFcAawvo1zin8jkG6x0hzL P8Vj8nNELfPMjeeYYeLQrd/zl5Z5NOBRqfOhaWeSRgvto54epBpxrBl8Bh8jEE3oVNFi cn/g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z16si8699961edd.314.2019.11.04.15.28.00; Mon, 04 Nov 2019 15:28:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729743AbfKDX1U convert rfc822-to-8bit (ORCPT + 99 others); Mon, 4 Nov 2019 18:27:20 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:27169 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728810AbfKDX1T (ORCPT ); Mon, 4 Nov 2019 18:27:19 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-337-f_r9c5y6OXCN-NgBxiEUDg-1; Mon, 04 Nov 2019 18:27:16 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7654C800C73; Mon, 4 Nov 2019 23:27:14 +0000 (UTC) Received: from krava.redhat.com (ovpn-204-100.brq.redhat.com [10.40.204.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6E4F219C58; Mon, 4 Nov 2019 23:27:12 +0000 (UTC) From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: Andi Kleen , lkml , Ingo Molnar , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Michael Petlan Subject: [PATCH] perf tools: Fix time sorting Date: Tue, 5 Nov 2019 00:27:11 +0100 Message-Id: <20191104232711.16055-1-jolsa@kernel.org> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MC-Unique: f_r9c5y6OXCN-NgBxiEUDg-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The final sort might get confused when the comparison is done over bigger numbers than int like for -s time. Check following report for longer workloads: $ perf report -s time -F time,overhead --stdio Fixing hist_entry__sort to properly return int64_t and not possible cut int. Cc: Andi Kleen Link: http://lkml.kernel.org/n/tip-uetl5z1eszpubzqykvdftaq6@git.kernel.org Signed-off-by: Jiri Olsa --- tools/perf/util/hist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index 679a1d75090c..7b6eaf5e0bda 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c @@ -1625,7 +1625,7 @@ int hists__collapse_resort(struct hists *hists, struct ui_progress *prog) return 0; } -static int hist_entry__sort(struct hist_entry *a, struct hist_entry *b) +static int64_t hist_entry__sort(struct hist_entry *a, struct hist_entry *b) { struct hists *hists = a->hists; struct perf_hpp_fmt *fmt; -- 2.21.0