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 7B46FA0588; Tue, 7 Apr 2020 13:50:47 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B42A92BE9; Tue, 7 Apr 2020 13:50:46 +0200 (CEST) Received: from mail-lf1-f67.google.com (mail-lf1-f67.google.com [209.85.167.67]) by dpdk.org (Postfix) with ESMTP id C048C2B83 for ; Tue, 7 Apr 2020 13:50:44 +0200 (CEST) Received: by mail-lf1-f67.google.com with SMTP id t11so2141130lfe.4 for ; Tue, 07 Apr 2020 04:50:44 -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=25mg5U0oOTZr27rAPJIA3y+4+nlHa/ho3TTRIMVVLpI=; b=TJqnNjiV/1fCyM0L/n1PQ9zrBUG7aFRfvFAJ4MYVbPAyMAbjCbtkxSW3cM4UVRb7sS Vr8pNtI8wZzQHx7s5QMsJCgpXSXduip5+mPPcQUYMKL7poaQhyhoyrUY49TJ+F0fs1KX v8KI4Zpj0J8LGHQ5qtSSxJ2wPJiQJO7ylz5ajImBuQ/vPNoFEyjO/fODRY0cDJaxRdNV xcrYhF7tAu3cPI3ZSycrroS8jriDxWuQ1LwuKCg8OOhyFpemm+Fckc3lpvV+DYBunLyQ whMry+TFDOx7Q/ixRPbMhneS7JSzHB/FkrEP+1iHSljM+4oG2yzxQO1yln0HaKdg041+ rsUg== 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=25mg5U0oOTZr27rAPJIA3y+4+nlHa/ho3TTRIMVVLpI=; b=tDqBLVgkq83ZHbQ/A2d4AwicA44KvZCWkIDgcJcEyFln2cUuOXssVtmnZibO1F3yAg oZLEPTPgeqUNGmI/DjzKShtEZiiwWREW5+Dixb8stP9BPKChE8y+0ZtGBvyNs5zZarSY TQsQwEk6BR9lm8Ck8Wagj1TlftULbefF2ziPmKCQnAn7FAmtcDigK1kUAkGOB/QTxPl/ ppOeubhGcGUCddaSa9/WOcCHAM+8sa+cSztcMdn46ySKFo0zz+7g4MOsyxJt9/lW2J/0 zIlQDfGfG55VjpJ8DojPTWg8x3inZc4N6Q3si/U9oavzvcCTZdUaZkFqZoAiNjDJjj82 2LPg== X-Gm-Message-State: AGi0PuYupBbpaIEleP2Dp0w6xbGpN/yXqZ6JdD3hpPJT274dmM3vzq56 cmHVyGWQ9xY6Qtql6cB10u2hzA== X-Google-Smtp-Source: APiQypJyY20Az2WRc3OKO1XBwFFHre+iDsdK6xPTNmQ4YJuXSLa18sufS9ppwepNoTAjiHhyo4alCA== X-Received: by 2002:a19:c1d3:: with SMTP id r202mr328139lff.216.1586260243107; Tue, 07 Apr 2020 04:50:43 -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 t13sm13128762lfc.68.2020.04.07.04.50.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Apr 2020 04:50:42 -0700 (PDT) To: Jerin Jacob Cc: Jerin Jacob , Kiran Kumar K , dpdk-dev , Thomas Monjalon , David Marchand , Ray Kinsella , =?UTF-8?Q?Mattias_R=c3=b6nnblom?= , Pavan Nikhilesh , Nithin Dabilpuram , Xiao Wang References: <20200331192945.2466880-1-jerinj@marvell.com> <20200405085613.1336841-1-jerinj@marvell.com> <20200405085613.1336841-5-jerinj@marvell.com> <020f8ab9-71e7-b5af-926f-ab52cc342fd4@semihalf.com> From: Andrzej Ostruszka Message-ID: Date: Tue, 7 Apr 2020 13:50:41 +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: 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/7/20 12:22 PM, Jerin Jacob wrote: > On Mon, Apr 6, 2020 at 11:47 PM Andrzej Ostruszka wrote: >> >> 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. > > Public API rte_node_dump() and node_scan_dump() calls this API without > any check. That was my point. I would expect either there or here to have a check for arg instead of assert. I'd say that asserts are very good for checking internal logic, but not so for checking if user input is OK. But I'm fine if you ignore this. With regards Andrzej Ostruszka