From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) by sourceware.org (Postfix) with ESMTPS id 894363858D32 for ; Mon, 27 Feb 2023 15:04:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 894363858D32 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f50.google.com with SMTP id j19-20020a05600c1c1300b003e9b564fae9so7412305wms.2 for ; Mon, 27 Feb 2023 07:04:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:to:subject :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=PeJ2XXrUwix8LNnZPJFxs4M0KdH5pxQvTE+ZmppqMco=; b=ukZ2r4LReD1rrWlQH2qnlZGIMO0m8cJ6QFxGJt9LeF7u8j3n1iiW1Pg61EG9q41fNt It7Y28vArxn3fCGCdIri+cfCT/ucwdIkIqCBF1yU9MbNdzV8HLVYi5vV8WDDW8hrlHu8 FMhGveetqUttLo1nrn2CED2FZVsPguBL0YR9GUckjPisLMUsO8XUS9DmmaSeZTVoGJ40 CSfpzL+JNxvEr81eSIqXiIXyCbAud2iIe1kBNUi9EqmnJZJ2XOzPqA42cYdG7tBdBcwC 24HImyvZJ5ldyzFCLhQ9hW1OjDobE+M6Bo0cKUWJJZonanpSEo23t4UNQ8QUQy/+uE+x 8i9w== X-Gm-Message-State: AO0yUKXoDUxLxCtRYLsoCuBrNzayrUznDWflM3Uz0A6jGKTGIdoVELgo y1lagcvjatkQwlvJHv+3C+VNlND2Jx+IMg== X-Google-Smtp-Source: AK7set+W/2uERy5UGv0fR7TQMY6d7M6S65qv0tVm7v2g6CszC3fvCJXa4g4auPdYriJDLhdHSwIgPw== X-Received: by 2002:a05:600c:1608:b0:3eb:39c9:ecb0 with SMTP id m8-20020a05600c160800b003eb39c9ecb0mr4529632wmn.8.1677510263951; Mon, 27 Feb 2023 07:04:23 -0800 (PST) Received: from ?IPv6:2001:8a0:f92b:9e00::1fe? ([2001:8a0:f92b:9e00::1fe]) by smtp.gmail.com with ESMTPSA id o3-20020a5d4083000000b002c5a790e959sm7408596wrp.19.2023.02.27.07.04.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 27 Feb 2023 07:04:23 -0800 (PST) Subject: Re: [PATCH 1/2] Autogenerate gdb/syscalls/linux-defaults.xml.in (groups) from strace sources To: Simon Marchi , gdb-patches@sourceware.org References: <20230224232650.4031472-1-pedro@palves.net> <20230224232650.4031472-2-pedro@palves.net> <7eba04ab-b77d-5b2f-755a-78157115d055@simark.ca> From: Pedro Alves Message-ID: <54f13f25-fb81-a1d4-262f-e0c10b151b0f@palves.net> Date: Mon, 27 Feb 2023 15:04:24 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <7eba04ab-b77d-5b2f-755a-78157115d055@simark.ca> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 2023-02-25 3:00 a.m., Simon Marchi wrote: > > > On 2/24/23 18:26, Pedro Alves wrote: >> I noticed that "catch syscall group:process" doesn't catch clone3, >> while it does catch clone. >> >> The catch syscall group information is recorded in the >> gdb/syscalls/linux-defaults.xml.in file, which says: >> >> >> >> So I looked at the strace sources, to confirm that clone3 is in fact >> recorded in the "process" group there too, and to check what other >> syscalls might be missing groups. >> >> After some digging, I found that strace records the group info in C >> arrays, with entries like: >> ... >> [ 61] = { 4, TP, SEN(wait4), "wait4" }, >> [ 62] = { 2, TS|TP, SEN(kill), "kill" }, >> [ 63] = { 1, 0, SEN(uname), "uname" }, >> ... >> >> You can see the current master's table for Linux x86-64 here: >> >> https://github.com/strace/strace/blob/e88e5e9ae6da68f22d15f9be3193b1412ac9aa02/src/linux/x86_64/syscallent.h >> >> The column with TS|TP above is what defines each syscall's groups. So >> I wrote a script that extracts this information and generates >> linux-defaults.xml.in. > > Thanks, that LGTM. > > I think the filename passed around is not actually used, so you can do: > Thanks, I've done that, and pushed the series. > > I was tipped off by this shellcheck warning: > > In update-linux-defaults.sh line 95: > generate "$t" > "$f" > ^-- SC2154 (warning): t is referenced but not assigned. > Thanks for that. For some reason I forgot to run it.