From: Tom Zanussi <zanussi@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>,
Sven Schnelle <svens@stackframe.org>
Cc: linux-trace-devel@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: ftrace histogram sorting broken on BE architecures
Date: Thu, 12 Dec 2019 13:17:21 -0600 [thread overview]
Message-ID: <1576178241.3309.2.camel@kernel.org> (raw)
In-Reply-To: <20191211110959.2baeb70f@gandalf.local.home>
On Wed, 2019-12-11 at 11:09 -0500, Steven Rostedt wrote:
> On Wed, 11 Dec 2019 10:35:57 -0500
> Steven Rostedt <rostedt@goodmis.org> 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);
> \
> }
Acked-by: Tom Zanussi <zanussi@kernel.org>
next prev parent reply other threads:[~2019-12-12 19:17 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-11 12:33 ftrace histogram sorting broken on BE architecures Sven Schnelle
2019-12-11 15:35 ` Steven Rostedt
2019-12-11 16:09 ` Steven Rostedt
2019-12-11 16:37 ` Tom Zanussi
2019-12-11 17:00 ` Steven Rostedt
2019-12-11 19:26 ` Tom Zanussi
2019-12-12 18:07 ` Steven Rostedt
2019-12-12 19:15 ` Tom Zanussi
2019-12-11 18:14 ` Sven Schnelle
2019-12-12 19:17 ` Tom Zanussi [this message]
2019-12-16 15:47 ` David Laight
2019-12-16 16:05 ` Steven Rostedt
2019-12-16 17:06 ` David Laight
2019-12-16 18:29 ` Steven Rostedt
2019-12-17 10:05 ` David Laight
2019-12-18 15:33 ` Steven Rostedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1576178241.3309.2.camel@kernel.org \
--to=zanussi@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-devel@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=svens@stackframe.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).