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 4E8FBA04B0; Fri, 4 Dec 2020 10:50:15 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9EDC0375B; Fri, 4 Dec 2020 10:50:13 +0100 (CET) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by dpdk.org (Postfix) with ESMTP id E87992E81 for ; Fri, 4 Dec 2020 10:50:10 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 3EEB85C011C; Fri, 4 Dec 2020 04:50:10 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Fri, 04 Dec 2020 04:50:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=fm2; bh= oHw1xs1Ir4W9EXODSLupm5dUaDd5yqQ1Jkc+Df2wWD4=; b=Jfn8V7B7w1SBCg2n DU4hgxmp+blQygLMWwLx2ix+38AhB61KLgCeR2L19Sq2adE1+AFCTRMdNL/QqY92 59VZ6btmmQizW/yE4LPPcmZtGBF+o40OuK7Cc+duVVtSyq4jsfzYvERAiv7Lh5bh EMHnTH5+VlXwFyBxstjuKbtxXWBV1BOj727FF3PjZlsyQio9ypl5GJW8MC0r0Qnu z415WY2fcxw7valySRd991vmFH7n3CsRColsBIC8rleMBJGY8TzzZBMs8nL2scAI bz3ptth3uP8cLfb4DDdLK7xouh5jVszwPkp8+rBvG2gjqmpe0j39HFCQJDSDnwWa kK4GKg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=oHw1xs1Ir4W9EXODSLupm5dUaDd5yqQ1Jkc+Df2wW D4=; b=NFjPj65iiuncPISVb4Zd4Dia2SVQHjkBzFpLS2bvt01tJZfRjC7sBwnIl IR3Yl6sQw5nwbQCM2wKlVna4S6DIeklaNDyz+y1Ks5zEmBisZkZOTCiDm3wWoQcB o2scr4/LBZ1e/p6Z5IrHAuQ/UvlUpePgsdBUC62UtJl0KxMVTuGoVIt9G8NPRQQ0 dBm3cJjzOqf7aOiw7t1is0UjwD5i7pmg5/VWRnDEUGU0lOonAFuVvK0wrdds+vrA StygGYr/doAL4DHewkswuNqug0hInRpoVizINce8EXcpvgedwAhv8l8vPjh1K5Nx +8ZJPgGy2knI8xtkJm4nbky+qcO6A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrudeikedgtdejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepudeggfdvfeduffdtfeeglefghfeukefgfffhueejtdetuedtjeeu ieeivdffgeehnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghl ohhnrdhnvght X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 6EA9124005D; Fri, 4 Dec 2020 04:50:09 -0500 (EST) From: Thomas Monjalon To: prateekag Cc: dev@dpdk.org, Stephen Hemminger Date: Fri, 04 Dec 2020 10:50:07 +0100 Message-ID: <11318619.cDjlMmrxjJ@thomas> In-Reply-To: <6c909d2e48de9a4bd88f1783798d06c7@cse.iitb.ac.in> References: <77fa0d526982e5fd0a15b293599d973c@cse.iitb.ac.in> <4079538.OZV0JHgpTk@thomas> <6c909d2e48de9a4bd88f1783798d06c7@cse.iitb.ac.in> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] Printfs in Signal Handler 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" 04/12/2020 10:20, prateekag: > Hi, > > I can only look at this problem a week later, If someone wants to correct > this, they may go ahead. The problem is how to convert an integer to string > and what functions to use to create the final string. "itoa" is not a part of > C standard, writing custom itoa may pollute the code. strcpy is asyc-safe > afaik. > The strings in which signal number is not required to printed can be directly > converted to write call. First question is to decide whether the prints are useful enough to be kept? > On 2020-12-03 02:11, Thomas Monjalon wrote: > > 01/12/2020 10:24, Thomas Monjalon: > >> 01/12/2020 04:39, prateekag: > >> > printf is not signal safe and may lead to deadlock if kept in signal handler > >> > and > >> > signal comes in two quick succession. It will not lead to incorrect behavior > >> > and it is a highly unlikely event. And an expert may understand why this > >> > issue happened. Is it worthwhile to change these printfs to unix I/O write > >> > call? > >> > >> Thank you for reporting. > >> Please could you describe which files and functions you are talking about? > > > > I've received a private reply: > > Filenames: > > testpmd.c > > test_pmd_perf.c > > evt_main.c > > pdump/main.c > > Function name: > > signal_handler > > > > > > I am OK with removing these printfs. > > > > Do you want to do the patch with the explanation? >