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 3E4C2A04DD; Thu, 29 Oct 2020 11:03:06 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 84C92C902; Thu, 29 Oct 2020 11:03:04 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by dpdk.org (Postfix) with ESMTP id 95FDEC900 for ; Thu, 29 Oct 2020 11:03:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603965780; 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: in-reply-to:in-reply-to:references:references; bh=zr5R0CTsnGxrBltPTx2ggyCgrnmnK2LJU/X/oiHc4P8=; b=bIWXCgx8usDO48xI3Aizv4fEO4dI2rgCbCInyS065C8KCaAlT/z+MK1MEv7EsZdA2mcMj0 wOXB9d+Dd4aPSPJ7xp7RYNShLppfjFbM8gnn2rt2yWXUpuBzVP5S2GOcj4YtXWe5kPpxY2 rEcP8m16P/urc6kpJPqMcvnTP/x1wTo= Received: from mail-vs1-f70.google.com (mail-vs1-f70.google.com [209.85.217.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-6-gj82Vq2EPiqmCudBJHXd4Q-1; Thu, 29 Oct 2020 06:02:55 -0400 X-MC-Unique: gj82Vq2EPiqmCudBJHXd4Q-1 Received: by mail-vs1-f70.google.com with SMTP id n14so476920vso.10 for ; Thu, 29 Oct 2020 03:02:55 -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=zr5R0CTsnGxrBltPTx2ggyCgrnmnK2LJU/X/oiHc4P8=; b=UKNeqXfjFNwhqKTmlUk7787HXyqN+1lpniXOI/DXsQKJmAaAdR5glAuSOEjEFBvrgG ICrpnIkGX2Y4uoW5cDnoYPX2+slcHckQTJfUwDaD5eRjGuhTmW4HdmkTCjMnDTVbRYuv 1nvxzPWd+DYcKZJA+f7k0iA+7e1sKyXGMFvQuHe76Xk8GuFghACx41IXn3VkkpS8dAe9 uhVqcJuJaoQyroS/8MSBD5JoH4+7YBz4K1bvQ0AHRTwye3K2CaTeMcPMz8OC8T6kPkYC OrhigOEifahEVHxglIV+t8WKF5/qHga58itf+lyxQzWI3P2ApkndDUekQC7UwfXwD6zz vsYg== X-Gm-Message-State: AOAM533dc4pucF+qPH4ss0ndBsaZIlsuX2Mi26o7tuYaYbnIiDK6SVwG dPaCNYymHCFOd5z7jfEvTvEkdYXpnCvE+l9ZLOVeu3qy7/BaeZD3s11CLHuwM3SOXSQmLmjta7b UfDzuPdDq6LQ5e/jPplE= X-Received: by 2002:a1f:9004:: with SMTP id s4mr2446937vkd.22.1603965774747; Thu, 29 Oct 2020 03:02:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw7dnvQcjttVQ7rKPwEe3VAYYTWfFtTnkmPXa6YsNrlPy46AAxQ6PsyVzSCzhVn8ge3S9Qz3ZtdA6pBFLpL+aU= X-Received: by 2002:a1f:9004:: with SMTP id s4mr2446928vkd.22.1603965774535; Thu, 29 Oct 2020 03:02:54 -0700 (PDT) MIME-Version: 1.0 References: <20201023080058.13335-1-david.marchand@redhat.com> <20201028210249.9021-1-david.marchand@redhat.com> <20201028210249.9021-3-david.marchand@redhat.com> In-Reply-To: From: David Marchand Date: Thu, 29 Oct 2020 11:02:43 +0100 Message-ID: To: Sunil Kumar Kori Cc: "dev@dpdk.org" , Jerin Jacob Kollanukkaran Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [EXT] [PATCH v2 2/4] trace: remove size limit on CTF event description 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 Thu, Oct 29, 2020 at 10:36 AM Sunil Kumar Kori wrote: > Yes but I am not able to understand that how tp->ctf_field will be populated with latest memory > because RTE_PER_LCORE(ctf_field) is being free and re-allocated at runtime. Initially, RTE_PER_LCORE(ctf_field) is NULL. Then registration for a trace point happens: __rte_trace_point_register() calls register_fn() which for each field in the trace point calls __rte_trace_point_emit_field(). Each call to __rte_trace_point_emit_field accumulates the previous ctf_field with the new field. rc = asprintf(&field, "%s %s %s;\n", RTE_PER_LCORE(ctf_field) != NULL ? RTE_PER_LCORE(ctf_field) : "", datatype, in); free(RTE_PER_LCORE(ctf_field)); RTE_PER_LCORE(ctf_field) = field; Here, RTE_PER_LCORE(ctf_field) is != NULL. Back to __rte_trace_point_register: /* Copy the accumulated fields description and clear it for the next * trace point. */ tp->ctf_field = RTE_PER_LCORE(ctf_field); Once stored, RTE_PER_LCORE(ctf_field) is cleared again for the next trace point registration. RTE_PER_LCORE(ctf_field) = NULL; -- David Marchand