From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30045.outbound.protection.outlook.com [40.107.3.45]) by sourceware.org (Postfix) with ESMTPS id E1696398240B for ; Fri, 3 Jun 2022 09:29:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E1696398240B ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Io5U6hkOwrTvdqNPGsfvlLAAigyWZCiqh6TUWvkd2WH71CRwiZGA55DQh1ZPioI9FPoz8O5GKdeegrazCr2a4HUL5p9XtSzACnXnYZzvwtWC22vggMOABe3oO/9ZM23p9xL7YlEIR6hSapY9iCocpsfOoXDUKy37J7AERWWSINit4yPdyImAIHTcJX8M+SU3txTIkOTUKPvL/w8SEclI0wM6AHJUMsdzKdoaOboIvdoo4m8PoedT4SwqP2dyEvuZJGK+9JgawPOkOHDI69o14MrYUTYy8KTMox3L1k0bYVAjpCK79Njhl4MEzFzthVzzVJxUKHpccOUM1K9a14zA+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=wqsAYfx0P7GKsHSEN/vBUnPC3eVW31viA49DcuTEnHE=; b=VxsI38kzeCo/1Lpdbc+HXFz8vCrzXF+8lgkRUM7WNZl3lEMw5x+05Sp6d497ONiZj49YTQoDQTulOh2Q806QuCTSOa6e7ZkkpJW41FrxcZ8stzEPsuvCbyTOTZ47TTL3iY7qorTUbNFoJpETcekVRFNdKicXsziO2oPyzIXKp7l5m8qQlM/sgGL3xi8o9vo3wKWmKC+8D6wXqpGWUuVlxDIctKE9KqZGiz7UUCEUaWG9PPXn8ZD1UiiYyWAa3fE2kNeRb78l0lhTEaBBsC3ZdNKWB5JcdZDyJLdAevOA1d9MiZAT7MT+24cxyuXSdmHh2aw/+i9F62d6PxDROo373w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 155.56.68.140) smtp.rcpttodomain=sourceware.org smtp.mailfrom=sap.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=sap.com; dkim=pass (signature was verified) header.d=sap.com; arc=none Received: from DU2PR04CA0327.eurprd04.prod.outlook.com (2603:10a6:10:2b5::32) by AM6PR02MB4581.eurprd02.prod.outlook.com (2603:10a6:20b:62::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5314.15; Fri, 3 Jun 2022 09:28:59 +0000 Received: from DBAEUR03FT014.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:2b5:cafe::25) by DU2PR04CA0327.outlook.office365.com (2603:10a6:10:2b5::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5314.15 via Frontend Transport; Fri, 3 Jun 2022 09:28:59 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 155.56.68.140) smtp.mailfrom=sap.com; dkim=pass (signature was verified) header.d=sap.com;dmarc=pass action=none header.from=sap.com; Received-SPF: Pass (protection.outlook.com: domain of sap.com designates 155.56.68.140 as permitted sender) receiver=protection.outlook.com; client-ip=155.56.68.140; helo=smtpde02.mail.net.sap; pr=C Received: from smtpde02.mail.net.sap (155.56.68.140) by DBAEUR03FT014.mail.protection.outlook.com (100.127.143.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5314.12 via Frontend Transport; Fri, 3 Jun 2022 09:28:59 +0000 X-purgate-ID: 152705::1654248538-00006100-B08850C1/0/0 X-purgate-size: 3108 X-purgate: clean X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de X-purgate-type: clean X-SAP-SPAM-Status: clean From: Michael Trapp To: elfutils-devel@sourceware.org Subject: [PATCH] debuginfod: add --disable-source-scan option. Date: Fri, 3 Jun 2022 11:28:57 +0200 Message-Id: <20220603092857.63144-1-michael.trapp@sap.com> X-Mailer: git-send-email 2.32.1 (Apple Git-133) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: a643ef82-879f-46f7-7ed1-08da45437d25 X-MS-TrafficTypeDiagnostic: AM6PR02MB4581:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oITMDLDf5KP4TKtHFsKAbjMim5dixApeiVBFJK0swKNQUBUPNB3CHShwD8cTIGvI5eWYpCg+qOj05Xs7KP1C+ZJcHuSNbswJClEneZqIdaV30358FbTkThqylC+y5ZOZcAZ08lxqsQZ3gYyixD8kfn7/KNkAQfdRCLRq31nFKLD/g6B2nPBPyeygY31sBsGE4cfujuijWjOw3906OtPhZz2LRGoybW666qvfIER1u6YIfJSbUxuDTUGhfURMClpI9e7O2ukPxV3ead2JSK9T2Uc/ZBL7wZQ9+wFE6pLhAG3M6D0grubRRMLi4VK3anARccCv/ZUQcfvWHeI98PNIVdd7Y6c2y58+TS+hoBlA4lYmAPdKCrByune0RWPGsF3YbAYhaVxz3JbicCMqcBkUz/Kel0Ia2OP8KpkZ4N3lVt8Dsl04Cwo8eKUa+cUHGHJVN8pRZo8UhUSFQT8dUwFke5N0IRcT8Bf0f8S+gkEZ/20lbOXuST4sxMLDzw9BCta72Yab4YbXXX6FEGheJf7mzdjKHruQq/3XDMG9AO5oi1NIwr6bo99pw2eHNBG+OwLbrrRm09oGaf7dYn23zGNjHv1Hclbk/nnoWJCA5+CBLQE1KPbZrMSS6r16vtPlL+2qQ6gv5PFewikyL27uHefUYtUcp5kwEkDrSPsMmPcf6xI= X-Forefront-Antispam-Report: CIP:155.56.68.140; CTRY:DE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:smtpde02.mail.net.sap; PTR:smtpde02.mail.net.sap; CAT:NONE; SFS:(13230001)(4636009)(46966006)(40470700004)(36840700001)(36860700001)(8936002)(5660300002)(44832011)(36736006)(70206006)(40460700003)(86362001)(8676002)(82310400005)(7596003)(356005)(82960400001)(2906002)(26005)(83380400001)(6512007)(508600001)(186003)(336012)(47076005)(6916009)(6486002)(36756003)(6506007)(956004)(1076003)(2616005)(316002); DIR:OUT; SFP:1101; X-OriginatorOrg: sap.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jun 2022 09:28:59.0143 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a643ef82-879f-46f7-7ed1-08da45437d25 X-MS-Exchange-CrossTenant-Id: 42f7676c-f455-423c-82f6-dc2d99791af7 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=42f7676c-f455-423c-82f6-dc2d99791af7; Ip=[155.56.68.140]; Helo=[smtpde02.mail.net.sap] X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: TreatMessagesAsInternal-DBAEUR03FT014.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR02MB4581 X-Spam-Status: No, score=-13.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Elfutils-devel mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jun 2022 09:29:04 -0000 --disable-source-scan disables scanning of the dwarf source info of debuginfo sections. The source info is not required in setups without source code access. Signed-off-by: Michael Trapp --- This option should save some scan cycles and DB space. If there is no access to source code, the source info is not required. In our setup the DB size is <5% without the source info. debuginfod/debuginfod.cxx | 9 ++++++++- doc/debuginfod.8 | 6 ++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/debuginfod/debuginfod.cxx b/debuginfod/debuginfod.cxx index 13980ced..51f4302b 100644 --- a/debuginfod/debuginfod.cxx +++ b/debuginfod/debuginfod.cxx @@ -381,6 +381,8 @@ static const struct argp_option options[] = {"forwarded-ttl-limit", ARGP_KEY_FORWARDED_TTL_LIMIT, "NUM", 0, "Limit of X-Forwarded-For hops, default 8.", 0}, #define ARGP_KEY_PASSIVE 0x1008 { "passive", ARGP_KEY_PASSIVE, NULL, 0, "Do not scan or groom, read-only database.", 0 }, +#define ARGP_KEY_DISABLE_SOURCE_SCAN 0x1009 + { "disable-source-scan", ARGP_KEY_DISABLE_SOURCE_SCAN, NULL, 0, "Do not scan dwarf source info.", 0 }, { NULL, 0, NULL, 0, NULL, 0 }, }; @@ -430,6 +432,7 @@ static long fdcache_mintmp; static long fdcache_prefetch_mbs; static long fdcache_prefetch_fds; static unsigned forwarded_ttl_limit = 8; +static bool scan_source_info = true; static string tmpdir; static bool passive_p = false; @@ -632,6 +635,9 @@ parse_opt (int key, char *arg, // other conflicting options tricky to check argp_failure(state, 1, EINVAL, "inconsistent options with passive mode"); break; + case ARGP_KEY_DISABLE_SOURCE_SCAN: + scan_source_info = false; + break; // case 'h': argp_state_help (state, stderr, ARGP_HELP_LONG|ARGP_HELP_EXIT_OK); default: return ARGP_ERR_UNKNOWN; } @@ -2705,7 +2711,8 @@ elf_classify (int fd, bool &executable_p, bool &debuginfo_p, string &buildid, se startswith (section_name, ".zdebug_line")) { debuginfo_p = true; - dwarf_extract_source_paths (elf, debug_sourcefiles); + if (scan_source_info) + dwarf_extract_source_paths (elf, debug_sourcefiles); break; // expecting only one .*debug_line, so no need to look for others } else if (startswith (section_name, ".debug_") || diff --git a/doc/debuginfod.8 b/doc/debuginfod.8 index 95b827e9..a94315ad 100644 --- a/doc/debuginfod.8 +++ b/doc/debuginfod.8 @@ -273,6 +273,12 @@ Configure limits of X-Forwarded-For hops. if X-Forwarded-For exceeds N hops, it will not delegate a local lookup miss to upstream debuginfods. The default limit is 8. +.TP +.B "\-\-disable\-source\-scan" +Disable scan of the dwarf source info of debuginfo sections. +If a setup has no access to source code, the source info is not +required. + .TP .B "\-v" Increase verbosity of logging to the standard error file descriptor. -- 2.32.1 (Apple Git-133)