From patchwork Tue Dec 13 20:26:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paulo Miguel Almeida X-Patchwork-Id: 32943 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp346857wrn; Tue, 13 Dec 2022 12:30:47 -0800 (PST) X-Google-Smtp-Source: AA0mqf7hrNOgzhaFM8Id6jpgXS4rURwc21e7ZpF8/mbOwWlepN/YoFxivbdAFU7UYoNZYGMHmwtn X-Received: by 2002:a17:906:c1ca:b0:78d:f457:1062 with SMTP id bw10-20020a170906c1ca00b0078df4571062mr6369357ejb.31.1670963446958; Tue, 13 Dec 2022 12:30:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670963446; cv=none; d=google.com; s=arc-20160816; b=eb4/SRZt7U+/MVswTe3BHyTxFsLvPJshT9Tr4CoWSp393T/5/LzieswgKmtDPLLX84 yqjIvhJ3tLO+PdYNVvRRqShNoRG0DiKzrlHLVf+NoH5Avv5qQUlIuMl6pmZHDWvjcZDA R/mr/rb2hKvR/P4PlC7FI2LPe4A2JEfGL7GmkBMV8nSx1jY1ODj4xpJMyJBzVGWT1hV2 W8qXb5rRxsXtk/nGpAetU/OiBU6nXC1YdKiMRedLLiGyd0i39l3BwwpbTKVi4pB+6tIP YFzZWyZlDtkVr3jb0mrzZ5NEMX8HlLvLqxrjfzdCLrq7+qFurkvJIU1r8waqrVbEf9fR SmgQ== 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 :message-id:subject:cc:to:from:date:dkim-signature; bh=3eunpPqNIioAIh6oggqPAPCImtIarWZxO3LlqXOoyfU=; b=HmxnOL2ugxs/LpeD36fwTHRNvtRHF0RuBFRK/qgnbAtYKHRzskjLqjUjH0mudfbx3i 3l7IDuK4eRayIc6Luv+EHMsvYm6yPJgeiAwrnLmnNTJs6jIxXZc7Iip5MFxxJWg1ZbwV QBTOz4lcr21QcjYitYM/XP+Io6v3y+o7t3MVeEwpEOD7rB4b9AthS3cciCGGzUyb6KBW KJ1wzfdRZE2QB6B7qv1ZZ66t12Zn3M1avZDVYY9fpa8apAC+m8srpWz+8c0F2JuLQZbX IXv/opqd85mYUPS+VwOCqxKzU74JRQRdI1iFJ13Nk/+AZkbA+CZ4iKDL/zMeds/XFeSz mt0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ZnAX3SjX; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hq24-20020a1709073f1800b0077156c9124esi9334296ejc.1001.2022.12.13.12.30.23; Tue, 13 Dec 2022 12:30:46 -0800 (PST) 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=@gmail.com header.s=20210112 header.b=ZnAX3SjX; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238451AbiLMUaT (ORCPT + 99 others); Tue, 13 Dec 2022 15:30:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236984AbiLMU3y (ORCPT ); Tue, 13 Dec 2022 15:29:54 -0500 Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E45CFD1B; Tue, 13 Dec 2022 12:26:25 -0800 (PST) Received: by mail-pg1-x52b.google.com with SMTP id f9so614891pgf.7; Tue, 13 Dec 2022 12:26:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:message-id:subject:cc :to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=3eunpPqNIioAIh6oggqPAPCImtIarWZxO3LlqXOoyfU=; b=ZnAX3SjX1+BI5veXj4o/UF4Lsjtb07nZ9a2RWWK17Atuf+n8l8h8pwKO4X3pY/k5om pFPjNE/Z5TnrLtLq/iYWa0hr/tkfmpGJuJNLQYs1g0ei1E7Pd5oHPBn9b32fRHmGyXiT 4e8XTZvXfK5En7qf/QBAWwdOwUAW+kQoklPu6nL5fv9la9TudN3ka3hszUE0hdeR0lVs 9psLKqVnh23ekJf/rd69lngrisc7GazzY/XI4VFKB76qyZag4FF4SRnEFKaStcawU2b8 TsOVwKBEWt1P+S9CCOrdMtT3FXDWTKsreHocqTJw4rb9MhmOqFMuk/SfskhOetNSknCN Rr6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:message-id:subject:cc :to:from:date:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=3eunpPqNIioAIh6oggqPAPCImtIarWZxO3LlqXOoyfU=; b=4H62Wx+17nxJynR6dysR9ma4rt0cUKkoM5glLfzVDUA8sBE1Py2nCUHWTiLu1AMp9c 5uekvtL+j0OOXpPev51mY9xGnX/+vZAkbj2xCCXQnpsHg3vfEXrljZbMLyr994jUV551 /ZMP/3vkpOT/2SgFmUSGhjq2DEMlIf+v5d9Ml57XjKU4SCnxRKnfPBjKfFG5+mqSwZQL uA2qR1vCaVI+2BqMXOa3tsxLiB93TSNdnTxBiB5TV6W7sRM6IgZFXAJlb3rwayK+zByz MHyB97tGXX5ufj4c0Y1A0+K5NqCi/YCByGoreHKDs3EqkCsMYEe/GLBH6UV2WdKWY6Vz m7kA== X-Gm-Message-State: ANoB5pmEc+rGAMbd1LLyEVD67lkXKEAoAZhWjpdqKGSJG4SurQ3swY5s liTOiNmHCwtKR9m/Bq1YVnA= X-Received: by 2002:aa7:8b48:0:b0:56b:ae1d:a3c6 with SMTP id i8-20020aa78b48000000b0056bae1da3c6mr5043203pfd.1.1670963184803; Tue, 13 Dec 2022 12:26:24 -0800 (PST) Received: from mail.google.com (125-237-37-88-fibre.sparkbb.co.nz. [125.237.37.88]) by smtp.gmail.com with ESMTPSA id e9-20020aa79809000000b00571bdf45888sm8023394pfl.154.2022.12.13.12.26.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Dec 2022 12:26:24 -0800 (PST) Date: Wed, 14 Dec 2022 09:26:15 +1300 From: Paulo Miguel Almeida To: Masahiro Yamada , Nathan Chancellor , Nick Desaulniers , Nicolas Schier , Jonathan Corbet , Greg Kroah-Hartman , Cristian Ciocaltea , Paulo Miguel Almeida , Vipin Sharma , linux-kbuild@vger.kernel.org, linux-doc@vger.kernel.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH v3] scripts/tags.sh: choose which directories to exclude from being indexed Message-ID: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751871378752683049?= X-GMAIL-MSGID: =?utf-8?q?1752132167263416884?= It's common for drivers that share same physical components to also duplicate source code (or at least portions of it). A good example is both drivers/gpu/drm/amdgpu/* and drivers/gpu/drm/radeon/* have a header file called atombios.h. While their contents aren't the same, a lot of their structs have the exact same names which makes navigating through the code base a bit messy as cscope will show up 'references' across drivers which aren't exactly correct. Add IGNORE_DIRS variable, which specifies which directories to be ignored from indexing. Example: make ARCH=x86 IGNORE_DIRS="drivers/gpu/drm/radeon tools" cscope Signed-off-by: Paulo Miguel Almeida Reviewed-by: Vipin Sharma --- Changelog: - v3: change commit message wording and rst syntax (Req Bagas Sanjaya) change makefile variable scope to global, use blank space separator and change variable name to IGNORE_DIRS. (Req: Vipin Sharma) - v2: change approach to include everything unless specified by the IGNOREDIRS variable: (Req: Vipin Sharma) - v1: https://lore.kernel.org/lkml/Y5OKDvbGk4Kro6MK@mail.google.com/ --- Documentation/kbuild/kbuild.rst | 7 +++++++ scripts/tags.sh | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/Documentation/kbuild/kbuild.rst b/Documentation/kbuild/kbuild.rst index 08f575e6236c..5202186728b4 100644 --- a/Documentation/kbuild/kbuild.rst +++ b/Documentation/kbuild/kbuild.rst @@ -278,6 +278,13 @@ To get all available archs you can also specify all. E.g.:: $ make ALLSOURCE_ARCHS=all tags +IGNORE_DIRS +----------- +For tags/TAGS/cscope targets, you can choose which directories won't +be included in the databases, separated by blank space. E.g.:: + + $ make IGNORE_DIRS="drivers/gpu/drm/radeon tools" cscope + KBUILD_BUILD_TIMESTAMP ---------------------- Setting this to a date string overrides the timestamp used in the diff --git a/scripts/tags.sh b/scripts/tags.sh index e137cf15aae9..1ad45f17179a 100755 --- a/scripts/tags.sh +++ b/scripts/tags.sh @@ -17,6 +17,13 @@ ignore="$(echo "$RCS_FIND_IGNORE" | sed 's|\\||g' )" # tags and cscope files should also ignore MODVERSION *.mod.c files ignore="$ignore ( -name *.mod.c ) -prune -o" +# ignore arbitrary directories +if [ -n "${IGNORE_DIRS}" ]; then + for i in ${IGNORE_DIRS}; do + ignore="${ignore} ( -path $i ) -prune -o" + done +fi + # Use make KBUILD_ABS_SRCTREE=1 {tags|cscope} # to force full paths for a non-O= build if [ "${srctree}" = "." -o -z "${srctree}" ]; then