From nobody Tue Jun 20 19:39:10 2023 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 4Qlxlg0qcyz4gFxG; Tue, 20 Jun 2023 19:39:11 +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 4Qlxlg07Ydz43rJ; Tue, 20 Jun 2023 19:39:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687289951; 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=GUuqcVZ8mFIKS2NoUpc7nP55oinHK+bcsODIPZztvLc=; b=ortCggdeGAlLrZn3jwBRHEfr9jhIXFe0JLUNRxOyFq6IcVfDsKdMlmwWgt5PLPzxmoJmcN 8mhncBFeSc9hHYzr1Z004GKval1GLXXdT+SAKNcGwDffiDlC1M5XBVzFweG73vIzykQlyX TSE1YR/2TU/lGSLIQoJBljp+T4g/U941GrpeQaYYQFG9koOuS04Lb8CFaGt89vSqe8LTis PbYrN59sR6eE78YIUIDroklqNLmdSUzB5UUtJGH4fACPJ+pD0QAcjD70deRBjDsaft43HB C3qZEcDfYVJnhQLB5qi11OJuMbwJXHfIrqwxh5BM9S4I8Xjlo/ssDTEIeyVJMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687289951; 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=GUuqcVZ8mFIKS2NoUpc7nP55oinHK+bcsODIPZztvLc=; b=kkaHiAz13pxuCznTQ+7QrO11uL0y4f4q3CCGBNsufwBaWQ6WvlJ97/iiAhB9cOk6temQzH cDoIZYWfsSyokfaFSJiKvUFbXTeTlCC9T584a30JBmpGiklrFueeH4wOdis1Q0062xHcpy jjoUbfiOcuTs0rmby+YDo+RO544nINL5LMo0hLJoCx0hWbdFUnZ4jv4tuZoKb8/ntbJflC 5Gj3Jv7fbTnz1k/ygXqSf96cO3h5hHJeMcYr0eqxfubY/b84lgTTSf2MNDK+sQXG4bJkSC mYUbH0gtYcolMjeXj+T0S9pw6bU2YAz7aoTlyBCBrDiyQ+jaQr+ePY6QQPrF9w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1687289951; a=rsa-sha256; cv=none; b=ezhL4hZ2I7LBHlapdXm8JzKfZF7XlORPNxyk8Q2jo/LGVI4sCV7hdPwUby/7Ks9j6wJbL3 I8W1V8LuZN+a+RLLUnyLim2iNwu/5E9pob7Jt4c+cpIWsaFh7WjEUa0wy7GZmle4yfuxdu X3WAvFKYTyABpm/aHySmHSKAkxQ/H3apLwWgN6BOoaJpkq4k4y/acnS3G5gm929L6VBDMU smLvkYsK95JscmusxAo6kOnOpZPe8sqs4bc9Q3YTyt6iMcVKA9xlH+6FvA7pAUM0xT4dww mPAZHw2RuCUbvMFpxEYjJ0eXHlSJ0AVeFCBDAlrA/qEMDfdF53G/k8Gbz1PLaA== 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 4Qlxlf6Fjsz1BdC; Tue, 20 Jun 2023 19:39:10 +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 35KJdAKn058327; Tue, 20 Jun 2023 19:39:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 35KJdA7d058326; Tue, 20 Jun 2023 19:39:10 GMT (envelope-from git) Date: Tue, 20 Jun 2023 19:39:10 GMT Message-Id: <202306201939.35KJdA7d058326@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 8144db85fe76 - main - libpmc: Define a PMCLOG_SKIP32 helper macro to skip over a 32-bit field. 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8144db85fe76264bd9bf9b56133ac5b4d4020835 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=8144db85fe76264bd9bf9b56133ac5b4d4020835 commit 8144db85fe76264bd9bf9b56133ac5b4d4020835 Author: John Baldwin AuthorDate: 2023-06-20 19:31:43 +0000 Commit: John Baldwin CommitDate: 2023-06-20 19:31:43 +0000 libpmc: Define a PMCLOG_SKIP32 helper macro to skip over a 32-bit field. This replaces a set but unused noop variable with a more explicit macro. Reviewed by: jkoshy, mhorne Differential Revision: https://reviews.freebsd.org/D40651 --- lib/libpmc/pmclog.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/libpmc/pmclog.c b/lib/libpmc/pmclog.c index 92bcb1c2b161..00ab84057be2 100644 --- a/lib/libpmc/pmclog.c +++ b/lib/libpmc/pmclog.c @@ -82,6 +82,7 @@ __FBSDID("$FreeBSD$"); (* ((uint32_t *) &(PS)->ps_saved)) #define PMCLOG_INITIALIZE_READER(LE,A) LE = (uint32_t *) &(A) +#define PMCLOG_SKIP32(LE) (LE)++ #define PMCLOG_READ32(LE,V) do { \ (V) = *(LE)++; \ } while (0) @@ -257,7 +258,7 @@ pmclog_get_event(void *cookie, char **data, ssize_t *len, struct pmclog_ev *ev) { int evlen, pathlen; - uint32_t h, *le, npc, noop; + uint32_t h, *le, npc; enum pmclog_parser_state e; struct pmclog_parse_state *ps; struct pmclog_header *ph; @@ -340,13 +341,13 @@ pmclog_get_event(void *cookie, char **data, ssize_t *len, case PMCLOG_TYPE_MAP_IN: PMCLOG_GET_PATHLEN(pathlen,evlen,pmclog_map_in); PMCLOG_READ32(le,ev->pl_u.pl_mi.pl_pid); - PMCLOG_READ32(le,noop); + PMCLOG_SKIP32(le); PMCLOG_READADDR(le,ev->pl_u.pl_mi.pl_start); PMCLOG_READSTRING(le, ev->pl_u.pl_mi.pl_pathname, pathlen); break; case PMCLOG_TYPE_MAP_OUT: PMCLOG_READ32(le,ev->pl_u.pl_mo.pl_pid); - PMCLOG_READ32(le,noop); + PMCLOG_SKIP32(le); PMCLOG_READADDR(le,ev->pl_u.pl_mo.pl_start); PMCLOG_READADDR(le,ev->pl_u.pl_mo.pl_end); break; @@ -354,7 +355,7 @@ pmclog_get_event(void *cookie, char **data, ssize_t *len, PMCLOG_READ32(le,ev->pl_u.pl_a.pl_pmcid); PMCLOG_READ32(le,ev->pl_u.pl_a.pl_event); PMCLOG_READ32(le,ev->pl_u.pl_a.pl_flags); - PMCLOG_READ32(le,noop); + PMCLOG_SKIP32(le); PMCLOG_READ64(le,ev->pl_u.pl_a.pl_rate); /* @@ -385,7 +386,7 @@ pmclog_get_event(void *cookie, char **data, ssize_t *len, PMCLOG_READ32(le,ev->pl_u.pl_ad.pl_pmcid); PMCLOG_READ32(le,ev->pl_u.pl_ad.pl_event); PMCLOG_READ32(le,ev->pl_u.pl_ad.pl_flags); - PMCLOG_READ32(le,noop); + PMCLOG_SKIP32(le); PMCLOG_READSTRING(le,ev->pl_u.pl_ad.pl_evname,PMC_NAME_MAX); break; case PMCLOG_TYPE_PMCATTACH: @@ -431,7 +432,7 @@ pmclog_get_event(void *cookie, char **data, ssize_t *len, PMCLOG_READ32(le,ev->pl_u.pl_tc.pl_tid); PMCLOG_READ32(le,ev->pl_u.pl_tc.pl_pid); PMCLOG_READ32(le,ev->pl_u.pl_tc.pl_flags); - PMCLOG_READ32(le,noop); + PMCLOG_SKIP32(le); memcpy(ev->pl_u.pl_tc.pl_tdname, le, MAXCOMLEN+1); break; case PMCLOG_TYPE_THR_EXIT: