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 4F246A0544; 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 4608B427F0; 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 6C5DE415D7 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=1663915005; 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=Efj9saNkj+y2czAR7EmgTriHv9vsjXBLPO0TBnz4JvnSh3bwtLXZL3xZKLcvNtQd40FkFh Jk/0Oac/OS7eo/MyGKvs8cOu1cWVg9y2s1SvSvqtAHFhXYx9AIV5R6GpIehSwZCztQKq2U F269G88PEXt5ZnamY4ItIf2/DOG1q2s= Received: from mail-lf1-f71.google.com (mail-lf1-f71.google.com [209.85.167.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-584-K_I-tBs1MSuMVRbScdk9AA-1; Fri, 23 Sep 2022 02:36:43 -0400 X-MC-Unique: K_I-tBs1MSuMVRbScdk9AA-1 Received: by mail-lf1-f71.google.com with SMTP id n20-20020a056512311400b004a04493273fso634793lfb.18 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=BN2lmNe6TY8elGBoxVw9kdAS3P+nIL5WmwAi3gvtSdT4UgpHhTZMzmc6KaGScVyyw2 ZN6b9irc8qx8OW9n1pYV/EnU1P+nd0hKz94N27GrPnKcFRuk+XOQ1zdnoKtDarKL0NIL v+qsKj+i7zaLJUBHsh2D/MUZ0pE7x2368bbM5Nk8iFjxuH7z3Fjg8qC14/JF1hiwlvOW 1k6IRtNLWbrfGp8PPF/WthDRVatOiR404Tr7X7YS/1g6s2KSq5NT4cPkxrs0RKniqqF4 oWDwBzgJTkLWShp/dPzenv9p++JjBy08hxvNPmbH85Gi9WZLNV4BplDVbIU5y6bpFTe3 3OzQ== X-Gm-Message-State: ACrzQf1GYA3cMYKKNyoVlq38ZbImUBOB5zDn/RqV/XkO6v5hMDUt8cgw zdfw9mC+zklXx7KUU+sNtLHespeGb1X0zfwTpHCkzXTYoOco8QtQRgMera5HdVcuoD0xDfZiDqj Zk825Eovc7ijADlmP57o= X-Received: by 2002:a05:6512:694:b0:498:ff40:24e with SMTP id t20-20020a056512069400b00498ff40024emr2439913lfe.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: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-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