Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l2we9-0001A6-F5 for pgsql-hackers@arkaria.postgresql.org; Fri, 22 Jan 2021 13:38:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l2we8-0002YW-7a for pgsql-hackers@arkaria.postgresql.org; Fri, 22 Jan 2021 13:38:40 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l2we7-0002YP-ED for pgsql-hackers@lists.postgresql.org; Fri, 22 Jan 2021 13:38:40 +0000 Received: from [64.147.123.21] (helo=wout5-smtp.messagingengine.com) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l2we4-00081N-IJ for pgsql-hackers@lists.postgresql.org; Fri, 22 Jan 2021 13:38:38 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id CFB261AD4; Fri, 22 Jan 2021 08:38:23 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Fri, 22 Jan 2021 08:38:24 -0500 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:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=3b+JZiPLeY4ZXAqps9Kr4h3p2DFKymv+CpRN83QNLvg=; b=QjGTsQy1 lJ0eqvRzp5k/OE8c8qbVjDd73eY232iwlfq3D2KrmRDtFs7f1zesaxDvOnztDcFj SWkaE9IPCNTh6gLmf8x338HlCiK5vCJZPLHg4xItk3uphmf+kfQcoaCr8+AoNxmo c+plZvrfeYBMygDS7GAqBuApojn9uUlnpa1ylbLqwZQeeSEYoHxif+2V/1KHkF38 JlXHUdO48Pm9+5LVqtgZiC1Zn421/XJ87qsYthodN+eXF1s4ht/IgfLjnXhc/gSw OTNqObkQRuVGtt+u+NX5eDwOR9a25wDFwejso1McjQ4hBCDs9mDpqfWZdFlw9W/c 9v5obR1TjdV/9w== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudeigdehlecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepfffhvffukfggtggugfgjfgesthekre dttderudenucfhrhhomhepkdetlhhvrghrohcujfgvrhhrvghrrgdkuceorghlvhhhvghr rhgvsegrlhhvhhdrnhhoqdhiphdrohhrgheqnecuggftrfgrthhtvghrnhepgfdvvedvte eiheevgfeltdetgffghfeghedvleehvdetiedthffgjeegkeekjeeknecukfhppeduledt rdelhedrudelrddujeejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrg hilhhfrhhomheprghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Received: from perhan.alvh.no-ip.org (unknown [190.95.19.177]) by mail.messagingengine.com (Postfix) with ESMTPA id A6F4C108005B; Fri, 22 Jan 2021 08:38:22 -0500 (EST) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 095EA2A0FC3; Fri, 22 Jan 2021 10:38:20 -0300 (-03) Date: Fri, 22 Jan 2021 10:38:20 -0300 From: 'Alvaro Herrera' To: "tsunakawa.takay@fujitsu.com" Cc: "iwata.aya@fujitsu.com" , "'pgsql-hackers@lists.postgresql.org'" Subject: Re: libpq debug log Message-ID: <20210122133820.GA12162@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Host-Lookup-Failed: Reverse DNS lookup failed for 64.147.123.21 (deferred) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hello, just two quick comments on this, On 2021-Jan-22, tsunakawa.takay@fujitsu.com wrote: > From: Alvaro Herrera > > That's true, but it'd require that we move PQtrace() to fe-misc.c, because > > pqTraceInit() uses definitions that are private to that file. > > Ah, that was the reason for separation. Then, I'm fine with either > keeping the separation, or integrating the two functions in fe-misc.c > with PQuntrace() being also there. I kind of think the latter is > better, because of code readability and, because tracing facility is > not a connection-related reature so categorizing it as "misc" feels > natural. Maybe we can create a new file specifically for this to avoid mixing unrelated stuff in fe-misc.c -- say fe-trace.c where all this new tracing stuff goes. > > The point is to be able to cope with a connection that calls PQtrace() multiple > > times, with or without an intervening PQuntrace(). > > We'd make no friends if we made PQtrace() crash, or leak memory if called a > > second time ... > > HEAD's PQtrace() always call PQuntrace() and then re-initialize from > scratch. So, if we keep that flow, the user can call PQtrace() > multiple in a row. Oh, of course. -- Álvaro Herrera Valdivia, Chile "No necesitamos banderas No reconocemos fronteras" (Jorge González)