From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2D5974614E; Thu, 30 Jan 2025 15:59:15 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4B5A740A89; Thu, 30 Jan 2025 15:59:11 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id A039A40A72 for ; Thu, 30 Jan 2025 15:59:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738249149; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PBZii+sOF9qvxHtXeLLhoVhEfjyyzQAMa8oWXpaQof0=; b=dUCrmc1/RQ9dBpUtUpVXxF/4eDD9jzBvzTAt8CvUVAwnryjZFbvURFEM6iSSflaFRhNRQE 9+xSWn+OiVQQBHtWTE2NcDMIR5nRERG3RY0kcCy53xGstmHbNPq6I2Cgu2UxP3UneSi9NB kh9evEYFt71iUpy/jWySzoG6eSrvvTo= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-202-cbqxZXgKNTev3SI3LOv4sQ-1; Thu, 30 Jan 2025 09:59:05 -0500 X-MC-Unique: cbqxZXgKNTev3SI3LOv4sQ-1 X-Mimecast-MFC-AGG-ID: cbqxZXgKNTev3SI3LOv4sQ Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1E3F719560AA; Thu, 30 Jan 2025 14:59:04 +0000 (UTC) Received: from dmarchan.com (unknown [10.45.225.14]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 4DC0B19560A3; Thu, 30 Jan 2025 14:59:02 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: Chengwen Feng , Kevin Laatz , Bruce Richardson Subject: [PATCH v2 2/3] dmadev: avoid copies in tracepoints Date: Thu, 30 Jan 2025 15:58:48 +0100 Message-ID: <20250130145849.82003-2-david.marchand@redhat.com> In-Reply-To: <20250130145849.82003-1-david.marchand@redhat.com> References: <20250124161408.310581-1-david.marchand@redhat.com> <20250130145849.82003-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: OSQ7zaizDisZcgDJG78KfrwJU1fZ0L5ixokbr547kXk_1738249144 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org No need to copy values in intermediate variables. Just use the right trace point emitters. Signed-off-by: David Marchand --- lib/dmadev/rte_dmadev_trace.h | 20 ++++++-------------- lib/dmadev/rte_dmadev_trace_fp.h | 12 ++++-------- 2 files changed, 10 insertions(+), 22 deletions(-) diff --git a/lib/dmadev/rte_dmadev_trace.h b/lib/dmadev/rte_dmadev_trace.h index be089c065c..ddf60b9649 100644 --- a/lib/dmadev/rte_dmadev_trace.h +++ b/lib/dmadev/rte_dmadev_trace.h @@ -46,11 +46,10 @@ RTE_TRACE_POINT( const struct rte_dma_conf __dev_conf = {0}; dev_conf = &__dev_conf; #endif /* _RTE_TRACE_POINT_REGISTER_H_ */ - int enable_silent = (int)dev_conf->enable_silent; rte_trace_point_emit_i16(dev_id); rte_trace_point_emit_u16(dev_conf->nb_vchans); rte_trace_point_emit_u16(dev_conf->priority); - rte_trace_point_emit_int(enable_silent); + rte_trace_point_emit_u8(dev_conf->enable_silent); rte_trace_point_emit_int(ret); ) @@ -83,21 +82,14 @@ RTE_TRACE_POINT( const struct rte_dma_vchan_conf __conf = {0}; conf = &__conf; #endif /* _RTE_TRACE_POINT_REGISTER_H_ */ - int src_port_type = conf->src_port.port_type; - int dst_port_type = conf->dst_port.port_type; - int direction = conf->direction; - uint64_t src_pcie_cfg; - uint64_t dst_pcie_cfg; rte_trace_point_emit_i16(dev_id); rte_trace_point_emit_u16(vchan); - rte_trace_point_emit_int(direction); + rte_trace_point_emit_int(conf->direction); rte_trace_point_emit_u16(conf->nb_desc); - rte_trace_point_emit_int(src_port_type); - memcpy(&src_pcie_cfg, &conf->src_port.pcie, sizeof(uint64_t)); - rte_trace_point_emit_u64(src_pcie_cfg); - memcpy(&dst_pcie_cfg, &conf->dst_port.pcie, sizeof(uint64_t)); - rte_trace_point_emit_int(dst_port_type); - rte_trace_point_emit_u64(dst_pcie_cfg); + rte_trace_point_emit_int(conf->src_port.port_type); + rte_trace_point_emit_blob(&conf->src_port.pcie, sizeof(uint64_t)); + rte_trace_point_emit_int(conf->dst_port.port_type); + rte_trace_point_emit_blob(&conf->dst_port.pcie, sizeof(uint64_t)); rte_trace_point_emit_ptr(conf->auto_free.m2d.pool); rte_trace_point_emit_int(ret); ) diff --git a/lib/dmadev/rte_dmadev_trace_fp.h b/lib/dmadev/rte_dmadev_trace_fp.h index f5b96838bc..4950f58cd2 100644 --- a/lib/dmadev/rte_dmadev_trace_fp.h +++ b/lib/dmadev/rte_dmadev_trace_fp.h @@ -37,10 +37,9 @@ RTE_TRACE_POINT_FP( enum rte_dma_vchan_status __status = 0; status = &__status; #endif /* _RTE_TRACE_POINT_REGISTER_H_ */ - int vchan_status = *status; rte_trace_point_emit_i16(dev_id); rte_trace_point_emit_u16(vchan); - rte_trace_point_emit_int(vchan_status); + rte_trace_point_emit_int(*status); rte_trace_point_emit_int(ret); ) @@ -107,13 +106,11 @@ RTE_TRACE_POINT_FP( last_idx = &__last_idx; has_error = &__has_error; #endif /* _RTE_TRACE_POINT_REGISTER_H_ */ - int has_error_val = *has_error; - int last_idx_val = *last_idx; rte_trace_point_emit_i16(dev_id); rte_trace_point_emit_u16(vchan); rte_trace_point_emit_u16(nb_cpls); - rte_trace_point_emit_int(last_idx_val); - rte_trace_point_emit_int(has_error_val); + rte_trace_point_emit_u16(*last_idx); + rte_trace_point_emit_u8(*has_error); rte_trace_point_emit_u16(ret); ) @@ -126,11 +123,10 @@ RTE_TRACE_POINT_FP( uint16_t __last_idx = 0; last_idx = &__last_idx; #endif /* _RTE_TRACE_POINT_REGISTER_H_ */ - int last_idx_val = *last_idx; rte_trace_point_emit_i16(dev_id); rte_trace_point_emit_u16(vchan); rte_trace_point_emit_u16(nb_cpls); - rte_trace_point_emit_int(last_idx_val); + rte_trace_point_emit_u16(*last_idx); rte_trace_point_emit_ptr(status); rte_trace_point_emit_u16(ret); ) -- 2.48.1