From: Pedro Alves <pedro@palves.net>
To: Simon Marchi <simark@simark.ca>, gdb-patches@sourceware.org
Subject: Re: [PATCH 1/2] Autogenerate gdb/syscalls/linux-defaults.xml.in (groups) from strace sources
Date: Mon, 27 Feb 2023 15:04:24 +0000 [thread overview]
Message-ID: <54f13f25-fb81-a1d4-262f-e0c10b151b0f@palves.net> (raw)
In-Reply-To: <7eba04ab-b77d-5b2f-755a-78157115d055@simark.ca>
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:
>>
>> <!-- The group field information was based on strace. -->
>>
>> 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.
next prev parent reply other threads:[~2023-02-27 15:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-24 23:26 [PATCH 0/2] Autogenerate gdb/syscalls/linux-defaults.xml.in (syscall groups) " Pedro Alves
2023-02-24 23:26 ` [PATCH 1/2] Autogenerate gdb/syscalls/linux-defaults.xml.in (groups) " Pedro Alves
2023-02-25 3:00 ` Simon Marchi
2023-02-27 15:04 ` Pedro Alves [this message]
2023-02-24 23:26 ` [PATCH 2/2] Regenerate Linux syscall group info Pedro Alves
2023-02-25 9:31 ` [PATCH 0/2] Autogenerate gdb/syscalls/linux-defaults.xml.in (syscall groups) from strace sources Tom de Vries
2023-02-27 14:53 ` Pedro Alves
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54f13f25-fb81-a1d4-262f-e0c10b151b0f@palves.net \
--to=pedro@palves.net \
--cc=gdb-patches@sourceware.org \
--cc=simark@simark.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).