lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220802105646.50819088@gandalf.local.home>
Date:   Tue, 2 Aug 2022 10:56:46 -0400
From:   Steven Rostedt <rostedt@...dmis.org>
To:     kernel test robot <lkp@...el.com>
Cc:     "Masami Hiramatsu (Google)" <mhiramat@...nel.org>,
        llvm@...ts.linux.dev, kbuild-all@...ts.01.org,
        Tom Zanussi <zanussi@...nel.org>,
        Ingo Molnar <mingo@...hat.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] tracing: Add .percent suffix option to histogram
 values

On Tue, 2 Aug 2022 14:49:36 +0800
kernel test robot <lkp@...el.com> wrote:

> All errors (new ones prefixed by >>):
> 
> >> ld.lld: error: undefined symbol: __udivdi3  

This is due to this:

> @@ -5190,18 +5202,34 @@ static void hist_trigger_print_key(struct seq_file *m,
>  	seq_puts(m, "}");
>  }
>  
> +/* Get the 100 times of the percentage of @val in @total */
> +static inline unsigned int __get_percentage(u64 val, u64 total)
> +{
> +	if (val < (U64_MAX / 10000))
> +		return (unsigned int)(val * 10000 / total);
> +	else
> +		return val / (total / 10000);
> +}
> +

You can't use '/' on u64 values. You have to use div64*(). Otherwise 32 bit
architectures may use floating point operations or glibc helpers.

See the other divisions in trace_events_hist.c that do so too.

-- Steve


>    >>> referenced by trace_events_hist.c:5211 (kernel/trace/trace_events_hist.c:5211)
>    >>>               trace/trace_events_hist.o:(hist_show) in archive kernel/built-in.a
>    >>> referenced by trace_events_hist.c:0 (kernel/trace/trace_events_hist.c:0)
>    >>>               trace/trace_events_hist.o:(hist_show) in archive kernel/built-in.a
>    >>> referenced by trace_events_hist.c:5211 (kernel/trace/trace_events_hist.c:5211)
>    >>>               trace/trace_events_hist.o:(hist_show) in archive kernel/built-in.a
>    >>> referenced 1 more times  

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ