From nobody Thu Jun 5 16:54:29 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bCrCQ5t9zz5y5qK for ; Thu, 05 Jun 2025 16:54:42 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bCrCQ0hqrz3Mvh for ; Thu, 05 Jun 2025 16:54:42 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-7376dd56f8fso1515582b3a.2 for ; Thu, 05 Jun 2025 09:54:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1749142480; x=1749747280; darn=freebsd.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=e2wpoMoWNlS0FJ08KMHqlml51wIU/H2aLC3IyJM3BJI=; b=W9GJSL4FXYSKiUyaZPCzLZkT1osTXuGbEF5hcAExDpWuKP6po8FbM2Sd7KzRdyadRH 46O2M9SWGYjMJ9iB1BwDXmhcoPN8qOYCls4gR5MU3z1vGpVX+mRh1vcc7RNFBR2OOhd9 wAwOsmwZZtXENxSMK/oWWjKf/ijuVdIHAKuAiwJSIfrXblzdwNbNBgXOeZWFM2A9gN15 Hp/KTZUWlerXBD8IxIlnZYn37MXEjvXzpBtvzQfVU1Jx1tCSZz/LXIZLs91WWOccXKh7 wBbG799ghe5JcZuV0+bSsx2PNEbEAHcgwasxTzWXNmVUGkB6/9rizWScNiy0ie5jYjVV yTEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749142480; x=1749747280; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=e2wpoMoWNlS0FJ08KMHqlml51wIU/H2aLC3IyJM3BJI=; b=IJUA7PYBxNWt+aqZytrl3+tdqBIzhsySrzMhqV0eOmRB6opMIW35hmLb6hEn6dfhjN al124980t5NwcAftwZ4CY+MixesBPLpRDQViguzRzcZE4Hke2Bz1Zf+HX2wppLGUoxNV sVw0Mg8UnMEmgRZ4L2jSa4HEk2aD4Y+U9Fkz1zS0K1HbhOcB6W/TM8xez+x9xHfY3lpu MAH2RQa85QLERH42zacUVKwa+XWmQbZFRun+QIvoYdBbczS45oVoHgDm9DmLcLlQa+iq fI07LJ+2J5a3RhwzJnkQgILwFGvUY5xTJVO42iWZ2/ttgya/D58a+IU1it1Kw5Kb2+Ke ERWw== X-Forwarded-Encrypted: i=1; AJvYcCV2fw+KRWaGNHa/asF28JwqwaUra3Cx1dezQ70x1shNTrFOHw8jcEvmHLuZEbiDaXlhelOdHs9isOP7jEZ30i9er8T/DA==@freebsd.org X-Gm-Message-State: AOJu0YwlgQqYGS0LBnlXAlhyyCpmxphKL5mr1QLGw1abX77Bl3780avZ 5eS+oxhm8p6lr1qUPVOidoWJvBAXqkjk1W7B1wJB5POUrQn8vN+RP2O+EXDGGErGvfFTy42Nsg7 R3HgiDJKhhuVDj6EFBCsYh7a/4O1YytbtmebRaGu6sw== X-Gm-Gg: ASbGncuecVAT5sP+ZY2vRFKMn41Ngc21CfxCQ8GCe/y6PdA/Ws6CXk0v7/CcVmm3Ul8 6sCtFY7uMVG1aGVUQP85xiuFQnFt8nHqil4vRiU6JBuJKlaVa1ReQORpCJ8IIoL7erlWlrtryVK EDZhpPGa8zXt8P/LV3Nh204vgofGtdpjc+aZu+Jy8GS1I= X-Google-Smtp-Source: AGHT+IF3WXSewx/UOm3txGx9FHtpTUzb6UelQoeXjxBmQEqf4+BLfH/Y2baewkfs7VyY4LMimXVZf63DY1vR5mmXrrU= X-Received: by 2002:a05:6a00:2309:b0:740:595a:f9bf with SMTP id d2e1a72fcca58-74827e513b6mr668123b3a.3.1749142480330; Thu, 05 Jun 2025 09:54:40 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <202506040151.5541pESm016476@gitrepo.freebsd.org> <02ed6d30-b22a-456d-96e2-7f5b235766fd@FreeBSD.org> <0b4a1945-8f75-4f57-9a57-5bd0c10a7af1@FreeBSD.org> In-Reply-To: <0b4a1945-8f75-4f57-9a57-5bd0c10a7af1@FreeBSD.org> From: Warner Losh Date: Thu, 5 Jun 2025 09:54:29 -0700 X-Gm-Features: AX0GCFv9cidmdtF6utjvCBVBtj70v0Fko3ZQ_occvp9FLy9-smmt1_M8NjQF1qY Message-ID: Subject: Re: git: 969f6380eb66 - main - kdump: nicer printing of kill(2) PID argument To: John Baldwin Cc: Kyle Evans , Gleb Smirnoff , markj@freebsd.org, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4bCrCQ0hqrz3Mvh X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] On Thu, Jun 5, 2025 at 6:14=E2=80=AFAM John Baldwin wrote= : > > On 6/4/25 19:03, Kyle Evans wrote: > > On 6/4/25 17:55, Gleb Smirnoff wrote: > >> On Wed, Jun 04, 2025 at 01:51:14AM +0000, Kyle Evans wrote: > >> K> The branch main has been updated by kevans: > >> K> > >> K> URL: https://cgit.FreeBSD.org/src/commit/?id=3D969f6380eb66f809eed3= e5c38b6021824a4cc2bf > >> K> > >> K> commit 969f6380eb66f809eed3e5c38b6021824a4cc2bf > >> K> Author: Kyle Evans > >> K> AuthorDate: 2025-06-04 01:51:06 +0000 > >> K> Commit: Kyle Evans > >> K> CommitDate: 2025-06-04 01:51:06 +0000 > >> K> > >> K> kdump: nicer printing of kill(2) PID argument > >> K> > >> K> Similar to wait*(), kill(2) operates on a pid that currently ge= ts output > >> K> as hex. Output it in decimal to make it a little easier to eye= ball the > >> K> pid we're signalling. > >> K> > >> K> Reviewed by: markj > >> K> Differential Revision: https://reviews.freebsd.org/D50508 > >> > >> I didn't review if PIDs are always printed as decimals or not, but for > >> the file descriptors it is a mix of hex and decimals. :( Usually I go > >> with a sed script over kdump output to make it consistent. > >> > > > > To be fair, I'd like to fix that, too- I noticed close() the other day > > for fd > 0, but paused when I: > > > > 1.) couldn't tell where we even output close args > > close is probably handled by the default case where where all of the > arguments are just output as hex values. Note that for kdump, most > syscalls fall into this case including syscalls with pointer arguments. > You'd probably be a bit sad with 64-bit pointers printed as decimal > for many system calls. > > truss is different as truss stores some rudimentary type information abou= t > system call arguments and then defaults to printing certain types like > file descriptors and ids as decimal. truss also prints NULL for null > pointers IIRC. > > A useful project perhaps would be to move the table describing system > call argument types out of syscalls.c in truss and into libsysdecode so > that kdump could also reuse it. Probably the API you would want is > something that returns an individual `struct syscall_decode` given > (ABI, number) input arguments. Yes. All this generation is why we did the lua project to make the master system call table parsing into a library. We need it also for qemu-bsd-user long-term: writing new system calls by hand is a pain and error-prone. > I don't think you can generate this table automatically from makesyscalls= .lua > as many of the "types" truss uses are synthetic types that aren't visible > in C, e.g. "OpenFlags" meaning O_* flags passed to open(2). I think that we should, in the fullness of time, flag these so we can do that. If we do add additional notations, we can not only have better truss/trace output, as well as being able to generate the right flag translations for running FreeBSD binaries on Linux (which people are doing by hand right now...). > This would allow kdump's hand-written per-syscall-number rules to instead > be closer to truss where you instead just iterate over types. It would > also mean only having to update a single table in libsysdecode when addin= g > a new system call to add both truss and kdump support. Only when a new > argument type is added would one have to actually touch truss or kdump > directly. I'd love for this to be generated as well... It was certainly one of the use cases that we had in mind for the GSOC project that did this. Warner