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 1pgglZ-0007kH-Es for pgsql-hackers@arkaria.postgresql.org; Mon, 27 Mar 2023 06:55: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 1pgglY-0007be-AA for pgsql-hackers@arkaria.postgresql.org; Mon, 27 Mar 2023 06:55: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 1pgglX-0007bS-V4 for pgsql-hackers@lists.postgresql.org; Mon, 27 Mar 2023 06:55:40 +0000 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pgglQ-0007SY-Tz for pgsql-hackers@lists.postgresql.org; Mon, 27 Mar 2023 06:55:39 +0000 Received: by mail-wr1-x42a.google.com with SMTP id h17so7475456wrt.8 for ; Sun, 26 Mar 2023 23:55:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679900131; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=pvAlC/cTADDSGxdSQXZDTbJUtao8kqCkao0++NrIIfA=; b=dO5vdCnrqvy48hk8LyZmXtxaFWHWSkFFcpxpN42dfCuoZ+j2gq1ombXFFBQu0TmBfU YsPuPuPNW2NALc7720yW1N3BV06UJ+cu1h41wyBuBIEzXXaY6UyKSXh/5o4+ub4Nxjlf OY3RTFqB6tU0GFC3xzuw/XTU7oS0aB5DhS042HJ++lXlmyniIsNxbyubeEGumTAr4QcA 2WoLCfVelAymHKJMRrHg+f2C77zH05VMNFwQBjPS0fAvLo+spxsjhsva6vj1DbWmsK8Z FiFVz3cJKWRV8CieuM8sUECnH4TCdglAp0l+zT4hbk74gLOrQbqcfJ9YL4wKRdBv8ck+ KuGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679900131; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=pvAlC/cTADDSGxdSQXZDTbJUtao8kqCkao0++NrIIfA=; b=zE0t+YaBMJw6pCSQrzBrYV9astbKNmCG6qjsoTZWETOcTa3HZ75w8HhtbS955hyOsj 44F56+Xm7A5hI1PrHNAtc4rlcKI5H3o6E6JkfqcHKWZaKpvxdBLcIwz3pzBPYvyca5SF byvXeNnM5AkbfXoA4iAj3EWb1pAxDW073LquG6RmKh9cgv/TZ+gsWAmQw9IYUjv9ftwl dUePXbsVw9nbL1RwOoeni4dOjUhWwMdmggBbgUbG2r4B+ZmFhKcz5Epbx7ygYzBUN3g0 JUW33Sd9CV62OHx7SZR89AoHwi5ZFw2xo4rfk6CstvS8NTYaTT2fp2POx0M2Xynv/WGG EdgA== X-Gm-Message-State: AAQBX9cqq3xiCT1VHLTUzYg/JWHEWKAhHbHji+abm4HnaTnoUZXKdjKC 5hVKfdim9gDn5RsewvpWk2c= X-Google-Smtp-Source: AKy350Ydw7d/T0p3BkwYUkEYQaZOzJ7uMrVPI4aYqwDet+06ddojiXU76TKmEuvfZSTUoilQ5JsNJg== X-Received: by 2002:adf:dbc5:0:b0:2d7:998c:5ad9 with SMTP id e5-20020adfdbc5000000b002d7998c5ad9mr8506895wrj.8.1679900130653; Sun, 26 Mar 2023 23:55:30 -0700 (PDT) Received: from [192.168.5.158] ([54.239.6.184]) by smtp.gmail.com with ESMTPSA id n12-20020adfe34c000000b002da75c5e143sm11842362wrj.29.2023.03.26.23.55.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 26 Mar 2023 23:55:30 -0700 (PDT) Message-ID: <442ba19a-6e8a-3fe3-d404-e9101dfbfcbb@gmail.com> Date: Mon, 27 Mar 2023 08:54:13 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: Generate pg_stat_get_xact*() functions with Macros Content-Language: en-US To: Michael Paquier Cc: "Gregory Stark (as CFM)" , Andres Freund , Michael Paquier , PostgreSQL Hackers References: <20230112182434.ejffbun4plv2g37k@awork3.anarazel.de> <83f7982d-272a-b064-8a0f-8853354edf10@gmail.com> <20230113183746.zyncqr2zz3gk6yh6@awork3.anarazel.de> <11744b0e-5f7f-aba8-7d9c-2ff0a0c6e2b2@gmail.com> <631e3084-c5d9-8463-7540-fcff4674caa5@gmail.com> From: "Drouvot, Bertrand" In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 3/27/23 8:40 AM, Michael Paquier wrote: > On Mon, Mar 27, 2023 at 07:45:26AM +0200, Drouvot, Bertrand wrote: >> Thanks! LGTM, but what about also taking care of pg_stat_get_xact_function_total_time() >> and pg_stat_get_xact_function_self_time() while at it? > > With a macro that uses INSTR_TIME_GET_MILLISEC() to cope with > instr_time? Why not, that's one duplication less. Yes, something like V1 up-thread was doing. I think it can be added with your current proposal. Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com