From: Nathan Chancellor <nathan@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>,
Yinan Liu <yinan@linux.alibaba.com>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
kernel test robot <lkp@intel.com>,
kernel test robot <oliver.sang@intel.com>,
llvm@lists.linux.dev
Subject: Re: [for-next][PATCH 10/31] scripts: ftrace - move the sort-processing in ftrace_init
Date: Sat, 15 Jan 2022 13:36:04 -0700 [thread overview]
Message-ID: <YeMwNEfNaGErFthk@archlinux-ax161> (raw)
In-Reply-To: <20220111173115.079437896@goodmis.org>
Hi Steven and Yinan,
On Tue, Jan 11, 2022 at 12:30:41PM -0500, Steven Rostedt wrote:
> From: Yinan Liu <yinan@linux.alibaba.com>
>
> When the kernel starts, the initialization of ftrace takes
> up a portion of the time (approximately 6~8ms) to sort mcount
> addresses. We can save this time by moving mcount-sorting to
> compile time.
>
> Link: https://lkml.kernel.org/r/20211212113358.34208-2-yinan@linux.alibaba.com
>
> Signed-off-by: Yinan Liu <yinan@linux.alibaba.com>
> Reported-by: kernel test robot <lkp@intel.com>
> Reported-by: kernel test robot <oliver.sang@intel.com>
> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
This change as commit 72b3942a173c ("scripts: ftrace - move the
sort-processing in ftrace_init") in -next causes a bunch of warnings at
the beginning of the build when using clang as the host compiler:
$ make -skj"$(nproc)" LLVM=1 distclean allmodconfig init/main.o
In file included from scripts/sorttable.c:195:
scripts/sorttable.h:380:6: warning: variable 'mcount_sort_thread' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
if (!mstruct.init_data_sec || !_start_mcount_loc || !_stop_mcount_loc) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
scripts/sorttable.h:479:6: note: uninitialized use occurs here
if (mcount_sort_thread) {
^~~~~~~~~~~~~~~~~~
scripts/sorttable.h:380:2: note: remove the 'if' if its condition is always false
if (!mstruct.init_data_sec || !_start_mcount_loc || !_stop_mcount_loc) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
scripts/sorttable.h:380:6: warning: variable 'mcount_sort_thread' is used uninitialized whenever '||' condition is true [-Wsometimes-uninitialized]
if (!mstruct.init_data_sec || !_start_mcount_loc || !_stop_mcount_loc) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
scripts/sorttable.h:479:6: note: uninitialized use occurs here
if (mcount_sort_thread) {
^~~~~~~~~~~~~~~~~~
scripts/sorttable.h:380:6: note: remove the '||' if its condition is always false
if (!mstruct.init_data_sec || !_start_mcount_loc || !_stop_mcount_loc) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
scripts/sorttable.h:380:6: warning: variable 'mcount_sort_thread' is used uninitialized whenever '||' condition is true [-Wsometimes-uninitialized]
if (!mstruct.init_data_sec || !_start_mcount_loc || !_stop_mcount_loc) {
^~~~~~~~~~~~~~~~~~~~~~
scripts/sorttable.h:479:6: note: uninitialized use occurs here
if (mcount_sort_thread) {
^~~~~~~~~~~~~~~~~~
scripts/sorttable.h:380:6: note: remove the '||' if its condition is always false
if (!mstruct.init_data_sec || !_start_mcount_loc || !_stop_mcount_loc) {
^~~~~~~~~~~~~~~~~~~~~~~~~
scripts/sorttable.h:288:30: note: initialize the variable 'mcount_sort_thread' to silence this warning
pthread_t mcount_sort_thread;
^
= 0
In file included from scripts/sorttable.c:197:
scripts/sorttable.h:380:6: warning: variable 'mcount_sort_thread' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
if (!mstruct.init_data_sec || !_start_mcount_loc || !_stop_mcount_loc) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
scripts/sorttable.h:479:6: note: uninitialized use occurs here
if (mcount_sort_thread) {
^~~~~~~~~~~~~~~~~~
scripts/sorttable.h:380:2: note: remove the 'if' if its condition is always false
if (!mstruct.init_data_sec || !_start_mcount_loc || !_stop_mcount_loc) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
scripts/sorttable.h:380:6: warning: variable 'mcount_sort_thread' is used uninitialized whenever '||' condition is true [-Wsometimes-uninitialized]
if (!mstruct.init_data_sec || !_start_mcount_loc || !_stop_mcount_loc) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
scripts/sorttable.h:479:6: note: uninitialized use occurs here
if (mcount_sort_thread) {
^~~~~~~~~~~~~~~~~~
scripts/sorttable.h:380:6: note: remove the '||' if its condition is always false
if (!mstruct.init_data_sec || !_start_mcount_loc || !_stop_mcount_loc) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
scripts/sorttable.h:380:6: warning: variable 'mcount_sort_thread' is used uninitialized whenever '||' condition is true [-Wsometimes-uninitialized]
if (!mstruct.init_data_sec || !_start_mcount_loc || !_stop_mcount_loc) {
^~~~~~~~~~~~~~~~~~~~~~
scripts/sorttable.h:479:6: note: uninitialized use occurs here
if (mcount_sort_thread) {
^~~~~~~~~~~~~~~~~~
scripts/sorttable.h:380:6: note: remove the '||' if its condition is always false
if (!mstruct.init_data_sec || !_start_mcount_loc || !_stop_mcount_loc) {
^~~~~~~~~~~~~~~~~~~~~~~~~
scripts/sorttable.h:370:6: warning: variable 'mcount_sort_thread' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
if (pthread_create(&orc_sort_thread, NULL,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
scripts/sorttable.h:479:6: note: uninitialized use occurs here
if (mcount_sort_thread) {
^~~~~~~~~~~~~~~~~~
scripts/sorttable.h:370:2: note: remove the 'if' if its condition is always false
if (pthread_create(&orc_sort_thread, NULL,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
scripts/sorttable.h:360:6: warning: variable 'mcount_sort_thread' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
if (orc_ip_size % sizeof(int) != 0 ||
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
scripts/sorttable.h:479:6: note: uninitialized use occurs here
if (mcount_sort_thread) {
^~~~~~~~~~~~~~~~~~
scripts/sorttable.h:360:2: note: remove the 'if' if its condition is always false
if (orc_ip_size % sizeof(int) != 0 ||
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
scripts/sorttable.h:360:6: warning: variable 'mcount_sort_thread' is used uninitialized whenever '||' condition is true [-Wsometimes-uninitialized]
if (orc_ip_size % sizeof(int) != 0 ||
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
scripts/sorttable.h:479:6: note: uninitialized use occurs here
if (mcount_sort_thread) {
^~~~~~~~~~~~~~~~~~
scripts/sorttable.h:360:6: note: remove the '||' if its condition is always false
if (orc_ip_size % sizeof(int) != 0 ||
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
scripts/sorttable.h:360:6: warning: variable 'mcount_sort_thread' is used uninitialized whenever '||' condition is true [-Wsometimes-uninitialized]
if (orc_ip_size % sizeof(int) != 0 ||
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
scripts/sorttable.h:479:6: note: uninitialized use occurs here
if (mcount_sort_thread) {
^~~~~~~~~~~~~~~~~~
scripts/sorttable.h:360:6: note: remove the '||' if its condition is always false
if (orc_ip_size % sizeof(int) != 0 ||
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
scripts/sorttable.h:353:6: warning: variable 'mcount_sort_thread' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
if (!g_orc_ip_table || !g_orc_table) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
scripts/sorttable.h:479:6: note: uninitialized use occurs here
if (mcount_sort_thread) {
^~~~~~~~~~~~~~~~~~
scripts/sorttable.h:353:2: note: remove the 'if' if its condition is always false
if (!g_orc_ip_table || !g_orc_table) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
scripts/sorttable.h:353:6: warning: variable 'mcount_sort_thread' is used uninitialized whenever '||' condition is true [-Wsometimes-uninitialized]
if (!g_orc_ip_table || !g_orc_table) {
^~~~~~~~~~~~~~~
scripts/sorttable.h:479:6: note: uninitialized use occurs here
if (mcount_sort_thread) {
^~~~~~~~~~~~~~~~~~
scripts/sorttable.h:353:6: note: remove the '||' if its condition is always false
if (!g_orc_ip_table || !g_orc_table) {
^~~~~~~~~~~~~~~~~~
scripts/sorttable.h:288:30: note: initialize the variable 'mcount_sort_thread' to silence this warning
pthread_t mcount_sort_thread;
^
= 0
12 warnings generated.
Should mcount_sort_thread be zero initialized or is there something else
going on here? I am currently hunting down a bunch of other regressions
so apologies for just the report rather than a patch to fix it.
Cheers,
Nathan
next prev parent reply other threads:[~2022-01-15 20:36 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-11 17:30 [for-next][PATCH 00/31] tracing: Final updates for 5.17 Steven Rostedt
2022-01-11 17:30 ` [for-next][PATCH 01/31] tracing: Change event_command func() to parse() Steven Rostedt
2022-01-11 17:30 ` [for-next][PATCH 02/31] tracing: Change event_trigger_ops func() to trigger() Steven Rostedt
2022-01-11 17:30 ` [for-next][PATCH 03/31] tracing: Remove ops param from event_command reg()/unreg() callbacks Steven Rostedt
2022-01-11 17:30 ` [for-next][PATCH 04/31] tracing: Add helper functions to simplify event_command.parse() callback handling Steven Rostedt
2022-01-11 17:30 ` [for-next][PATCH 05/31] tracing: Have existing event_command.parse() implementations use helpers Steven Rostedt
2022-01-13 17:03 ` Daniel Bristot de Oliveira
2022-01-13 21:20 ` Steven Rostedt
2022-01-13 21:27 ` Steven Rostedt
2022-01-13 21:58 ` Tom Zanussi
2022-01-11 17:30 ` [for-next][PATCH 06/31] tracing: Remove redundant trigger_ops params Steven Rostedt
2022-01-11 17:30 ` [for-next][PATCH 07/31] tracing: Account bottom half disabled sections Steven Rostedt
2022-01-11 17:30 ` [for-next][PATCH 08/31] tracing/uprobes: Check the return value of kstrdup() for tu->filename Steven Rostedt
2022-01-11 17:30 ` [for-next][PATCH 09/31] tracing/probes: check the return value of kstrndup() for pbuf Steven Rostedt
2022-01-11 17:30 ` [for-next][PATCH 10/31] scripts: ftrace - move the sort-processing in ftrace_init Steven Rostedt
2022-01-15 20:36 ` Nathan Chancellor [this message]
2022-01-16 3:59 ` Steven Rostedt
2022-01-16 4:10 ` Nathan Chancellor
2022-01-17 6:23 ` [PATCH 0/1] fix initialization problems Yinan Liu
2022-01-17 6:23 ` [PATCH 1/1] script/sorttable: fix some " Yinan Liu
2022-01-17 22:56 ` Nathan Chancellor
2022-01-18 6:52 ` [PATCH v2] " Yinan Liu
2022-01-11 17:30 ` [for-next][PATCH 11/31] ftrace: Add test to make sure compiled time sorts work Steven Rostedt
2022-01-11 17:30 ` [for-next][PATCH 12/31] tracing: Fix mismatched comment in __string_len Steven Rostedt
2022-01-11 17:30 ` [for-next][PATCH 13/31] tracing: Have syscall trace events use trace_event_buffer_lock_reserve() Steven Rostedt
2022-01-11 17:30 ` [for-next][PATCH 14/31] tracing: Add test for user space strings when filtering on string pointers Steven Rostedt
2022-01-11 17:30 ` [for-next][PATCH 15/31] tracing/kprobes: nmissed not showed correctly for kretprobe Steven Rostedt
2022-01-11 17:30 ` [for-next][PATCH 16/31] rtla: Real-Time Linux Analysis tool Steven Rostedt
2022-01-12 11:15 ` Daniel Bristot de Oliveira
2022-01-12 16:21 ` Steven Rostedt
2022-01-12 16:30 ` Steven Rostedt
2022-01-12 16:32 ` Daniel Bristot de Oliveira
2022-01-12 17:14 ` Steven Rostedt
2022-01-12 17:16 ` Steven Rostedt
2022-01-12 17:21 ` Daniel Bristot de Oliveira
2022-01-11 17:30 ` [for-next][PATCH 17/31] rtla: Helper functions for rtla Steven Rostedt
2022-01-11 17:30 ` [for-next][PATCH 18/31] rtla: Add osnoise tool Steven Rostedt
2022-01-11 17:30 ` [for-next][PATCH 19/31] rtla/osnoise: Add osnoise top mode Steven Rostedt
2022-01-11 17:30 ` [for-next][PATCH 20/31] rtla/osnoise: Add the hist mode Steven Rostedt
2022-01-11 17:30 ` [for-next][PATCH 21/31] rtla: Add timerlat tool and timelart top mode Steven Rostedt
2022-01-11 17:30 ` [for-next][PATCH 22/31] rtla/timerlat: Add timerlat hist mode Steven Rostedt
2022-01-11 17:30 ` [for-next][PATCH 23/31] rtla: Add Documentation Steven Rostedt
2022-01-11 17:30 ` [for-next][PATCH 24/31] rtla: Add rtla osnoise man page Steven Rostedt
2022-01-11 17:30 ` [for-next][PATCH 25/31] rtla: Add rtla osnoise top documentation Steven Rostedt
2022-01-11 17:30 ` [for-next][PATCH 26/31] rtla: Add rtla osnoise hist documentation Steven Rostedt
2022-01-11 17:30 ` [for-next][PATCH 27/31] rtla: Add rtla timerlat documentation Steven Rostedt
2022-01-11 17:30 ` [for-next][PATCH 28/31] rtla: Add rtla timerlat top documentation Steven Rostedt
2022-01-11 17:31 ` [for-next][PATCH 29/31] rtla: Add rtla timerlat hist documentation Steven Rostedt
2022-01-11 17:31 ` [for-next][PATCH 30/31] tracing: Remove duplicate warnings when calling trace_create_file() Steven Rostedt
2022-01-11 17:31 ` [for-next][PATCH 31/31] tracing/osnoise: Properly unhook events if start_per_cpu_kthreads() fails 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=YeMwNEfNaGErFthk@archlinux-ax161 \
--to=nathan@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=llvm@lists.linux.dev \
--cc=mingo@kernel.org \
--cc=oliver.sang@intel.com \
--cc=rostedt@goodmis.org \
--cc=yinan@linux.alibaba.com \
/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