From patchwork Wed Mar 22 01:36:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13183459 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 687AEC6FD1D for ; Wed, 22 Mar 2023 01:37:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229816AbjCVBhF (ORCPT ); Tue, 21 Mar 2023 21:37:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229961AbjCVBg7 (ORCPT ); Tue, 21 Mar 2023 21:36:59 -0400 Received: from mail-io1-xd2e.google.com (mail-io1-xd2e.google.com [IPv6:2607:f8b0:4864:20::d2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F3745A92E; Tue, 21 Mar 2023 18:36:40 -0700 (PDT) Received: by mail-io1-xd2e.google.com with SMTP id h2so4609429iow.0; Tue, 21 Mar 2023 18:36:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679448993; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=IAvSDTaQNCs+gy/ESSErpV55nInpY/nvxkb3Bc1Sf+Q=; b=YtkuE4e6GTaL+l4VQm0Go5MDVaO0GXT4CxCeRqw1liR/AdZVkzunI8FJAZEeFn4+t+ AOQwLIsaD1NVe3WUoyWnNaqdEPu5hj7Bvji8FtIar4uEdZJ+ypHNwQ9uBmcr8LRuQSqA b//GoOac8z8vWIoqxV7jAyVN5y3OHtjdMaLSyCBiGguQhGCNCQT8O2xG6Q8gk2TGcmWd M9i7REryIqfVB42yQR+OV1lGanWak9kHGk1e/cT6cHvTQp8kiEfF3WXBQAWv++GunfQO GFNhMluh2zYkNtUXkhp0pfdt9jqApl/C940xoSBtJOGr+m/Vhvbdj59WztmiD5os8mn9 o2uQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679448993; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IAvSDTaQNCs+gy/ESSErpV55nInpY/nvxkb3Bc1Sf+Q=; b=DO4gz2pLA9DndVgbAex5E88Rv1SG8q7Upy+bX426xZDxzOGlmRZSODbU8iPGGRIse7 ubjKCTwzgJ/KDgvwr1m1gL8E9xx6V3GlYFddu4mLJglpktSyATxeWM7rL4kOjZnzmaCQ EI+ZH8Tu8/LY2yp+jdvqhmqDSxuuzhyloXJcIZh6XBM/IBTHBUH2Z6Cxxg4hO5SYI1LM v2UNaCCVWyVK7WSQxYJuOgDbWWOSXoMjVt7vY3NfIup1XOcNYycY1uWIKT9pSoV73Y/M TSQMAYGTUtA8UJY6iXeoWjdYnwMfaJ5dX8Z8DvD4DFSPZIdRxPksYg8aJQK54pNqXXI7 +ZZg== X-Gm-Message-State: AO0yUKVNrKjAUS396DzuY9HmlnAEBESnqRnPX4XUSVEienjrUbAIro29 vD7BwCEewgNWcDBxybiSDrM= X-Google-Smtp-Source: AK7set82++47bpRl1j35mFQOSt2xSoX7hdvw3hNOfmaXbJPdPb9L4B8EtdK9B4Wdn3EvyX+IZuis6A== X-Received: by 2002:a6b:e704:0:b0:74c:b686:6227 with SMTP id b4-20020a6be704000000b0074cb6866227mr3355463ioh.14.1679448993133; Tue, 21 Mar 2023 18:36:33 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id a22-20020a6b6616000000b007530bbfa577sm3925058ioc.18.2023.03.21.18.36.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Mar 2023 18:36:32 -0700 (PDT) From: Jim Cromie To: mcgrof@kernel.org, linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jim Cromie Subject: [PATCH 1/4] module: in layout_sections, move_module: add the modname Date: Tue, 21 Mar 2023 19:36:20 -0600 Message-Id: <20230322013623.251401-2-jim.cromie@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230322013623.251401-1-jim.cromie@gmail.com> References: <20230322013623.251401-1-jim.cromie@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: layout_sections() and move_module() each issue ~50 messages for each module loaded. Add mod-name into their 2 header lines, to help the reader find his module. no functional changes. Signed-off-by: Jim Cromie --- kernel/module/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/module/main.c b/kernel/module/main.c index b4759f1695b7..39f267c40286 100644 --- a/kernel/module/main.c +++ b/kernel/module/main.c @@ -1523,10 +1523,10 @@ static void layout_sections(struct module *mod, struct load_info *info) for (i = 0; i < info->hdr->e_shnum; i++) info->sechdrs[i].sh_entsize = ~0UL; - pr_debug("Core section allocation order:\n"); + pr_debug("Core section allocation order for %s:\n", mod->name); __layout_sections(mod, info, false); - pr_debug("Init section allocation order:\n"); + pr_debug("Init section allocation order for %s:\n", mod->name); __layout_sections(mod, info, true); } @@ -2162,7 +2162,7 @@ static int move_module(struct module *mod, struct load_info *info) } /* Transfer each section which specifies SHF_ALLOC */ - pr_debug("final section addresses:\n"); + pr_debug("Final section addresses for %s:\n", mod->name); for (i = 0; i < info->hdr->e_shnum; i++) { void *dest; Elf_Shdr *shdr = &info->sechdrs[i]; From patchwork Wed Mar 22 01:36:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13183460 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 6731DC74A5B for ; Wed, 22 Mar 2023 01:37:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229884AbjCVBhG (ORCPT ); Tue, 21 Mar 2023 21:37:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230044AbjCVBg7 (ORCPT ); Tue, 21 Mar 2023 21:36:59 -0400 Received: from mail-io1-xd30.google.com (mail-io1-xd30.google.com [IPv6:2607:f8b0:4864:20::d30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8DDFC5A1AF; Tue, 21 Mar 2023 18:36:40 -0700 (PDT) Received: by mail-io1-xd30.google.com with SMTP id d14so4945371ion.9; Tue, 21 Mar 2023 18:36:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679448994; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=geHKdXSrTd+j0bEZzl4suSAJY2V13AlXRMEuZwesJq4=; b=Exufr2+FbVYVB3TWRJVhvwsg8XcRWMUuRQptkHRHLVySLmV1zl7ipHgwLV1WPnAtfz 9s9W0Bf6jpkzFDFwuH7+Gim+gQsiRVzNT9VxjoEDBZdhBqUTnrYaMd0C7EcM/DicNDBd emCvxY2pqCAD6dF4vX1zHdw9EBswdlp333p46frCDHCIYwYHjogNnFuBgCbqx61+JlY7 QF41Rvi1utPIA6WEHJnef5WG91skX+HUGllM4t4nlg2yrTqTfDl68D1LrtQFbT9GXaJB PHWknxafPLiGb1RL6keJqd1kxW/4PkPWLqSX8/TVnUWD4FbBplxsvrmAplcjip3eJtia BYaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679448994; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=geHKdXSrTd+j0bEZzl4suSAJY2V13AlXRMEuZwesJq4=; b=tblbSf0QcTZsSfhuuOzWSGJzuEnko1YCSuelYXRz95lZQUy+IrnUY3TNNBDDx7TsyK d7qgtrBXHU0k/7tFOydhKcbdooSFRLdnickvE+7i4KG1U2NGkhDcgbZrekiUeCe+4ETD vGxZDuU2Jviev61oBz3gbeU1J3eY0XtEztpsXqFCeyluUR99PfS4aG2PqdIN/Lhy/aqy P2adBIkCPZqZllurKkSpR9VFRn71/LMPg5hlef8FcHfR4IqwRx/FHQZrXcdJWb6dCmvL UAZdcctTJDBNi9B4M5tUFgZsEECxth1zYRVT77C7Uu3RP8UEEIu66RvayNL/drPHUV3y kBuw== X-Gm-Message-State: AO0yUKVKWOqvqMjCMOtqcCPI2PFNrrbFgvr9Cvhi8Be8K6+PCoNxozsR D86jYLu68xbCfmFAHDHhcaI= X-Google-Smtp-Source: AK7set/ButdII1reoOj79AjhVSnxCvB73puNkd1bHq1GdqNgjFlfAp3flBeK3PvwhlyM6cjFjvmM6g== X-Received: by 2002:a5e:d60f:0:b0:74c:bb78:25d7 with SMTP id w15-20020a5ed60f000000b0074cbb7825d7mr3149817iom.19.1679448994193; Tue, 21 Mar 2023 18:36:34 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id a22-20020a6b6616000000b007530bbfa577sm3925058ioc.18.2023.03.21.18.36.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Mar 2023 18:36:33 -0700 (PDT) From: Jim Cromie To: mcgrof@kernel.org, linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jim Cromie Subject: [PATCH 2/4] module: add symbol-name to pr_debug Absolute symbol Date: Tue, 21 Mar 2023 19:36:21 -0600 Message-Id: <20230322013623.251401-3-jim.cromie@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230322013623.251401-1-jim.cromie@gmail.com> References: <20230322013623.251401-1-jim.cromie@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: The pr_debug("Absolute symbol" ..) reports value, (which is usually 0), but not the name, which is more informative. So add it. no functional changes Signed-off-by: Jim Cromie --- kernel/module/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/module/main.c b/kernel/module/main.c index 39f267c40286..e248a3697ffb 100644 --- a/kernel/module/main.c +++ b/kernel/module/main.c @@ -1350,8 +1350,8 @@ static int simplify_symbols(struct module *mod, const struct load_info *info) case SHN_ABS: /* Don't need to do anything */ - pr_debug("Absolute symbol: 0x%08lx\n", - (long)sym[i].st_value); + pr_debug("Absolute symbol: 0x%08lx %s\n", + (long)sym[i].st_value, name); break; case SHN_LIVEPATCH: From patchwork Wed Mar 22 01:36:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13183461 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 391C9C6FD1D for ; Wed, 22 Mar 2023 01:37:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230031AbjCVBhH (ORCPT ); Tue, 21 Mar 2023 21:37:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230116AbjCVBhA (ORCPT ); Tue, 21 Mar 2023 21:37:00 -0400 Received: from mail-io1-xd2f.google.com (mail-io1-xd2f.google.com [IPv6:2607:f8b0:4864:20::d2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F6B3570A8; Tue, 21 Mar 2023 18:36:42 -0700 (PDT) Received: by mail-io1-xd2f.google.com with SMTP id bf15so7814788iob.7; Tue, 21 Mar 2023 18:36:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679448995; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fnkm/lF+4QiievpuG5aB+/enRuP0EybYte+rz+ieDGI=; b=Rp5FDiWA5X39lZ0AaWfjiZv1khAeB+MoVUr7Ai8MiF8gVBMeD4aZh53+AskX75aflF hT/lK79E2mYKR+Qt3AOhPWnSLfMIowGZgi4OpOelnj01aJeg9UsN3cvwG5xVgIFbkJ/D rL+snB5ydTmd6BsGwav3dmoXKplnouRi/IpGImKwBiiesl1fa5b2uEZp24TqprO/xGvr w7XrAXvyQ13XQbD0Mbe1Pl84w4+F7su4LrAjPEKxGKJPrKGjtHENiv2z4bJKYZGsDKCb zTE7C+t+o9erPLtkZzwCBGD0/B+yQiUNviON3gfvZKHh/8RzQ6uTmd9mUZiHaU0z5cUu tSqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679448995; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fnkm/lF+4QiievpuG5aB+/enRuP0EybYte+rz+ieDGI=; b=q5fciN01zgSaWZIzcL9NFDU28HNT72W1Lbc2UCRXhDU8Z2sn4vQf20m8q3miwwTUL1 8ge4R0X5+ullNPeF0JFX2HQK5mWd1on1MnxMb7HkEUK5POO1/s6/F2UYLa3FGl26ZxN/ dVbHg651j0QvLYMWTbrbQgJUG0k0z7obJngZ/UpY21NtX4GpS5tYygKPzGZNnMq7C31o 57KWCBdQFcRmSsZTe78s7pK3AfX+kMcf34ZlRNYFztoewZs7SZCUQGmgfKIG67VJBPoJ mS5SGceWRdIgNcedX5WKepbJiA+lUH0WAZfuOIt3iatpcbnaCrGtBg7dwwOhNTfeETNF Nu1w== X-Gm-Message-State: AO0yUKX1mBFHxq+G2+tw4QjVJUjlLw7T/U6BEe96r6P2N4NKyTkFOXHA /Q/vXBRjaRm3B7SdxGc57t2G26KvNnw= X-Google-Smtp-Source: AK7set+A7Tk+TLQvxE+Z0O3tb4ALO9hvfN4R6hR1H8G6ETAt59MgDmKCpLqfq5ttfInhV5UIJ7uX0Q== X-Received: by 2002:a5e:850c:0:b0:758:b06f:6ab2 with SMTP id i12-20020a5e850c000000b00758b06f6ab2mr17376ioj.2.1679448995117; Tue, 21 Mar 2023 18:36:35 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id a22-20020a6b6616000000b007530bbfa577sm3925058ioc.18.2023.03.21.18.36.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Mar 2023 18:36:34 -0700 (PDT) From: Jim Cromie To: mcgrof@kernel.org, linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jim Cromie Subject: [PATCH 3/4] module: add section-size to move_module pr_debug Date: Tue, 21 Mar 2023 19:36:22 -0600 Message-Id: <20230322013623.251401-4-jim.cromie@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230322013623.251401-1-jim.cromie@gmail.com> References: <20230322013623.251401-1-jim.cromie@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: move_module() pr_debug's "Final section addresses for $modname". Add section addresses to the message, for anyone looking at these. no functional changes. Signed-off-by: Jim Cromie --- kernel/module/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/module/main.c b/kernel/module/main.c index e248a3697ffb..a2a8ed8564ae 100644 --- a/kernel/module/main.c +++ b/kernel/module/main.c @@ -2177,8 +2177,8 @@ static int move_module(struct module *mod, struct load_info *info) memcpy(dest, (void *)shdr->sh_addr, shdr->sh_size); /* Update sh_addr to point to copy in image. */ shdr->sh_addr = (unsigned long)dest; - pr_debug("\t0x%lx %s\n", - (long)shdr->sh_addr, info->secstrings + shdr->sh_name); + pr_debug("\t0x%lx 0x%.8lx %s\n", (long)shdr->sh_addr, + (long)shdr->sh_size, info->secstrings + shdr->sh_name); } return 0; From patchwork Wed Mar 22 01:36:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13183462 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 05658C7619A for ; Wed, 22 Mar 2023 01:37:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229839AbjCVBhI (ORCPT ); Tue, 21 Mar 2023 21:37:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229829AbjCVBhB (ORCPT ); Tue, 21 Mar 2023 21:37:01 -0400 Received: from mail-io1-xd33.google.com (mail-io1-xd33.google.com [IPv6:2607:f8b0:4864:20::d33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 341EA574D5; Tue, 21 Mar 2023 18:36:44 -0700 (PDT) Received: by mail-io1-xd33.google.com with SMTP id o14so7832781ioa.3; Tue, 21 Mar 2023 18:36:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679448996; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xnvFcWzQC9kp0s3Ad9+shbkiRajCq0VM9LtHb2VW5NE=; b=iI/r7oZWPjB8fVKJxHIwCq0lhJMf7Au1DLZTtsnTwKYYgnnl26/qY+0JMi+AuQbLlS qcNb1K+gXIf8FH/7nwdKnRRmsPAPankblFbcVUAo14uPI4ZI/CHZQTyIdsw2tdN0+qlG XqRVcGYkDodvwGOw3dzt2sjHy4IiAgBySyktkFKh6wTMUdKssTdgK1O3H9UP49jnlKTe cLqYrohnCTBpZgnr5QVp5eu0HpNvkbTz2ubxgL7j3nG6O6+mHkH1LDxhxFyylJnc1PEB LvrnXmkuZhSS3LYjX7lXv2zHs51kbyqtBnyr4qpkIS0yxDRBRl1ihzMatJE8ufMQs8uD d0KQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679448996; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xnvFcWzQC9kp0s3Ad9+shbkiRajCq0VM9LtHb2VW5NE=; b=Eh1UqV4AcqYp65AGflP/uA0rk0fYtq7JTK9AQjGePaqk3veTP9lgzm0HkT0w8tJjjY Wmq0I4FnAqOIo5TUjfYxfdpSCVsYb1sgZDZPrGeYNvDE0GRebslRsu4tX+H4jZMyzswf a5yP0r0dreA8nrtM6nSEkP6irUNMkB6lT7bnSONebpJ/G3u66VGUlHlUn4yorcPbzkPc 9aSHHPZnPRqH3OWAVUMZ9eMMeHy1oXNnIg5+Y7ZxKGw9272ghCQBRxWGwJB4PKR4ld68 ysESAxtAcDgaqIFsD9i+9XGmlsDGfe2FP+wMe42F3Kiv1pRWqCqXdFpP7jE48T8fSiMY kx9Q== X-Gm-Message-State: AO0yUKX46Porf3xf17OGXedi6P1iA+FRDgJXs1ctrJ+pYOUEkvpZe36z WdBKf6nX5Sc1khyWCL90liM= X-Google-Smtp-Source: AK7set8MHRaO4K0z3XF3OnZulVfjEK7FTNO1+bzXEkiNh2U7IlPfqyUOD8mhtVwEFdFvmJmMX4Xp4w== X-Received: by 2002:a5e:cb03:0:b0:74e:3d8e:8e1e with SMTP id p3-20020a5ecb03000000b0074e3d8e8e1emr3414250iom.15.1679448995992; Tue, 21 Mar 2023 18:36:35 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id a22-20020a6b6616000000b007530bbfa577sm3925058ioc.18.2023.03.21.18.36.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Mar 2023 18:36:35 -0700 (PDT) From: Jim Cromie To: mcgrof@kernel.org, linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jim Cromie Subject: [PATCH 4/4] module: already_uses() - reduce pr_debug output volume Date: Tue, 21 Mar 2023 19:36:23 -0600 Message-Id: <20230322013623.251401-5-jim.cromie@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230322013623.251401-1-jim.cromie@gmail.com> References: <20230322013623.251401-1-jim.cromie@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: already_uses() is unnecessarily chatty. `modprobe i915` yields 491 messages like: [ 64.108744] i915 uses drm! This is a normal situation, and isn't worth all the log entries. NOTE: I've preserved the "does not use %s" messages, which happens less often, but does happen. Its not clear to me what it tells a reader, or what info might improve the pr_debug's utility. [ 6847.584999] main:already_uses:569: amdgpu does not use ttm! [ 6847.585001] main:add_module_usage:584: Allocating new usage for amdgpu. [ 6847.585014] main:already_uses:569: amdgpu does not use drm! [ 6847.585016] main:add_module_usage:584: Allocating new usage for amdgpu. [ 6847.585024] main:already_uses:569: amdgpu does not use drm_display_helper! [ 6847.585025] main:add_module_usage:584: Allocating new usage for amdgpu. [ 6847.585084] main:already_uses:569: amdgpu does not use drm_kms_helper! [ 6847.585086] main:add_module_usage:584: Allocating new usage for amdgpu. [ 6847.585175] main:already_uses:569: amdgpu does not use drm_buddy! [ 6847.585176] main:add_module_usage:584: Allocating new usage for amdgpu. [ 6847.585202] main:already_uses:569: amdgpu does not use i2c_algo_bit! [ 6847.585204] main:add_module_usage:584: Allocating new usage for amdgpu. [ 6847.585249] main:already_uses:569: amdgpu does not use gpu_sched! [ 6847.585250] main:add_module_usage:584: Allocating new usage for amdgpu. [ 6847.585314] main:already_uses:569: amdgpu does not use video! [ 6847.585315] main:add_module_usage:584: Allocating new usage for amdgpu. [ 6847.585409] main:already_uses:569: amdgpu does not use iommu_v2! [ 6847.585410] main:add_module_usage:584: Allocating new usage for amdgpu. [ 6847.585816] main:already_uses:569: amdgpu does not use drm_ttm_helper! [ 6847.585818] main:add_module_usage:584: Allocating new usage for amdgpu. [ 6848.762268] dyndbg: add-module: amdgpu.2533 sites no functional changes. Signed-off-by: Jim Cromie --- kernel/module/main.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/kernel/module/main.c b/kernel/module/main.c index a2a8ed8564ae..0a5583686994 100644 --- a/kernel/module/main.c +++ b/kernel/module/main.c @@ -563,10 +563,8 @@ static int already_uses(struct module *a, struct module *b) struct module_use *use; list_for_each_entry(use, &b->source_list, source_list) { - if (use->source == a) { - pr_debug("%s uses %s!\n", a->name, b->name); + if (use->source == a) return 1; - } } pr_debug("%s does not use %s!\n", a->name, b->name); return 0;