Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp833031ybl; Wed, 11 Dec 2019 08:11:06 -0800 (PST) X-Google-Smtp-Source: APXvYqy/qweYmKyOx0DpvcYzV5xpnpKg2BFuMm9VrwR5relv9Y2Ma2LdWTsTTiTLVPFYTOgsDjv5 X-Received: by 2002:a05:6830:2116:: with SMTP id i22mr3011999otc.0.1576080666220; Wed, 11 Dec 2019 08:11:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576080666; cv=none; d=google.com; s=arc-20160816; b=sVVAa/9j4JFvXxqSz+4rN7X0R6geLZLiL9+uI5llC589lZ6Q1T41N5y+VXn6X+q1cT tVHIjR2ZO92qDb9Cd/I3DoUrw53K43tn6+AvstVgJUsuWxwqUpFPM2Qpwxl85Qr5aYdp 1WfxIgBRdZH1C5dH5ebVwv4kzcH2zKJm0oymhXy2aKh4NjPDLyNHCEv2QKsoonR7djoH dMUbSs00YFTzDj1WUNGZ/32Pp41f7o3v2Aq2ISr0g80F7qlJLUbNuIFFMhjBjFfC9TGJ QZyNfNMzvqkeayyu1nzZbxexaxy5MMcDDWELrQ/MZezhKztie1wsyrwUy0xJJJI9UiYf WJkQ== 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 :references:in-reply-to:message-id:subject:cc:to:from:date; bh=JN3gnX5vyXBlRGX2CRKsFiGzexpuzhrvmaM+KVKS09g=; b=wg2DswbOtoh6GYypLI3yxS4vvkkTqNScux0HiMuoBLv/vM8k/efc7cGlgFDoLC5et+ It5sRhYZZZGV9fiIJhi0Np5sjGBqujF0DbYT9EcRy6u0ymlna2Jr4NMPaPp11AdOf9sf VZJ24OLbWUmf3nbipoiR2HMpdf5/IY9P2OOPgq0la/AqAqy6xFgsuVLcGdj+hUopiXng Tk0P8MXRTWDFSnJrAKpMIBqDa4i8aqACkdP4tQ8BwB0EyKtgfgLea2P1FeHiN75Lr3t1 NJDCm/7G6UFQBwYgy20ZPuZi0Iop1zLuN6B+y7WCsura4qKVy5l+fB9CUOgQekLOL6Em AGpA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a201si1407561oii.34.2019.12.11.08.10.54; Wed, 11 Dec 2019 08:11:06 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733068AbfLKQKE (ORCPT + 99 others); Wed, 11 Dec 2019 11:10:04 -0500 Received: from mail.kernel.org ([198.145.29.99]:35176 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731038AbfLKQKC (ORCPT ); Wed, 11 Dec 2019 11:10:02 -0500 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (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 D6E7D20836; Wed, 11 Dec 2019 16:10:00 +0000 (UTC) Date: Wed, 11 Dec 2019 11:09:59 -0500 From: Steven Rostedt To: Sven Schnelle Cc: linux-trace-devel@vger.kernel.org, LKML , Tom Zanussi Subject: Re: ftrace histogram sorting broken on BE architecures Message-ID: <20191211110959.2baeb70f@gandalf.local.home> In-Reply-To: <20191211103557.7bed6928@gandalf.local.home> References: <20191211123316.GD12147@stackframe.org> <20191211103557.7bed6928@gandalf.local.home> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 11 Dec 2019 10:35:57 -0500 Steven Rostedt wrote: > > Any thoughts on how to fix this? I'm not sure whether i fully understand the > > ftrace maps... ;-) > > Your analysis makes sense. I'll take a deeper look at it. Sven, Does this patch fix it for you? Tom, Correct me if I'm wrong, from what I can tell, all sums and keys are u64 unless they are a string. Thus, I believe this patch should not have any issues. -- Steve diff --git a/kernel/trace/tracing_map.c b/kernel/trace/tracing_map.c index 9a1c22310323..9e31bfc818ff 100644 --- a/kernel/trace/tracing_map.c +++ b/kernel/trace/tracing_map.c @@ -148,8 +148,8 @@ static int tracing_map_cmp_atomic64(void *val_a, void *val_b) #define DEFINE_TRACING_MAP_CMP_FN(type) \ static int tracing_map_cmp_##type(void *val_a, void *val_b) \ { \ - type a = *(type *)val_a; \ - type b = *(type *)val_b; \ + type a = (type)(*(u64 *)val_a); \ + type b = (type)(*(u64 *)val_b); \ \ return (a > b) ? 1 : ((a < b) ? -1 : 0); \ }