From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CF6A6C43331 for ; Mon, 11 Nov 2019 19:02:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A7EC7222CD for ; Mon, 11 Nov 2019 19:02:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573498940; bh=m2SnlxfeqDDA/C/rowAZC/hT+5u1gHbiPnQRT5redXA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=V+PGhlfLYwXgHqU36gi6h2oEVHdMrWgnJz6bE2PEhB/G9vAkphgSYlinLVUxZjkYu OBNzM/7i83vdWldGlsw9I52AtOXCKzpyzq64B8GPQbP0jyewIkmK4H+zooKLkVV7/R jbFIIe1OzvNHSiQb75TE+fYcpj1P+KPu6FblnUWA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729007AbfKKStU (ORCPT ); Mon, 11 Nov 2019 13:49:20 -0500 Received: from mail.kernel.org ([198.145.29.99]:42606 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730283AbfKKStS (ORCPT ); Mon, 11 Nov 2019 13:49:18 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B1EFC214E0; Mon, 11 Nov 2019 18:49:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573498158; bh=m2SnlxfeqDDA/C/rowAZC/hT+5u1gHbiPnQRT5redXA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=e4spZwTDwAxMX+uMomNMxY70efy09gduDMlJ92Cqmjvj8xLzBvK3fnK0R8y3AkK5B 50jUwfGBqxnniTgmUiaYINvN4eX8qai0weo7yjwVa1aeNFDv+gTLndQYVWKOp1dlJ0 adVKryGMXbTd/ZjsMYdr8PjzLYXYJ3oWLvPl6nRI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jiri Olsa , Andi Kleen , Alexander Shishkin , Michael Petlan , Namhyung Kim , Peter Zijlstra , Arnaldo Carvalho de Melo Subject: [PATCH 5.3 040/193] perf tools: Fix time sorting Date: Mon, 11 Nov 2019 19:27:02 +0100 Message-Id: <20191111181503.922866109@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191111181459.850623879@linuxfoundation.org> References: <20191111181459.850623879@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Jiri Olsa commit 722ddfde366fd46205456a9c5ff9b3359dc9a75e upstream. The final sort might get confused when the comparison is done over bigger numbers than int like for -s time. Check the following report for longer workloads: $ perf report -s time -F time,overhead --stdio Fix hist_entry__sort() to properly return int64_t and not possible cut int. Fixes: 043ca389a318 ("perf tools: Use hpp formats to sort final output") Signed-off-by: Jiri Olsa Reviewed-by: Andi Kleen Cc: Alexander Shishkin Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Cc: stable@vger.kernel.org # v3.16+ Link: http://lore.kernel.org/lkml/20191104232711.16055-1-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Greg Kroah-Hartman --- tools/perf/util/hist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c @@ -1618,7 +1618,7 @@ int hists__collapse_resort(struct hists 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;