From nobody Thu Nov 16 15:07:46 2023 X-Original-To: dev-commits-src-all@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 4SWNgl0B6nz50lsR; Thu, 16 Nov 2023 15:07:47 +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 4SWNgk6VLlz4stx; Thu, 16 Nov 2023 15:07:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1700147266; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6NChioyr9W3so5Ub8WTwB1nK95PGtjrjS+FNoii+yHs=; b=EQjjQJSGU+TxamC0VVJorLt6pp/euPZxLJmHyhvZaHWQlJ0CqCCmx2uI7Ri0cZZpB+qH1o Wc0a6A1QyOlQJZnJ+uRlARQx5Jo98qMseEu7wQjIfcP4W+CkaXKgZO0AJJ4n5z0FgOZEEj qOtx/CKnSchbT6jtoLrm7DlzmdoCqUNq0I3UNG4EVkEcSssjJYXEJFagIa49xNgiSPO5z8 vvGfO40w4+7WQqDJCVsW6RXYVjeU+VnrP41IH4gv/S1R5VRYOGBZuEAcVamUibSxFaXVWZ IU/Sb86kmbhxxbjg2zrj4LCpPM6ostCaNylpBbgHWfPBtWr8S5FP5jpCKajBqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1700147266; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6NChioyr9W3so5Ub8WTwB1nK95PGtjrjS+FNoii+yHs=; b=Txv6CIiVhZcOtYtz3fowH5/htrOkrEUL6ePRw1tIyKvGFeidYLqNBmKH+/bYsRp8CUi2NU SG1it022t5+lRIKJ58b3E+p+PlCy/dXokZy3DlgIWO7rVMUnSL6vUox/ZtRG8vB+lO4WfH MttjGbZDaBiJZYQiTfJCcwoE/Wnuzyx7WhfxYehOYxekrhMRgH8EDsXZ0oIJVmmCdjeOC0 y1SRqqJZo0qdhoXIKeCgKlGOmsbbz/QXDERkOqlVO9aA/QTRnmrWzUAY8CU+KPnsN+UWmm pVtmIzK+DoAsLA8nM6uojwCJV6R6mTHg2QA+qOfZ4Gl+qHEGNzkjgeHmwWwgtQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1700147266; a=rsa-sha256; cv=none; b=kvT0SrwlDezCLjdM9EgZ41XOioA7zajqjAVYphIeed5G/m2bTmqmu9bJp7EtInAXACVqgW jXRqgBdBDTdD28GivHonrDq1/7t6cw4DDAbW4njvKknsnZbHCSY0l8v/44rucUKcYBuCad 5PucDy7t+b4FvSE8KjXkNv18pZQza18xlQ3UXCgdpYOM5XymMzco0HFqmH2qUAgGKCSdTu Dz7E59ZZxz/xtvrE2btfQNhDXYHn0QoykvjnAArfdxD5axsT+kH3LlJW1pqVnunlG2Qql2 hyWm//vxbOr91ORfs2qlpJN4V727Si3ndZA01TaEQXpvceFAn1sYDWBPyIEjdA== 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 4SWNgk5Vqpz14FJ; Thu, 16 Nov 2023 15:07:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3AGF7klS070204; Thu, 16 Nov 2023 15:07:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3AGF7kgx070201; Thu, 16 Nov 2023 15:07:46 GMT (envelope-from git) Date: Thu, 16 Nov 2023 15:07:46 GMT Message-Id: <202311161507.3AGF7kgx070201@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Jonathan T. Looney" Subject: git: accfb4cc9346 - main - genoffset.sh: stop using a temporary file List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jtl X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: accfb4cc9346b23f6d6383dfc98d2c97ae18ce0d Auto-Submitted: auto-generated The branch main has been updated by jtl: URL: https://cgit.FreeBSD.org/src/commit/?id=accfb4cc9346b23f6d6383dfc98d2c97ae18ce0d commit accfb4cc9346b23f6d6383dfc98d2c97ae18ce0d Author: Jonathan T. Looney AuthorDate: 2023-11-16 15:02:32 +0000 Commit: Jonathan T. Looney CommitDate: 2023-11-16 15:02:32 +0000 genoffset.sh: stop using a temporary file Instead, use a here document for the input. This allows us to run the while loop in the main script so we can build the list of asserts in a shell variable. We then print out the list of asserts at the end of the loop. Reviewed by: imp Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D42407 --- sys/kern/genoffset.sh | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/sys/kern/genoffset.sh b/sys/kern/genoffset.sh index fda27998ca79..c974a7d52e8c 100644 --- a/sys/kern/genoffset.sh +++ b/sys/kern/genoffset.sh @@ -35,16 +35,13 @@ usage() work() ( - local last off x1 x2 x3 struct field type lastoff lasttype + local last off x1 x2 x3 struct field type lastoff lasttype asserts echo "#ifndef _OFFSET_INC_" echo "#define _OFFSET_INC_" echo "#if !defined(GENOFFSET) && (!defined(KLD_MODULE) || defined(KLD_TIED))" last= - temp=$(mktemp -d genoffset.XXXXXXXXXX) - trap "rm -rf ${temp}" EXIT - # Note: we need to print symbol values in decimal so the numeric sort works - ${NM:='nm'} ${NMFLAGS} -t d "$1" | grep __assym_offset__ | sed -e 's/__/ /g' | sort -k 4 -k 1 -n | + asserts= while read off x1 x2 struct field type x3; do off=$(echo "$off" | sed -E 's/^0+//') if [ "$last" != "$struct" ]; then @@ -60,12 +57,14 @@ work() printf "%b" "\t${type}\t${field};\n" lastoff="$off" lasttype="$type" - echo "_SA(${struct}, ${field}, ${off});" >> "$temp/asserts" - done + asserts="${asserts}_SA(${struct}, ${field}, ${off});\n" + done <