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=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_2 autolearn=no 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 008A2C43603 for ; Mon, 16 Dec 2019 18:29:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D728D218AC for ; Mon, 16 Dec 2019 18:29:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731320AbfLPS3Z (ORCPT ); Mon, 16 Dec 2019 13:29:25 -0500 Received: from mail.kernel.org ([198.145.29.99]:50256 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731298AbfLPS3Z (ORCPT ); Mon, 16 Dec 2019 13:29:25 -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 24357206EC; Mon, 16 Dec 2019 18:29:24 +0000 (UTC) Date: Mon, 16 Dec 2019 13:29:22 -0500 From: Steven Rostedt To: David Laight Cc: 'Tom Zanussi' , Sven Schnelle , "linux-trace-devel@vger.kernel.org" , LKML Subject: Re: ftrace histogram sorting broken on BE architecures Message-ID: <20191216132922.1bf6d5cd@gandalf.local.home> In-Reply-To: <548eb8ae4b8742e4bf122af98b208925@AcuMS.aculab.com> References: <20191211123316.GD12147@stackframe.org> <20191211103557.7bed6928@gandalf.local.home> <20191211110959.2baeb70f@gandalf.local.home> <1576178241.3309.2.camel@kernel.org> <4805b40c3e1547f8a26eeac6932f6499@AcuMS.aculab.com> <20191216110539.2b268d86@gandalf.local.home> <548eb8ae4b8742e4bf122af98b208925@AcuMS.aculab.com> 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-trace-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org On Mon, 16 Dec 2019 17:06:50 +0000 David Laight wrote: > > Where original_val_a could be a byte, short, int, long or long long. > > I'd sort of guessed that, but then the pointer type passed to tracing_map_cmp_##type() > will always be 'u64 *' (since the field the address is taken of must be that type). > Then the (u64 *) casts are no longer needed. > > Possibly you can just pass the u64 values to: > tracing_map_cmp_##type(type a, type b) > { > return a > b ? 1 : a < b ? -1 : 0; > } > > The high bit masking and sign extension is then implicit in the call. But these are used to pass into a compare function that takes compare functions that are something other than numbers. They can be pointers to strings. -- Steve