From owner-dev-commits-src-all@freebsd.org Fri Feb 5 16:29:06 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F2AB454B67E; Fri, 5 Feb 2021 16:29:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DXLTZ6Ww1z3jMk; Fri, 5 Feb 2021 16:29:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D347D21BF4; Fri, 5 Feb 2021 16:29:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 115GT6tk011083; Fri, 5 Feb 2021 16:29:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 115GT6sD011082; Fri, 5 Feb 2021 16:29:06 GMT (envelope-from git) Date: Fri, 5 Feb 2021 16:29:06 GMT Message-Id: <202102051629.115GT6sD011082@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 90da2c797bfa - main - truss: Decode sendfile(2) arguments MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 90da2c797bfa7639005ed46ab9173feb8bd85ecd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Feb 2021 16:29:07 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=90da2c797bfa7639005ed46ab9173feb8bd85ecd commit 90da2c797bfa7639005ed46ab9173feb8bd85ecd Author: Mark Johnston AuthorDate: 2021-02-05 16:28:09 +0000 Commit: Mark Johnston CommitDate: 2021-02-05 16:28:29 +0000 truss: Decode sendfile(2) arguments MFC after: 2 weeks --- usr.bin/truss/syscall.h | 2 ++ usr.bin/truss/syscalls.c | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/usr.bin/truss/syscall.h b/usr.bin/truss/syscall.h index 5f8babf4c407..af918fed4f1b 100644 --- a/usr.bin/truss/syscall.h +++ b/usr.bin/truss/syscall.h @@ -117,6 +117,8 @@ enum Argtype { Procctl, Priowhich, Ptraceop, + Sendfileflags, + Sendfilehdtr, Quotactlcmd, Reboothowto, Resource, diff --git a/usr.bin/truss/syscalls.c b/usr.bin/truss/syscalls.c index 319f3d8b0793..f52a82ed97c0 100644 --- a/usr.bin/truss/syscalls.c +++ b/usr.bin/truss/syscalls.c @@ -478,6 +478,10 @@ static struct syscall decoded_syscalls[] = { .args = { { Int, 0 }, { Iovec | IN, 1 }, { Int, 2 }, { Sockaddr | IN, 3 }, { Socklent, 4 }, { Sctpsndrcvinfo | IN, 5 }, { Msgflags, 6 } } }, + { .name = "sendfile", .ret_type = 1, .nargs = 7, + .args = { { Int, 0 }, { Int, 1 }, { QuadHex, 2 }, { Sizet, 3 }, + { Sendfilehdtr, 4 }, { QuadHex | OUT, 5 }, + { Sendfileflags, 6 } } }, { .name = "select", .ret_type = 1, .nargs = 5, .args = { { Int, 0 }, { Fd_set, 1 }, { Fd_set, 2 }, { Fd_set, 3 }, { Timeval, 4 } } }, @@ -2670,6 +2674,24 @@ print_arg(struct syscall_args *sc, unsigned long *args, register_t *retval, print_integer_arg(sysdecode_ptrace_request, fp, args[sc->offset]); break; + case Sendfileflags: + print_mask_arg(sysdecode_sendfile_flags, fp, args[sc->offset]); + break; + case Sendfilehdtr: { + struct sf_hdtr hdtr; + + if (get_struct(pid, args[sc->offset], &hdtr, sizeof(hdtr)) != + -1) { + fprintf(fp, "{"); + print_iovec(fp, trussinfo, (uintptr_t)hdtr.headers, + hdtr.hdr_cnt); + print_iovec(fp, trussinfo, (uintptr_t)hdtr.trailers, + hdtr.trl_cnt); + fprintf(fp, "}"); + } else + print_pointer(fp, args[sc->offset]); + break; + } case Quotactlcmd: if (!sysdecode_quotactl_cmd(fp, args[sc->offset])) fprintf(fp, "%#x", (int)args[sc->offset]);