From patchwork Tue Jan 3 20:03:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paulo Miguel Almeida X-Patchwork-Id: 38643 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp4794559wrt; Tue, 3 Jan 2023 12:03:45 -0800 (PST) X-Google-Smtp-Source: AMrXdXs1JCJTj3yN9F1gxyZmbyaOPRywnYkj7iPvIQCOaPFJUBPi0AMBwsvL20p5VgQ77xKsiq0w X-Received: by 2002:a17:90a:cc2:b0:219:9973:2746 with SMTP id 2-20020a17090a0cc200b0021999732746mr61949416pjt.0.1672776225329; Tue, 03 Jan 2023 12:03:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672776225; cv=none; d=google.com; s=arc-20160816; b=NX39OktQTrNcNSGJ3W5+nMl0dnbAxy8VAbmXtlonOmah3EFEsFiZrYEiTwRv8rT7rM KJIUOfLQPIV0FQ/sDO9O0aOZED1psy/dXh6EqIKU2qHRiTddkbvjlcCo/FbHcCglCiDe JjkoVULPsmUnPiy9vSofDJYMepTNeuIizfahCYwzwKx1KszJbQ95SBqSw8YbOD5ZBW4M 2aaAlmDzJmKlsz2/d5WJmpcC3m88qfvxbYBLgs51DUoWpAa2B7AOrH8KnTjxWiW137Dw yIKxp5Z3zqfSd9xKDTcIgTKkta/yvqsTFdRs3akqfQw3Uuc5a9dyHCxELIbF/q14vo8i 6MTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=v8pcmuonN+UPPt9cmF4NX78AveTfQL9Fb1MLveIduoE=; b=KouAZ4x1GSed+RM2GxqJmKQEgoyqLv6jqAVntR7EBXuUvG2xUokAKvfkhQ+AQahZYb p4qUCaEqILmMVs70z1jZ+ssRoeA+WiUGyqhwnc/hSdQ0tCGAUlxf1OrOaVYzIW63EfuZ hSzz+wFkORy7r1CZhSsc5SfkHaxshx6hjs7/mG4i+d7Wq7Xj7XnOEkyKa+8cH5uK/NNE YhJn0vI0o4F37YDZ7Ah9nwC1OHBzVC95ONQZzyXLSrRFbtSPdiLSn4tFbURHgU36ivRt qsMOQGrcVwWBVoVKhL9Rlp2/sDfAcZ5UcikdItVK4uxaouwPgGVTT82Y8SBy6IZdXMuV i78A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=jkLGFFO8; 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 q25-20020a656259000000b00478d902b3e1si30894124pgv.61.2023.01.03.12.03.32; Tue, 03 Jan 2023 12:03:45 -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=jkLGFFO8; 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 S233729AbjACUDb (ORCPT + 99 others); Tue, 3 Jan 2023 15:03:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230488AbjACUD2 (ORCPT ); Tue, 3 Jan 2023 15:03:28 -0500 Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0957C140A7; Tue, 3 Jan 2023 12:03:26 -0800 (PST) Received: by mail-pl1-x631.google.com with SMTP id jn22so33743665plb.13; Tue, 03 Jan 2023 12:03:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=v8pcmuonN+UPPt9cmF4NX78AveTfQL9Fb1MLveIduoE=; b=jkLGFFO8+Ncdr+JTqPLzpv/WoBKqm9vRdqXUnfflH2/zvCrF/p3nMdYk9jdVSe+B7g XtpT42DUgZB2Sn+1rLdiPYbHliJPuzHK1jZcLXP9Dw0YOmDEJPjbgdp4w8Z/OsIzS+h2 KtyEkBf99fdCIJWl7M2PAAJ8L7kvBQeCqeJkelVD1ASmMNslVe8lr33wAqw0luP0qQtj OedssMr9oa6iUY35WUgIkVIFcEjDvEqjK3WNKZKm3Ct5pvO8AHWczw5+mxOrwi8gUaAr nXZ+eZ5e2+8zrRqcScLfoqp1Dz20lbOvGCxnCpub3GR5JVH1WNvZPEphAF/Vz5w0MJ6K TIYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=v8pcmuonN+UPPt9cmF4NX78AveTfQL9Fb1MLveIduoE=; b=QPrZ4544xs+tBiJxqy1Ktb6SmhKhAXX9qDgY3KiohZLlGubb7liaFMdChRN8WjKAgf Z2G63PHUfSjWlE1hILigW/iJRFLhAAEm/FCgEQnodWSaVz31Znh9H/DaPPTrStYciOzv 7vcBUlcau3aK9J29KJ+PfjnVLqbBI+t8X6NxBHxoAtwk88VORzcXkII/UnS1fHuhp9Yj dHifrCUesBvFt3iaUGMkOjgp2HTeCQtz6peo5ujXnex3I8Y18hLgQl8fMH5x/Qlzdiuq krMX9fkLAspCoLgcdLv1VDDkfJcKm9yjq+VLvPreRWmG6WUoQtffRNqi4Kej7SliSicj bqPw== X-Gm-Message-State: AFqh2kp/3SZYItWdWgpts05Yje9kn5vvyfonJHlE1PBpjxVzs+3vEai1 MbiBWH3Aog/j1GcrZIkn17k= X-Received: by 2002:a17:902:6acb:b0:191:40a9:60f6 with SMTP id i11-20020a1709026acb00b0019140a960f6mr10836769plt.0.1672776206043; Tue, 03 Jan 2023 12:03:26 -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 jg21-20020a17090326d500b001929827731esm12894682plb.201.2023.01.03.12.03.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Jan 2023 12:03:25 -0800 (PST) Date: Wed, 4 Jan 2023 09:03:18 +1300 From: Paulo Miguel Almeida To: masahiroy@kernel.org, nathan@kernel.org, ndesaulniers@google.com, nicolas@fjasle.eu, corbet@lwn.net, cristian.ciocaltea@collabora.com, gregkh@linuxfoundation.org, vipinsh@google.com, linux-kbuild@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: paulo.miguel.almeida.rodenas@gmail.com Subject: [PATCH v3 RESEND] scripts/tags.sh: choose which directories to exclude from being indexed Message-ID: MIME-Version: 1.0 Content-Disposition: inline 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?1754033003452450266?= X-GMAIL-MSGID: =?utf-8?q?1754033003452450266?= 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: Nicolas Schier --- 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/ Additional notes (if relevant): - Patch v3 was reviewed-by Vipin Sharma here: https://lore.kernel.org/lkml/CAHVum0eNp5Dup_KyrS2N0zu5TfrtcCxphRnLuBFZa5PxahVg7A@mail.gmail.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