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 AD172A0588; Thu, 16 Apr 2020 15:40:40 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 97CCF1DCE5; Thu, 16 Apr 2020 15:40:40 +0200 (CEST) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by dpdk.org (Postfix) with ESMTP id 27ED91DCE0 for ; Thu, 16 Apr 2020 15:40:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587044438; 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=NokdybV1ag/y8mcOwBBjI/TRzG/hjm9BoSICSz1hhaE=; b=JiUtIJT56FVfM8t5pFXJYV0Y0tJPFScOOYLOSI2amZSV0mxQPXV7npxR7/8uP6sXvGfiQu Runl0OQ9R4imMRfB9OH16uKtOR6D0ic9P21d1/6PPXjPFAViwgSsiHr469mWpYWkuD3ESi 1h9altxae1tdJ5b1A4iJiTGoclWpSJE= Received: from mail-vk1-f200.google.com (mail-vk1-f200.google.com [209.85.221.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-504-WGPrZHwvPseK3A5irP_hXA-1; Thu, 16 Apr 2020 09:40:37 -0400 X-MC-Unique: WGPrZHwvPseK3A5irP_hXA-1 Received: by mail-vk1-f200.google.com with SMTP id s62so3240481vks.7 for ; Thu, 16 Apr 2020 06:40:37 -0700 (PDT) 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=K7CivOZKGv5BeRnxkUqzFAi/C7PLaiS0mwjzD0Sj/G8=; b=sOg7a/ucAG1E4b5BKLlsBow2Onil2FNziM7aSbP77RiDPA9wtxhQeYTTn/tpUX2Ole Kht1vdqhwFnY9GoUVmdAY41AHo5J+EUZriG16W8l7GxtNdO0DMc+gpa3rf3sG1uEAQOG Wjtf9ImsrvCb+edvHGUQLlSCZlqMEpiUwfS+S+tZ7Rp/zxY8WEloAlF4xBzFaHRQ+2Z6 jGvF+d+73tjXnFxzPxXB1h3iMxc9HBsTTgAAEARm1UPfWp6g2o/BnCaPvo2PRq/o51UE P1rIn/8Yh5mMQPvxkJnipIh/CxyAkrdo8AiuXYHWubNKs1XRiobruwYcp7leJmC1ht2+ pZig== X-Gm-Message-State: AGi0PuaWsMjV91EUCOlQMru4IurXjYX7/cD9QveSlQobwRFCLuXXkrEm rxDlI7mMxD2xt+GyVicNOwi7OEC8NTrm3Q7+B627mqNIGyUxRo6EkE/XilmRJkD5i1MOUFyzZaM XHzwdEoM6vdtpi8+3iz4= X-Received: by 2002:a1f:aa4f:: with SMTP id t76mr23001234vke.18.1587044436897; Thu, 16 Apr 2020 06:40:36 -0700 (PDT) X-Google-Smtp-Source: APiQypIoWON3PcUtZpzdB4HN6ePDlO6pJ6Afum3QL+KUUUOpBcYwZnlOHHGFjKGeP++10AU6F0ytda43l1cwLlihjWY= X-Received: by 2002:a1f:aa4f:: with SMTP id t76mr23001210vke.18.1587044436581; Thu, 16 Apr 2020 06:40:36 -0700 (PDT) MIME-Version: 1.0 References: <20200403153709.3703448-1-jerinj@marvell.com> <20200413150116.734047-1-jerinj@marvell.com> <20200413150116.734047-14-jerinj@marvell.com> In-Reply-To: <20200413150116.734047-14-jerinj@marvell.com> From: David Marchand Date: Thu, 16 Apr 2020 15:40:24 +0200 Message-ID: To: Jerin Jacob Kollanukkaran Cc: Sunil Kumar Kori , dev , Thomas Monjalon , Bruce Richardson , =?UTF-8?Q?Mattias_R=C3=B6nnblom?= X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [dpdk-dev] [PATCH v5 13/33] eal/trace: implement registration payload 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 Mon, Apr 13, 2020 at 5:02 PM wrote: > diff --git a/lib/librte_eal/common/eal_common_trace.c b/lib/librte_eal/co= mmon/eal_common_trace.c > index 8181c0f02..906e2d706 100644 > --- a/lib/librte_eal/common/eal_common_trace.c > +++ b/lib/librte_eal/common/eal_common_trace.c > @@ -403,6 +403,25 @@ trace_mem_per_thread_free(void) > rte_spinlock_unlock(&trace->lock); > } > > +void > +__rte_trace_emit_ctf_field(size_t sz, const char *in, const char *dataty= pe) > +{ > + char *field =3D RTE_PER_LCORE(ctf_field); > + int count =3D RTE_PER_LCORE(ctf_count); > + int rc; > + > + RTE_PER_LCORE(trace_point_sz) +=3D sz; > + rc =3D snprintf(RTE_PTR_ADD(field, count), > + RTE_MAX(0, TRACE_CTF_FIELD_SIZE - 1 - count), > + "%s %s;", datatype, in); rc <=3D 0 does not check if a truncation happened. > + if (rc <=3D 0) { > + RTE_PER_LCORE(trace_point_sz) =3D 0; > + trace_crit("CTF field is too long"); > + return; > + } > + RTE_PER_LCORE(ctf_count) +=3D rc; > +} > + > int > __rte_trace_point_register(rte_trace_t *handle, const char *name, > void (*register_fn)(void)) --=20 David Marchand