From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 35662A04EF; Mon, 25 May 2020 02:38:36 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E3A6A1D63E; Mon, 25 May 2020 02:37:50 +0200 (CEST) Received: from mail-lj1-f193.google.com (mail-lj1-f193.google.com [209.85.208.193]) by dpdk.org (Postfix) with ESMTP id A7C5E1D614 for ; Mon, 25 May 2020 02:37:44 +0200 (CEST) Received: by mail-lj1-f193.google.com with SMTP id z13so9283343ljn.7 for ; Sun, 24 May 2020 17:37:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=vpr1NPj6BLPSWqATNCUlc2z8Nn/C0I0bFtyLdMgF4xI=; b=CwciCgwS8siozwuQYEvcETZcGm7kVlyODm8TJktnXcqpoVSx2Tv5k30g1VXdsAtEBj cxxgIj9B4zrMKGzX8LrmKi59wTEGJEqOEkVfyz0V+oHi9PCNGDg7mF8eW9oPIufHw9Qe TsOmcAzjoOglpNqDmR39g68gQIxCdM2d/SZaxD3e0Hfi11eEHdtSHkMMd5wPpGJZrGoT wYu5VgqoccTfkv36UjTmF46MSfrCla7wfwlDlmq3TwQwne+f4ItbgKn1bFxsBiPm6Tr0 v8a48mBgDrhUAlawqfLdzIK28doU1i3Bk2s90lsIDStoMJhlCkpzRBfGOjtHp44c6wPY nJvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=vpr1NPj6BLPSWqATNCUlc2z8Nn/C0I0bFtyLdMgF4xI=; b=UNeUY8mTsotnbXkx865J6noI1H9ubqDeiog4tLtAsSeNYYplgNTLk09WIonpvvgS4z AvANDFG5ks8JXMyYiTWa/Tbsl/r9c7FfvBQv0iy23CB1p/d1cFV6ipYUwGvzQ7A/ULQj e8lXNmYlm6Ujl/YlwQTghFi2CX5VaSgq0ieWQitl5ECO6f1j+vDhR8EIMjepXE40RMzC cprNqQOTdYvmcj5sqvHZCtw4WVl11yIRZIu6SchS9gZx69K92BJtLWgCpG/i/4bfdFNt pZMwvir6jsr+ByZLyRLWr7SzDzI5dqb4UAH3XwH677wudo77UM9mceI6KCwqFGyC3COL 1O5A== X-Gm-Message-State: AOAM533CkYLUJYW2chqgTxTTVW4QWxb7pDp9jGfFRfJo7LqzWXcFNBnY JJurBI3St33yY9unIq2E85uHn917dTuyCQ== X-Google-Smtp-Source: ABdhPJxWKuN6ieiXmkSXFARv1Kh9lGkeE2LO90eyrfA27EehplZq0p2BTbmgSyoFfcXiR4CkAKE05w== X-Received: by 2002:a2e:a58a:: with SMTP id m10mr11021463ljp.347.1590367064088; Sun, 24 May 2020 17:37:44 -0700 (PDT) Received: from localhost.localdomain (broadband-37-110-65-23.ip.moscow.rt.ru. [37.110.65.23]) by smtp.gmail.com with ESMTPSA id n8sm4279526lfb.20.2020.05.24.17.37.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 May 2020 17:37:43 -0700 (PDT) From: Dmitry Kozlyuk To: dev@dpdk.org Cc: Dmitry Malloy , Narcisa Ana Maria Vasile , Fady Bader , Tal Shnaiderman , Dmitry Kozlyuk , Jerin Jacob , Sunil Kumar Kori , Olivier Matz , Andrew Rybchenko Date: Mon, 25 May 2020 03:37:15 +0300 Message-Id: <20200525003720.6410-7-dmitry.kozliuk@gmail.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20200525003720.6410-1-dmitry.kozliuk@gmail.com> References: <20200428235015.2820677-1-dmitry.kozliuk@gmail.com> <20200525003720.6410-1-dmitry.kozliuk@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v5 06/11] trace: add size_t field emitter X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" It is not guaranteed that sizeof(long) == sizeof(size_t). On Windows, sizeof(long) == 4 and sizeof(size_t) == 8 for 64-bit programs. Tracepoints using "long" field emitter are therefore invalid there. Add dedicated field emitter for size_t and use it to store size_t values in all existing tracepoints. Signed-off-by: Dmitry Kozlyuk --- lib/librte_eal/include/rte_eal_trace.h | 8 ++++---- lib/librte_eal/include/rte_trace_point.h | 1 + lib/librte_mempool/rte_mempool_trace.h | 10 +++++----- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/lib/librte_eal/include/rte_eal_trace.h b/lib/librte_eal/include/rte_eal_trace.h index 1ebb2905a..bcfef0cfa 100644 --- a/lib/librte_eal/include/rte_eal_trace.h +++ b/lib/librte_eal/include/rte_eal_trace.h @@ -143,7 +143,7 @@ RTE_TRACE_POINT( RTE_TRACE_POINT_ARGS(const char *type, size_t size, unsigned int align, int socket, void *ptr), rte_trace_point_emit_string(type); - rte_trace_point_emit_long(size); + rte_trace_point_emit_size_t(size); rte_trace_point_emit_u32(align); rte_trace_point_emit_int(socket); rte_trace_point_emit_ptr(ptr); @@ -154,7 +154,7 @@ RTE_TRACE_POINT( RTE_TRACE_POINT_ARGS(const char *type, size_t size, unsigned int align, int socket, void *ptr), rte_trace_point_emit_string(type); - rte_trace_point_emit_long(size); + rte_trace_point_emit_size_t(size); rte_trace_point_emit_u32(align); rte_trace_point_emit_int(socket); rte_trace_point_emit_ptr(ptr); @@ -164,7 +164,7 @@ RTE_TRACE_POINT( rte_eal_trace_mem_realloc, RTE_TRACE_POINT_ARGS(size_t size, unsigned int align, int socket, void *ptr), - rte_trace_point_emit_long(size); + rte_trace_point_emit_size_t(size); rte_trace_point_emit_u32(align); rte_trace_point_emit_int(socket); rte_trace_point_emit_ptr(ptr); @@ -183,7 +183,7 @@ RTE_TRACE_POINT( unsigned int flags, unsigned int align, unsigned int bound, const void *mz), rte_trace_point_emit_string(name); - rte_trace_point_emit_long(len); + rte_trace_point_emit_size_t(len); rte_trace_point_emit_int(socket_id); rte_trace_point_emit_u32(flags); rte_trace_point_emit_u32(align); diff --git a/lib/librte_eal/include/rte_trace_point.h b/lib/librte_eal/include/rte_trace_point.h index b45171275..3b513bd43 100644 --- a/lib/librte_eal/include/rte_trace_point.h +++ b/lib/librte_eal/include/rte_trace_point.h @@ -395,6 +395,7 @@ do { \ #define rte_trace_point_emit_i8(in) __rte_trace_point_emit(in, int8_t) #define rte_trace_point_emit_int(in) __rte_trace_point_emit(in, int32_t) #define rte_trace_point_emit_long(in) __rte_trace_point_emit(in, long) +#define rte_trace_point_emit_size_t(in) __rte_trace_point_emit(in, size_t) #define rte_trace_point_emit_float(in) __rte_trace_point_emit(in, float) #define rte_trace_point_emit_double(in) __rte_trace_point_emit(in, double) #define rte_trace_point_emit_ptr(in) __rte_trace_point_emit(in, uintptr_t) diff --git a/lib/librte_mempool/rte_mempool_trace.h b/lib/librte_mempool/rte_mempool_trace.h index e776df0a6..087c913c8 100644 --- a/lib/librte_mempool/rte_mempool_trace.h +++ b/lib/librte_mempool/rte_mempool_trace.h @@ -72,7 +72,7 @@ RTE_TRACE_POINT( rte_trace_point_emit_string(mempool->name); rte_trace_point_emit_ptr(vaddr); rte_trace_point_emit_u64(iova); - rte_trace_point_emit_long(len); + rte_trace_point_emit_size_t(len); rte_trace_point_emit_ptr(free_cb); rte_trace_point_emit_ptr(opaque); ) @@ -84,8 +84,8 @@ RTE_TRACE_POINT( rte_trace_point_emit_ptr(mempool); rte_trace_point_emit_string(mempool->name); rte_trace_point_emit_ptr(addr); - rte_trace_point_emit_long(len); - rte_trace_point_emit_long(pg_sz); + rte_trace_point_emit_size_t(len); + rte_trace_point_emit_size_t(pg_sz); rte_trace_point_emit_ptr(free_cb); rte_trace_point_emit_ptr(opaque); ) @@ -126,7 +126,7 @@ RTE_TRACE_POINT( RTE_TRACE_POINT_ARGS(struct rte_mempool *mempool, size_t pg_sz), rte_trace_point_emit_ptr(mempool); rte_trace_point_emit_string(mempool->name); - rte_trace_point_emit_long(pg_sz); + rte_trace_point_emit_size_t(pg_sz); ) RTE_TRACE_POINT( @@ -139,7 +139,7 @@ RTE_TRACE_POINT( rte_trace_point_emit_u32(max_objs); rte_trace_point_emit_ptr(vaddr); rte_trace_point_emit_u64(iova); - rte_trace_point_emit_long(len); + rte_trace_point_emit_size_t(len); rte_trace_point_emit_ptr(obj_cb); rte_trace_point_emit_ptr(obj_cb_arg); ) -- 2.25.4