Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp289803iob; Thu, 28 Apr 2022 02:22:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyeO+c6TKpJzKTaPxlMhcQSawr9mIznd45TldO82D2OL9KpM57QujterABhhC5iBKglZo2i X-Received: by 2002:a17:902:6b8b:b0:14d:66c4:f704 with SMTP id p11-20020a1709026b8b00b0014d66c4f704mr33258361plk.53.1651137758738; Thu, 28 Apr 2022 02:22:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651137758; cv=none; d=google.com; s=arc-20160816; b=dwNGGd01UYTft2FmwA61tzdG80bIDk2MkXdlgKcB/T50CARchE3AcNOAbq7J0UUeGv wEwWAcz81Xchs/Wj6qkBaXqPEmPZoapHYY4VOPuONoX/mP6QHFMM5ORBXS3KhWFHXJiI BfknzmzdFRBypQv9ZuRSiCbrjxjhXNTYZ5rk65LBxpmdf/Jr12P8QL+reUoWxAs/9rom qZxbSw0ylf6QdabNSOpW7fdSp+RAnj0qLZcySiKCRWeQk8oQJjAn3aY+6Nc2Gy2FL9eW B0sWoVOz9ZatF2faTTHw0Ccbd0ex2bbQeV9e4F2JDzH0logcLLxcmqXkD42Y3tl+Z8hp kNMw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Jhte9TtmLdwNSsg9a7B+9N6bNzgQDRHJdEJOyKldtns=; b=UlFaMoXf72o3SmtJKyHCvCs96FgxLSoeQqKq+jdSHRhMqoW2wYLJifMBdlWqRHPM7I BgGbG2E4yntCvtvetgElAGGdelRlfyXIoOnSIiu2A1hPzt78C5yVLL8+5bKqur0dkGyA XSZGi76ex2GD598mKmqfj1VGMPdVusG+PNKO8jFPhFrOE2lAQ4LNZD4iPs5BStBUdUgT XLkUpbQhQhYJse55mfy572babcBaMVBfudaEf8ZJS2Xo7fhjIucqnLagFQxYBsNVsHkv rCa7xTFqw2Wt5YuVr9RPtcHscKrbme1pXU+be8//U2VvhD/af8DlE/GkNWkWx1A6OMtz li2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ks5R5o4r; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p10-20020a634f4a000000b003820b4f8361si3912786pgl.182.2022.04.28.02.22.23; Thu, 28 Apr 2022 02:22:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ks5R5o4r; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S236859AbiD0VHR (ORCPT + 99 others); Wed, 27 Apr 2022 17:07:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233639AbiD0VHQ (ORCPT ); Wed, 27 Apr 2022 17:07:16 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD1ECBF43; Wed, 27 Apr 2022 14:04:02 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 468C461D94; Wed, 27 Apr 2022 21:04:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 867E6C385A9; Wed, 27 Apr 2022 21:03:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651093441; bh=syZvsfkXqWjSBvMqPMOPO0J8VKUuLeAVtPJLh94JYZo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ks5R5o4rby5MKu2lFnaXpPgnj3to+HEWAZHDiKBD4OIbHi7tKvaS7RVYc412pRSm8 /FXTBnXDCJbZMoxpSAsK2fxcqQR7HTlOVOELVHtJe/a7pzJRrLf8UEUHbClE9guWYf j5BbGjDfQ/ANf6QD0z8xkBdPmy4gc2MrWGlP82TOtqkbcCLmwriPy9dnwP8UuoJYPC kW5wQPl3a8nW8+YsP/ykndZU5PkFPgSjgZQVM69E+MFUedCTA0j9yEOeFmmidButBo 2IN6a+Ok+L0oMtLvGoJ14+BAq+LM5ry0XJLz35JaqK8x7N49JIP0AYAdtsZ3S4InoI DCmSbNfOcNSLQ== From: Jiri Olsa To: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Masami Hiramatsu Cc: Christoph Hellwig , netdev@vger.kernel.org, bpf@vger.kernel.org, lkml , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Steven Rostedt Subject: [PATCHv3 bpf-next 1/5] kallsyms: Fully export kallsyms_on_each_symbol function Date: Wed, 27 Apr 2022 23:03:41 +0200 Message-Id: <20220427210345.455611-2-jolsa@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220427210345.455611-1-jolsa@kernel.org> References: <20220427210345.455611-1-jolsa@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 Fully exporting kallsyms_on_each_symbol function, so it can be used in following changes. Rather than adding another ifdef option let's export the function completely (when CONFIG_KALLSYMS option is defined). Cc: Christoph Hellwig Signed-off-by: Jiri Olsa --- include/linux/kallsyms.h | 5 +++++ kernel/kallsyms.c | 2 -- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h index ce1bd2fbf23e..d423f3cffa6d 100644 --- a/include/linux/kallsyms.h +++ b/include/linux/kallsyms.h @@ -163,6 +163,11 @@ static inline bool kallsyms_show_value(const struct cred *cred) return false; } +static inline int kallsyms_on_each_symbol(int (*fn)(void *, const char *, struct module *, unsigned long), + void *data) +{ + return -EOPNOTSUPP; +} #endif /*CONFIG_KALLSYMS*/ static inline void print_ip_sym(const char *loglvl, unsigned long ip) diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c index 79f2eb617a62..fdfd308bebc4 100644 --- a/kernel/kallsyms.c +++ b/kernel/kallsyms.c @@ -228,7 +228,6 @@ unsigned long kallsyms_lookup_name(const char *name) return module_kallsyms_lookup_name(name); } -#ifdef CONFIG_LIVEPATCH /* * Iterate over all symbols in vmlinux. For symbols from modules use * module_kallsyms_on_each_symbol instead. @@ -251,7 +250,6 @@ int kallsyms_on_each_symbol(int (*fn)(void *, const char *, struct module *, } return 0; } -#endif /* CONFIG_LIVEPATCH */ static unsigned long get_symbol_pos(unsigned long addr, unsigned long *symbolsize, -- 2.35.1