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 61F9AA04EF; Wed, 3 Jun 2020 05:29:23 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 87B5F1D14E; Wed, 3 Jun 2020 05:29:22 +0200 (CEST) Received: from mail-io1-f68.google.com (mail-io1-f68.google.com [209.85.166.68]) by dpdk.org (Postfix) with ESMTP id 808F91D14C for ; Wed, 3 Jun 2020 05:29:20 +0200 (CEST) Received: by mail-io1-f68.google.com with SMTP id d5so641189ios.9 for ; Tue, 02 Jun 2020 20:29:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=PSOoJTFgvuGcPSmhNRBBCqAEH49948nz2x6EMKUX62M=; b=jtLexWedQI+CcFrCVNw2GP7Sj+N1ba6wqFEDNyBcLsosbX6y48Bmnt6hyfhofhxg2T 1gar3jh83aTwjDSlyLJFjrB5kvq2XWXEOhRY9MaQLgFzoX1bahrYKH/5wJ4yw8GU3m3W RBRy0zrjVoeCc3CH76KyDg/T2kLT+Q4f/U/OMjL0ZE4lDmv2K7x2oYzSzSDXjjaLJdxL S3cKtjEClRMU7WtqZF42PVFAEv76zrlnO1JjtOJhMMtq2TiPGzQcLLJJuVDNgcSPo8Xb 0R6tFxMC/BP0ib0CtY13NkPBLyO2yro0DeQ1HDB/iDBszw0bHrI542hgImJ76uIY8vyz SdMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=PSOoJTFgvuGcPSmhNRBBCqAEH49948nz2x6EMKUX62M=; b=lCJE9JRzGPC3XRzlZ00bbcN8a+yd+7OMoi/C1giOUrotwsiwn6PA0eqzJZBP3Cxnuc LLFfNfJCn4lsyA8Rlj66vSrbuAFC8LapbaMUiXcvHAio9gT0V1pgNALQNjXYOdex2cI8 PSxgjJDpf2C5Cx0BKuE6NjmzBmoOeWLLuzsx668ibz/DixclTlnIhpf86F3Haks25O57 LrXfqBrfbX73jAVoO/JCo26W3UultCTKmcZjrfxawTEOssiEfukxiIgqelWyScTeWPYM 3RLd349cQXZj5hahclyBrz4801AYOYiwc8XI/x7RxIqDtgC9e2qhhLnnP0W2a0Z9y0jD d6oQ== X-Gm-Message-State: AOAM533Euacep2M1phjq/c2jlI2Z92lNM14qsSDfKj3233GGL0wEX3cs d70/BvTslZzoRzbr/q4aXOHuXnaMhSXMQ1Cn0Jg= X-Google-Smtp-Source: ABdhPJzr2Co4w1I832FaViwXC4jMaiYCMYeGEE35IMIR7ASKcLkJpXoU9AbHiVQT+YzL7ZC1G9PZO1BE38YFhWVWcwE= X-Received: by 2002:a5e:c64a:: with SMTP id s10mr2007167ioo.1.1591154959414; Tue, 02 Jun 2020 20:29:19 -0700 (PDT) MIME-Version: 1.0 References: <20200525003720.6410-1-dmitry.kozliuk@gmail.com> <20200602230329.17838-1-dmitry.kozliuk@gmail.com> <20200602230329.17838-7-dmitry.kozliuk@gmail.com> In-Reply-To: <20200602230329.17838-7-dmitry.kozliuk@gmail.com> From: Jerin Jacob Date: Wed, 3 Jun 2020 08:59:03 +0530 Message-ID: To: Dmitry Kozlyuk Cc: dpdk-dev , Dmitry Malloy , Narcisa Ana Maria Vasile , Fady Bader , Tal Shnaiderman , Jerin Jacob , Sunil Kumar Kori , Olivier Matz , Andrew Rybchenko Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v6 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" On Wed, Jun 3, 2020 at 4:35 AM Dmitry Kozlyuk wrote: > > 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 Reviewed-by: Jerin Jacob > --- > lib/librte_eal/include/rte_eal_trace.h | 8 ++++---- > lib/librte_eal/include/rte_trace_point.h | 3 +++ > lib/librte_mempool/rte_mempool_trace.h | 10 +++++----- > 3 files changed, 12 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..377c2414a 100644 > --- a/lib/librte_eal/include/rte_trace_point.h > +++ b/lib/librte_eal/include/rte_trace_point.h > @@ -138,6 +138,8 @@ _tp _args \ > #define rte_trace_point_emit_int(val) > /** Tracepoint function payload for long datatype */ > #define rte_trace_point_emit_long(val) > +/** Tracepoint function payload for size_t datatype */ > +#define rte_trace_point_emit_size_t(val) > /** Tracepoint function payload for float datatype */ > #define rte_trace_point_emit_float(val) > /** Tracepoint function payload for double datatype */ > @@ -395,6 +397,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 >