Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp8960681rwb; Tue, 13 Dec 2022 12:49:13 -0800 (PST) X-Google-Smtp-Source: AA0mqf6b/2N3meRj368l7r1uLjIDeLZ8zFokvk3hE67SVWWk1pKZ1ghsnKDgwVjvDlr1mr6gWq44 X-Received: by 2002:a05:6a00:1a8c:b0:566:900d:5ae4 with SMTP id e12-20020a056a001a8c00b00566900d5ae4mr26182633pfv.20.1670964553218; Tue, 13 Dec 2022 12:49:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670964553; cv=none; d=google.com; s=arc-20160816; b=B0sh7KlMAKmN1u6fdbShDJKJK17AQ6OiprynTzwcGczfaTgZBqfdJkQhka+WXMaAEj 00KAjaw2UTZmDDS4VAIJ7N9Yqq4D0ApKRXcNEZV2MKhzGqbo73R9HOrEroe/fUttrh/T 3/SRbWnOT7axJEHVk325cN6X+2MVUrvww1oz5MDcAQGn8XkwKWVqLgLVn4r5Ennnc3gC FjUUqVHlLCd7WJDQ2CDfrhKpX96P3l048tLPop9ypN6h0T66e2Anep/C6RaAWp3Yb1/3 E+OHOzTEODEfMoLR/hcVF520an5gkXMemX+pd4K77t8B2Wj8Lh/WWCoxIKB35cDHanlu efWg== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i129-20020a625487000000b0055706edd79csi12276043pfb.240.2022.12.13.12.48.42; Tue, 13 Dec 2022 12:49:13 -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 + 74 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-Type: text/plain; charset=us-ascii 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 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 --- 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 -- 2.38.1