Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4589327iob; Sun, 8 May 2022 18:24:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzIScy40ZLglkLkqDSNyONRjtmpD26t1vcP+T6Fl6WHgAoZgNZEpCtSvONxKUM9of6bRxrx X-Received: by 2002:a17:90a:e7cd:b0:1dc:74eb:7526 with SMTP id kb13-20020a17090ae7cd00b001dc74eb7526mr15655415pjb.144.1652059481264; Sun, 08 May 2022 18:24:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652059481; cv=none; d=google.com; s=arc-20160816; b=BWtpPlslqE1H88WhMeuqJZMChicbkeuEfgnAHdBAabaZ8rRnZa7O07rfLVbzAEpu7X /gpZnLZoQoqLMn46gL0cSAC0fylvszcfHjEHQ9Gd/9wgcvc63y17fE35FZeRVAFmE2wn uVqUdMvY9v7bLTtyxlkI61jkWPI3TeeD/yP6JWK1hwzAFIWafexVUW8hBrCeTICnkj0a 0OD0nod3eNa+r2Fdz2TWsAYeuXvhH1P62h0LucV59G/tWzs2PIYdrmMpm90vvnXUvZf4 SwbGyl4jZZzY8b9x6X9bEbeH/KnvKNkiCN2wItqP7mIv50fpXic1UQI/WRD3VYPdUjXV y9pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=ObGYuo/jzq0kKJukFUQR7QwaI4Kz9Z4PyfnQhlw6wC8=; b=OSeDVrQCkbFGi2afLLOKOb9RCIlK9bc7YyMFvb37RwI9NTzWov819+bBZ4NOYLpKMU uLFW05KFBobPmnDuWJFKAchx4gXzVhPNfZVD3c8dBqrlgq+HvRV9G7X6tJ2mNCAleQP0 eWgEItOqNYCgFUdxWx65dakLcsfCoBTLcB3ftI17QwlYXJarrknMl7Qn3DWdr/cyeqRL OS5QOvFg12TPri5bziJC11MgZhslzE8FEx/dwBveKg9BNjSwDkNiYdh0WAwxYD6/5Lh1 Fi2qKVskDo1ndz4UHahYOP/xbS9UHd8K9LwkEs+mwZeHLQXufwtZw4k6Vpd9eYyuS4Jg VWmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=FH5bfMFw; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id b21-20020a637155000000b003ab41b3da66si10946558pgn.825.2022.05.08.18.24.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 May 2022 18:24:41 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=FH5bfMFw; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E80C213E9C; Sun, 8 May 2022 18:24:31 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1388572AbiEFDcs (ORCPT + 99 others); Thu, 5 May 2022 23:32:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1388559AbiEFDco (ORCPT ); Thu, 5 May 2022 23:32:44 -0400 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D80EE644C9 for ; Thu, 5 May 2022 20:29:02 -0700 (PDT) Received: by mail-pl1-x62d.google.com with SMTP id d22so6181063plr.9 for ; Thu, 05 May 2022 20:29:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ObGYuo/jzq0kKJukFUQR7QwaI4Kz9Z4PyfnQhlw6wC8=; b=FH5bfMFwxWVOcCcK1H7vci7vjZllv7QZZuVaFyXVqPTdJUSlmaGKhReLpWEfoGgzqB yGhrAFmvtly4AH1gcK716aGkF4RRIr5ik6iHxB/yFq/FYoiY9rkDljXeZYkU8u57GLoK I/Axk1ELhvF8NVjmPopww1or1npjxaH2Tp3jQd/QsEOg05n40QAsyuF0nD+kN5B2aSUI ADURSrK5W+VgR4KTZ2AZAmONT3B0wZ33ZF1h1skwAEaECwJv9kUfrEK8nxQmeC0ey7z6 RPnSkrzk4YuVb0P73S4Po3/IY3ftF8Ic6dOxuh4Ua8j7vaRGcI8rV+iKCh5bd+6f5L+L L/7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ObGYuo/jzq0kKJukFUQR7QwaI4Kz9Z4PyfnQhlw6wC8=; b=NXnPzF1Z7VN0PImZyyK58abYGut50Et8+6epyjYwyVjJn4VBYT3J5rfsU1SOGX+UQ/ YRkWW0R1YR9F0B3K/R0GDRzcHWW+/qG+O/BCubbDF0erdWfiEuxU6JeL6uBGlR06ElNW Q8GTjQLxX3wfM17+lyLWeNIwBqDb//FoqEGbhjZSrMKXF8+4pLKiX29lrrMUUtTIzfd7 toR03cv0/PwzElcbkdjZ4PX3eTIZurWFTP63bniIbWX0LnIDACngyXPoi6hWUueFnwju izApg65ZMHgP/5N0h/K/pNwqX5CaK/7JoSSwahlDdQIwYAi+4P6KsdylXaU0ikmGjQwd 8cFw== X-Gm-Message-State: AOAM533dZ4hyu93mm+JQGjLe7dwJsORAtVjvaFZoeRRdpzQKBdDfQJDQ VPAtjtNgEzIF4mChvFQZWwzEEQ== X-Received: by 2002:a17:90a:8d82:b0:1d8:a5a9:5489 with SMTP id d2-20020a17090a8d8200b001d8a5a95489mr1787634pjo.102.1651807742426; Thu, 05 May 2022 20:29:02 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.232]) by smtp.gmail.com with ESMTPSA id j19-20020a634a53000000b003c14af50610sm2233048pgl.40.2022.05.05.20.28.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 May 2022 20:29:01 -0700 (PDT) From: Chengming Zhou To: rostedt@goodmis.org, mark.rutland@arm.com, catalin.marinas@arm.com Cc: linux-kernel@vger.kernel.org, kbuild-all@lists.01.org, lkp@intel.com, zhouchengming@bytedance.com Subject: [PATCH] ftrace/fgraph: fix increased missing-prototypes warnings Date: Fri, 6 May 2022 11:27:37 +0800 Message-Id: <20220506032737.23375-1-zhouchengming@bytedance.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org After commit e999995c84c3 ("ftrace: cleanup ftrace_graph_caller enable and disable") merged into the linux-next tree, the kernel test robot (lkp@intel.com) has send out report that there are increased missing-prototypes warnings caused by that commit. COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross W=1 \ O=build_dir ARCH=sh SHELL=/bin/bash kernel/trace/ warning: no previous prototype for 'ftrace_enable_ftrace_graph_caller' [-Wmissing-prototypes] warning: no previous prototype for 'ftrace_disable_ftrace_graph_caller' [-Wmissing-prototypes] warning: no previous prototype for 'ftrace_return_to_handler' [-Wmissing-prototypes] warning: no previous prototype for 'ftrace_graph_sleep_time_control' [-Wmissing-prototypes] BTW there are so many missing-prototypes warnings if build kernel with "W=1". The increased warnings for 'ftrace_[enable,disable]_ftrace_graph_caller' is caused by CONFIG_FUNCTION_GRAPH_TRACER && !CONFIG_DYNAMIC_FTRACE, so the declarations in can't be seen in fgraph.c. And this warning can't reproduce on x86_64 since x86_64 select HAVE_FUNCTION_GRAPH_TRACER only when DYNAMIC_FTRACE, so fgraph.c will always see the declarations in . This patch fix the increased warnings by put the definitions in CONFIG_DYNAMIC_FTRACE although there are no real problems exist. Signed-off-by: Chengming Zhou --- kernel/trace/fgraph.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/trace/fgraph.c b/kernel/trace/fgraph.c index 289311680c29..2cd374294be7 100644 --- a/kernel/trace/fgraph.c +++ b/kernel/trace/fgraph.c @@ -30,6 +30,7 @@ int ftrace_graph_active; /* Both enabled by default (can be cleared by function_graph tracer flags */ static bool fgraph_sleep_time = true; +#ifdef CONFIG_DYNAMIC_FTRACE /* * archs can override this function if they must do something * to enable hook for graph tracer. @@ -47,6 +48,7 @@ int __weak ftrace_disable_ftrace_graph_caller(void) { return 0; } +#endif /** * ftrace_graph_stop - set to permanently disable function graph tracing -- 2.36.0