Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp2053217pxb; Sun, 16 Jan 2022 08:23:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJycORtzCdmEnl342LrqfA/wjVk0axyavhRPM+uOE2AFxOKaEnWYRbr5uq06kRpDkHjOfADY X-Received: by 2002:a17:90b:4b0f:: with SMTP id lx15mr3105214pjb.124.1642350183350; Sun, 16 Jan 2022 08:23:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642350183; cv=none; d=google.com; s=arc-20160816; b=pX6GppZ6lMUGDA9QbsiBJu9o22RXB736Bqu3P7pZoiy+RILxOZ2Id9l+wmQ+ztwzhk 2riek07YjUDopjeiy5HyJLD0+3EtpbLE9CC4F54zfNjQpeHT+oUlcIs9145gO16pRyEl TVSnxgikfNRMn7Fr+RUbmrDH7pcsbTD9/fR576KHtRnBJ4g6VhioLVkZyD81jKd2BdLC C2jQ0ZzSt2QjVBNBSqyBwwUHHIMet2bvR3q2lczMHkyHDB1qbGFsESaI53l3CezQsIET aD56vUXuq6bKr33DGcVZqwY/777+/dpGyw4OnV42NNLoVxZT2i0FMvWFVJsBxcoLf5mY RtRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=M7qipQV851F/V8tLwqaV5//HKtHo7osP1HWQwezzdx8=; b=gSNbcY0UZbzosmfw4qIbu+jDbjZRAPHs+id0LJA4CHq43tDWEOLD+jCcBDumO/wfe8 RKjuzuxuEtkA1qxMDxBsozdsR6RykoaG7knwzHaCEXQxSsYvsJvKm5/C1b6AG4caxs7z yPJA0Hs5ia6vLah9SUpogsbJ/6ZF6mlAMKcPGigv4nTJaIdlxpQljcwNoj7+ks98nAvH sZ2jBDSyB5XS4XF+Tgc3rjfYYml79hxHmFSC4+8+D4iV46P8rnoVDGMsc8ny43CwiG91 LDmrlnnNvHJnpqo6lhh1053wwTpDazqnOejQa32OQ4hW/dPNcvfJfdZBbBCixty667WT z2Ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LKaqP8ny; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e15si11151455pln.172.2022.01.16.08.22.51; Sun, 16 Jan 2022 08:23:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LKaqP8ny; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233696AbiAOUgP (ORCPT + 99 others); Sat, 15 Jan 2022 15:36:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231473AbiAOUgM (ORCPT ); Sat, 15 Jan 2022 15:36:12 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B396C061574 for ; Sat, 15 Jan 2022 12:36:12 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id B8D53B80B3D for ; Sat, 15 Jan 2022 20:36:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C48AEC36AE5; Sat, 15 Jan 2022 20:36:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1642278969; bh=j81iu10IGA5MM7vZ+4Xflpm3VzuElFYMdZD244D7f5U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=LKaqP8ny21GJ1HjC2QlE+3d0zehf1jptH+vE+ls2WL1yuH+ubKPqPnkvgRfUS13zT Da3189wOonGl3l1jcwzRT2HpFZ0nbhterUBop+eiG/IM3Q6tfwmnK3Cn784s/9FBlH 6YY1uiMt8KwkYgpOZ7B3YWKc3Ran2ldQIEokF1wUBEr0WxyUbtZG7e80YDr3kqXkqh Y3ByVd/CyJZENnrMaFfMddBbZ9wZU7s4RyfrU65exjdfmAgHShs0Hvl0Kl+X5rlrjk pBIUf5mUfeLrwimXIFCsUOvgldMGljupoaN5bPB506zOPO7fB6KDrtqq2sYlYBg5KO gjhRphO614Zeg== Date: Sat, 15 Jan 2022 13:36:04 -0700 From: Nathan Chancellor To: Steven Rostedt , Yinan Liu Cc: linux-kernel@vger.kernel.org, Ingo Molnar , Andrew Morton , kernel test robot , kernel test robot , llvm@lists.linux.dev Subject: Re: [for-next][PATCH 10/31] scripts: ftrace - move the sort-processing in ftrace_init Message-ID: References: <20220111173030.999527342@goodmis.org> <20220111173115.079437896@goodmis.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220111173115.079437896@goodmis.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Steven and Yinan, On Tue, Jan 11, 2022 at 12:30:41PM -0500, Steven Rostedt wrote: > From: Yinan Liu > > 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 > Reported-by: kernel test robot > Reported-by: kernel test robot > Signed-off-by: Steven Rostedt 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