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 1pRukG-0004l9-9i for pgsql-hackers@arkaria.postgresql.org; Tue, 14 Feb 2023 12:49:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pRukE-0000gB-R6 for pgsql-hackers@arkaria.postgresql.org; Tue, 14 Feb 2023 12:49:14 +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 1pRukE-0000g2-Eu for pgsql-hackers@lists.postgresql.org; Tue, 14 Feb 2023 12:49:14 +0000 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pRukB-0007UM-SP for pgsql-hackers@postgresql.org; Tue, 14 Feb 2023 12:49:14 +0000 Received: by mail-pl1-x62b.google.com with SMTP id ja21so9345951plb.13 for ; Tue, 14 Feb 2023 04:49:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=D14gVlrMZSyxkFrQcgCT6Glw9tb9rVHeS1k6wc3DtNw=; b=Z5DyU+2ggUHplTdfupYmX3XJXzRurMtZOikffrj/4PsMr3i6aP3hxLhgMWOJ2y7gIK a0aQSMsEza2BXTT0MeV7mrUsJpbmwX5aNffNd6wBZu2YD4u2P+HDupLo5XTGLGB8WsOc aQ7IrFhhaBLo01XwqDltWwNcl56a4nskC3vPp0KhxVlz6w5SdnAPvaB27WSDnMwP4QwT 6b82Sm0vvgl7MPzjpAsS1ddGlWdqYFiugWjOuNo1xgsmKvFEat3ETK8gZIYa9pyPPYYb QSt6VlXOqOJW0VBNh/ksqecLcqMtJnD3uWNzX35rEUcMjMrgdMSJJw0WroK1HJ3aRI9c qLpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=D14gVlrMZSyxkFrQcgCT6Glw9tb9rVHeS1k6wc3DtNw=; b=udnspRIfHOFuHbzko9pAD2pGsvbHC4GsoLY+h1mwdHzNJPF1MMMV0XOv+GFJqSz4ef jUzkMeJm84Uq2kjU1vk6X26U/llKt4Ix/DXwdUaV+wHTxuo6gfgshkPEF8D0CUoG4s3L cMddxqIlD7Z+WkypmmceD+fx7V+fJFouok9L7LBJ6oc4jqwrurHjQ/yXf954LYBR2eLO GC6EDnGUgYgnUEHKgkWA3ATuxtuVrW3f7zRLU7YbJW4vqNY6mdeajCWPURPLA/5yz48J 0EnmaRrrJm5SHo0ni+BpNpI200Z/lloy9o5DI2Guzut3Jc/mPTcPdbE6Kq5D8LH7s9lj pXIA== X-Gm-Message-State: AO0yUKVUw8k53+qy+7yYFul1QXxLBJSVEYGumtI1EI54J7OvkCo6Wyhn F07jiip47BtUTHnPX+0dKsI= X-Google-Smtp-Source: AK7set+X5e6HaxdtMGD1+oIP113bLtChU/HU03b7LR7kvbrlU8ubtgYdmYu+dBsuf/u4XtXVJ0rXUA== X-Received: by 2002:a17:90b:1b46:b0:233:d650:6b28 with SMTP id nv6-20020a17090b1b4600b00233d6506b28mr2198377pjb.46.1676378949451; Tue, 14 Feb 2023 04:49:09 -0800 (PST) Received: from [172.16.209.129] (vip-148-139-0-229.cust.service-now.com. [148.139.0.229]) by smtp.gmail.com with ESMTPSA id mp6-20020a17090b190600b00233c9eb64f3sm5625501pjb.47.2023.02.14.04.49.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 14 Feb 2023 04:49:08 -0800 (PST) Message-ID: Date: Tue, 14 Feb 2023 13:48:56 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: Reduce timing overhead of EXPLAIN ANALYZE using rdtsc? Content-Language: en-US From: David Geier To: Andres Freund Cc: Pavel Stehule , Tomas Vondra , vignesh C , Lukas Fittl , Michael Paquier , Ibrar Ahmed , Maciek Sakrejda , pgsql-hackers References: <24aa958f-0463-03d4-ce54-20b277c954c6@gmail.com> <20230121041439.zraxavau2wqf2ys3@awork3.anarazel.de> <20230123174158.rhmrbmjp6ycak64r@awork3.anarazel.de> <20230207181218.47irz3of34qsww5l@awork3.anarazel.de> <989acbcf-e950-7911-c2e2-fe7aa7d15108@gmail.com> In-Reply-To: <989acbcf-e950-7911-c2e2-fe7aa7d15108@gmail.com> 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 Hi! On 2/14/23 12:11, David Geier wrote: > Hi, > > I think I fixed the compilation errors. It was due to a few variables > being declared under > > #if defined(__x86_64__) && defined(__linux__) > > while being used also under non x86 Linux. > > I also removed again the code to obtain the TSC frequency under > hypervisors because the TSC is usually emulated and therefore no > faster than clock_gettime() anyways. So we now simply fallback to > clock_gettime() on hypervisors when we cannot obtain the frequency via > leaf 0x16. > > Beyond that I reviewed the first two patches a while ago in [1]. I > hope we can progress with them to further reduce the size of this > patch set. > > [1] > https://www.postgresql.org/message-id/3ac157f7-085d-e071-45fc-b87cd306360c%40gmail.com > > It still fails. I'll get Cirrus-CI working on my own Github fork so I can make sure it really compiles on all platforms before I submit a new version. -- David Geier (ServiceNow)