From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E3594C6FD1F for ; Tue, 14 Mar 2023 09:32:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230028AbjCNJcL (ORCPT ); Tue, 14 Mar 2023 05:32:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229754AbjCNJcJ (ORCPT ); Tue, 14 Mar 2023 05:32:09 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC9F730CD for ; Tue, 14 Mar 2023 02:32:07 -0700 (PDT) Received: from kwepemm600005.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4PbSrc0Rj3zRs4c; Tue, 14 Mar 2023 17:28:48 +0800 (CST) Received: from [10.67.103.158] (10.67.103.158) by kwepemm600005.china.huawei.com (7.193.23.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Tue, 14 Mar 2023 17:32:01 +0800 Subject: Re: [PATCH v8 1/5] vfio/migration: Add debugfs to live migration driver To: Jason Gunthorpe CC: , , , , , References: <20230217084831.35783-1-liulongfang@huawei.com> <20230217084831.35783-2-liulongfang@huawei.com> From: liulongfang Message-ID: Date: Tue, 14 Mar 2023 17:32:00 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="gbk" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.103.158] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemm600005.china.huawei.com (7.193.23.191) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2023/3/11 1:12, Jason Gunthorpe wrote: > On Fri, Feb 17, 2023 at 04:48:27PM +0800, Longfang Liu wrote: >> +void vfio_vf_debugfs_init(struct vfio_device *vdev) >> +{ >> + struct device *dev = &vdev->device; >> + >> + vdev->debug_root = debugfs_create_dir(dev_name(vdev->dev), vfio_debugfs_root); >> + >> + debugfs_create_devm_seqfile(dev, "migration_state", vdev->debug_root, >> + vfio_vf_state_read); >> +} >> +EXPORT_SYMBOL_GPL(vfio_vf_debugfs_init); >> + >> +void vfio_vf_debugfs_exit(struct vfio_device *vdev) >> +{ >> + debugfs_remove_recursive(vdev->debug_root); >> +} >> +EXPORT_SYMBOL_GPL(vfio_vf_debugfs_exit); >> + >> +void vfio_debugfs_create_root(void) >> +{ >> + vfio_debugfs_root = debugfs_create_dir("vfio", NULL); >> +} >> +EXPORT_SYMBOL_GPL(vfio_debugfs_create_root); >> + >> +void vfio_debugfs_remove_root(void) >> +{ >> + debugfs_remove_recursive(vfio_debugfs_root); >> + vfio_debugfs_root = NULL; >> +} >> +EXPORT_SYMBOL_GPL(vfio_debugfs_remove_root); > > Why are these symbols exported? > If the export statement is not added, a compilation error will occur: ERROR: modpost: "vfio_vf_debugfs_init" [drivers/vfio/pci/hisilicon/hisi-acc-vfio-pci.ko] undefined! ERROR: modpost: "vfio_vf_debugfs_exit" [drivers/vfio/pci/hisilicon/hisi-acc-vfio-pci.ko] undefined! scripts/Makefile.modpost:126: recipe for target 'Module.symvers' failed make[1]: *** [Module.symvers] Error 1 > Jason > > . Thanks, Longfang >