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 57960A0577; Tue, 7 Apr 2020 12:23:10 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E78CB1BE90; Tue, 7 Apr 2020 12:23:08 +0200 (CEST) Received: from mail-io1-f67.google.com (mail-io1-f67.google.com [209.85.166.67]) by dpdk.org (Postfix) with ESMTP id C46AB2BE9 for ; Tue, 7 Apr 2020 12:23:07 +0200 (CEST) Received: by mail-io1-f67.google.com with SMTP id u2so2768597iop.10 for ; Tue, 07 Apr 2020 03:23:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=FjWGHgtryVSILlcdiLlZrfALYAkwKfvNn/1OzOBvgRo=; b=qL83aSQ/JKcmnYUQFUmwBFCsi9flLmqbs3oYmOWNaxMSrxpsRUqMAH+dPEbZailaT0 RDa8YESXVWaK89uszsYQtociEhrrjfPWAQEQnslMZ41pw4Tkpe4uhj9iJGc37XPQdc9k u7W6XkIbDgJXbBqBJ60oYTWK0XK3d+SrE/KC8CisuloAIYxF6owvHE+RdF8Lw+aTrd2d Fsy8Iu1akHBSe6DtNTWU8uRcLD7zjxMBYzQzvh+JOc5wyMYVlhN6Bgmr74NuScENDkvH FWNw2QIqnzqGqeguoNTHLeUxgqHHLY+u8qPGL80/kaI0gITHKACibKLr45xH8NZSBWFD ioQw== 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=FjWGHgtryVSILlcdiLlZrfALYAkwKfvNn/1OzOBvgRo=; b=PKWqJOWbjL0ymuiTxSfiJqV2V8/lvj9ictrc+Na3iZsv1uSbq8d/UDjtQZ/zOB0a0q tKTAafhz2uQuij2zbbV+yFtVuKgCjzzx5j+f4ouWLbL/OsL299Qi++Y58/Z7s7aR+38S jqn5tFClPWaUDwU/aujIOwYZLo5pRHK0bufc55OfCvEI/iBkmO32i+j8DQztUDoOm3nX Lf8GuTJBhRqrHs2R9Kb9aebI6hw6VSuOl6ovTtQX0a8cWpODYzrraL8fvFQNFTzmc7jd pZsnFNmgO3VOxOCYe5DzwB8Cp9XVBv1S0szntFnNG8KlVpL8hrUietwORpQHMUEEOB/b XgdQ== X-Gm-Message-State: AGi0PuZZJQZJsLV7twcK3vJg3H4R4Fn+XdWhcrKVRjkovJZHpDb3lBik /4OrJa3Rijr00pFNWvktUhoun/kufg4V+Eg0UXo= X-Google-Smtp-Source: APiQypIKFAOc0KM09980RkGl0f1XZ9ANd/0tuuyNu6M+mb4k4IYP9f0ysS4VtAP2yVYUxuvajec5clXLTo+nhgeuMwA= X-Received: by 2002:a02:3506:: with SMTP id k6mr1277758jaa.104.1586254987170; Tue, 07 Apr 2020 03:23:07 -0700 (PDT) MIME-Version: 1.0 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> In-Reply-To: <020f8ab9-71e7-b5af-926f-ab52cc342fd4@semihalf.com> From: Jerin Jacob Date: Tue, 7 Apr 2020 15:52:51 +0530 Message-ID: To: Andrzej Ostruszka 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 Content-Type: text/plain; charset="UTF-8" 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 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. > > > + 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