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 2A429A0544 for ; Fri, 23 Sep 2022 08:36:46 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 24BE6415D7; Fri, 23 Sep 2022 08:36:46 +0200 (CEST) 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 5F3094003C for ; Fri, 23 Sep 2022 08:36:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663915004; 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=LdaPIbLTn0pA/LWw+JiBU9e0KhnaveJVa5lpCa/uvMk=; b=JA25eWOePFl1yo0DOnCCD/7hX1np2wXg40kNiji9HRfF0N55BMtqBnkDNyQP3Z8/0ngkls mwfeS7zYg2KGh+I9OuCQxYetCU3oVUW4iYSuOWO4UMmw++vv8igEchn6Dx0sVvtSOpcCCR U1ERW+RiuQRGNS0+LG5rtd6qAx4nh3A= Received: from mail-lj1-f197.google.com (mail-lj1-f197.google.com [209.85.208.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-316-EGfcnW3XM06VDnfx6bn4hw-1; Fri, 23 Sep 2022 02:36:43 -0400 X-MC-Unique: EGfcnW3XM06VDnfx6bn4hw-1 Received: by mail-lj1-f197.google.com with SMTP id b34-20020a2ebc22000000b0026c273ba56dso3611350ljf.1 for ; Thu, 22 Sep 2022 23:36:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=LdaPIbLTn0pA/LWw+JiBU9e0KhnaveJVa5lpCa/uvMk=; b=BLn9RqdWJVVAOlo8SU3sFAVLgtu9FXg7a6D8+dk6OogQicZ4BnJOQZT2HNN4hbDHfn fCcgAhH9CWFCppOEMRFXDqd8aRNPKRQNQhp4Tv8V8uNT75J7kpPjPvuBBFY2jm1HCjjR Evy1wflsZCJ7WGLuOpB2JGTBrNG+Yk0M489PS1k5GDHLbb01sdmP4NsP6u3FqhLo6cQn GIosWS9+Gd5mZoEWYrOpxB/IAgcHM2CmRtLNSVkcw5rIP/QNeEKgWQ9G3drRP7Zv7CSw kItjOlQG/BFuD+3iMwlV4hrPS/qvDbCrZgxkvHn8Ip3rC3gxxwg7AJbssv/IKsJVFtZe aYvg== X-Gm-Message-State: ACrzQf1f6otqWknnKXqNGC0dOJSufQ+Ek0vIA0K9oi3LZpiIa4UVjmDU EVnQ+tedhquMPeH142Oy3y8vOR1LTUbnscrK214r5GqKKd73OVUoHlFccizEXPfvAeJIzvWHWZT W0USX7s5h6SggsbaynuT44+Q= X-Received: by 2002:a05:6512:694:b0:498:ff40:24e with SMTP id t20-20020a056512069400b00498ff40024emr2439914lfe.265.1663915002119; Thu, 22 Sep 2022 23:36:42 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6y/eytCAUheatMun3cd+FidXzeVF8i7yT/xOBpLZby2NLv3WVDIu8yoqZVrxhv51NhInZgWJisu2PTqq74ZzU= X-Received: by 2002:a05:6512:694:b0:498:ff40:24e with SMTP id t20-20020a056512069400b00498ff40024emr2439908lfe.265.1663915001879; Thu, 22 Sep 2022 23:36:41 -0700 (PDT) MIME-Version: 1.0 References: <20220921120359.2201131-1-david.marchand@redhat.com> <20220921120359.2201131-5-david.marchand@redhat.com> In-Reply-To: From: David Marchand Date: Fri, 23 Sep 2022 08:36:30 +0200 Message-ID: Subject: Re: [EXT] [PATCH 4/8] trace: fix dynamically enabling trace points To: Sunil Kumar Kori Cc: "dev@dpdk.org" , "stable@dpdk.org" , Jerin Jacob Kollanukkaran X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org On Thu, Sep 22, 2022 at 1:18 PM Sunil Kumar Kori wrote: > > int > > -rte_trace_point_disable(rte_trace_point_t *trace) > > +rte_trace_point_disable(rte_trace_point_t *t) > > { > > - if (trace_point_is_invalid(trace)) > > + uint64_t prev; > > + > > + if (trace_point_is_invalid(t)) > > return -ERANGE; > > > > - __atomic_and_fetch(trace, ~__RTE_TRACE_FIELD_ENABLE_MASK, > > - __ATOMIC_RELEASE); > > + prev = __atomic_fetch_and(t, ~__RTE_TRACE_FIELD_ENABLE_MASK, > > __ATOMIC_RELEASE); > > + if ((prev & __RTE_TRACE_FIELD_ENABLE_MASK) != 0) > > + __atomic_sub_fetch(&trace.status, 1, __ATOMIC_RELEASE); > > return 0; > > } > > > IMO, above change should go as a separate commit as it just replaces the variable name. The count of enabled tracepoints (stored in the 'trace' global variable) must be updated as part of the change. So the renaming is necessary. [snip] > > @@ -375,6 +380,10 @@ trace_meta_save(struct trace *trace) > > FILE *f; > > int rc; > > > > + rc = trace_mkdir(); > > + if (rc < 0) > > + return rc; > > + > > Trace directory is being created here and in trace_mem_save() function along with the logic to handle whether it is already done or not. > Instead can't it be called in rte_trace_save() directly. That will suffice the intention, I believe. Oh indeed, I had the false impression that there were other path than rte_trace_save(), leading to trace_mkdir(). Will fix. -- David Marchand