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 3B4EEA0577; Mon, 6 Apr 2020 20:17:22 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 73D622BE9; Mon, 6 Apr 2020 20:17:21 +0200 (CEST) Received: from mail-lj1-f196.google.com (mail-lj1-f196.google.com [209.85.208.196]) by dpdk.org (Postfix) with ESMTP id E183FF12 for ; Mon, 6 Apr 2020 20:17:19 +0200 (CEST) Received: by mail-lj1-f196.google.com with SMTP id q19so716943ljp.9 for ; Mon, 06 Apr 2020 11:17:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=20vJb/20vVEmT3/mF8pg4crZuV3AastftwPv5hDgXlo=; b=g0xY54KATvWqb/9EVblbcvtUtW5AHwpSq9uDt3G/2KHjayKSsT7CM78ShUiJzOTUK1 w1tEr9e1M1LSPAojAgzPi7hyn7V5iVFdXtCfv/h6w9eFx/v6KeeMVjBSTods8WozunjO gb9sVwvXxLF2Ra13NwsdUWh/RbM2cxf+DKnz2zKXQq1uXZQpG1Zg9/NsTeCLMuIlMIQC aA1OvndQvDlvqYNM8vjsl0IlEeR8RGwqLzUPZUOAX+2pWRAn0dFm0AUxhTUXjbcxqmp7 QgeLdGSe8oa7hwa6QM4yRDAbm0GC8lZsfHANgfEGNg0Ck4gc5t+/WjMl6hr4Rko246dv DR+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=20vJb/20vVEmT3/mF8pg4crZuV3AastftwPv5hDgXlo=; b=PdvZyvNsAGjATr3Tv3fi5LwcELh1Ab+3xWgHPJX77mBTQl2iuI7ldV4IoTRqf3mXC9 66+m5ghDkJe+CS0DwY51uUh4u7RyCKsLRt3WoGYvnCOmBQEmyga8EnF/WXTOHywMCIhf Gu6Q8rxo2+uSfNOIt11az68pO7QRerzdUPVHhP47qYugp4b6vw8UW8tF7I25+Ar8GQ7w c3/djVJkv9bgv85Xq18EykOLl8MIwxcWalDBFXnIHGOkr3dYFKMiLLMJ7QyIZzx7+BIV G/zOKKDld10Aihp8mVVtKy86L427RD5lkzI+MycPIPgHmFQGqClFmQ8NaiyNF0aPfvez TWYA== X-Gm-Message-State: AGi0PuZgJQhquoPEvyn/Gu2ndv95WwfpuzJLH4zR3tKnyuMZUqzglbZj uKGAf1QrtP0XkHRASYLVCPUVTw== X-Google-Smtp-Source: APiQypJC+aibt2oWIqq4K8GTndV9xenFpwtNimDde9zUtEgtAZlT+PBKOi6Li65+3JTzMVGOg1uzZA== X-Received: by 2002:a05:651c:50a:: with SMTP id o10mr295369ljp.163.1586197039343; Mon, 06 Apr 2020 11:17:19 -0700 (PDT) Received: from [192.168.8.100] (user-5-173-33-152.play-internet.pl. [5.173.33.152]) by smtp.gmail.com with ESMTPSA id v22sm10414019ljc.79.2020.04.06.11.17.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 06 Apr 2020 11:17:18 -0700 (PDT) To: jerinj@marvell.com, Kiran Kumar K Cc: dev@dpdk.org, thomas@monjalon.net, david.marchand@redhat.com, mdr@ashroe.eu, mattias.ronnblom@ericsson.com, pbhagavatula@marvell.com, ndabilpuram@marvell.com, xiao.w.wang@intel.com References: <20200331192945.2466880-1-jerinj@marvell.com> <20200405085613.1336841-1-jerinj@marvell.com> <20200405085613.1336841-5-jerinj@marvell.com> From: Andrzej Ostruszka Message-ID: <020f8ab9-71e7-b5af-926f-ab52cc342fd4@semihalf.com> Date: Mon, 6 Apr 2020 20:17:17 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <20200405085613.1336841-5-jerinj@marvell.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v4 04/29] graph: implement node debug routines 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 4/5/20 10:55 AM, jerinj@marvell.com wrote: > From: Jerin Jacob > > Adding node debug API implementation support to dump > single or all the node objects to the given file. > > Signed-off-by: Jerin Jacob > Signed-off-by: Kiran Kumar K > Signed-off-by: Pavan Nikhilesh > Signed-off-by: Nithin Dabilpuram [...] > diff --git a/lib/librte_graph/node.c b/lib/librte_graph/node.c > index d04a0fce0..8592c1221 100644 > --- a/lib/librte_graph/node.c > +++ b/lib/librte_graph/node.c > @@ -377,6 +377,38 @@ rte_node_edge_get(rte_node_t id, char *next_nodes[]) > return rc; > } > > +static void > +node_scan_dump(FILE *f, rte_node_t id, bool all) > +{ > + struct node *node; > + > + RTE_ASSERT(f != NULL); Why the assert? Below this is used in public (I guess) functions so user can provide wrong input - in that case I'd expect warning/error not an assert. > + NODE_ID_CHECK(id); > + > + STAILQ_FOREACH(node, &node_list, next) { > + if (all == true) { > + node_dump(f, node); > + } else if (node->id == id) { > + node_dump(f, node); > + return; > + } > + } > +fail: > + return; > +} > + > +void > +rte_node_dump(FILE *f, rte_node_t id) > +{ > + node_scan_dump(f, id, false); > +} > + > +void > +rte_node_list_dump(FILE *f) > +{ > + node_scan_dump(f, 0, true); > +} > + [...] With regards Andrzej Ostruszka