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 1qJ5OU-0000CA-L7 for pgsql-hackers@arkaria.postgresql.org; Tue, 11 Jul 2023 04:54:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1qJ5OR-0004k4-Nu for pgsql-hackers@arkaria.postgresql.org; Tue, 11 Jul 2023 04:54:31 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qJ5OR-0004jv-Ex for pgsql-hackers@lists.postgresql.org; Tue, 11 Jul 2023 04:54:31 +0000 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qJ5OO-003CKM-Lz for pgsql-hackers@lists.postgresql.org; Tue, 11 Jul 2023 04:54:30 +0000 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-3fbf1b82dc7so54357435e9.2 for ; Mon, 10 Jul 2023 21:54:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689051266; x=1691643266; 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=ixsMNqD4NXW3vM5XDe+ojPITby0WQ4LcCGCppJQoLfo=; b=LYPFxrllTRRNhYNfoGHHPvjCMsAR1pCVz3TPVrMj6hjRPepq99QDBrDE0lf8QBkVFa G4iPrKm9Ys+wNomM+p7rqAzu8KXIevMQrXlkDJfzz53KvlMryjsi3SC+LpEffV0re8wf tLHCJ7y5esAubP43zoG8miKBakiJJYKOTlHfZseck9lRLSkjk0E7ppxC8wxtIV6JMqjL oIg9pDiaIsCgNRPTLREBAWPVL5DDSlxlYwxhvuk8jvaJCNjistwZ5BTrCw4pL18J/tMp WBzVpREW0abGQiqU75II7d41dJljpwqo6BNVGgEiL6QoMIVNL69lKwtBWGKislJKGS28 a/ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689051266; x=1691643266; 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=ixsMNqD4NXW3vM5XDe+ojPITby0WQ4LcCGCppJQoLfo=; b=XV8g4vZf8tChY8ZqZ2HUgSNB7wX24gvtArPfMk9c5ufHkzpQd3k7x+J/0OaSRz4Qqb ukMW+QPPr+Nyni69f/FQ2a48gai5EnTesRQNU2+KJCs4+FPKKQDQyJZDTq+q6AI2egRG Vu7ouRuda4dIUhNoPIeS8K3d79LeQzyZtBelo6ikLm1UVxJU6fuJTw9r3FP5QY+gQCpd NjBkP//BplRWgU7KGd9QniycyzBS7dRC9/7adpP3ZAbr6nkPCqJ2EFSE/1HU2rqPzi5S GXYRwqxUXDidhFjFAGE764w+JYQjl2E1HYEcwJZC9RxHo2aMJPAIrHoYSJUon35LiuWj WkEg== X-Gm-Message-State: ABy/qLYwklURp3qSEBLLPxO/djdex46uXtp+EmctpbZbPMb7UGMb4FhZ qJhvaUyOfvroYXrClbmbt3c= X-Google-Smtp-Source: APBJJlHVm4d9AIXc8sTHVC5weNXJ3E8qC1vTcqC8B7mVkwUWHcO4ujmUg49mYZBSAUnBxBz2yq3TsQ== X-Received: by 2002:a7b:c4d1:0:b0:3f8:2777:15e with SMTP id g17-20020a7bc4d1000000b003f82777015emr13776311wmk.31.1689051265638; Mon, 10 Jul 2023 21:54:25 -0700 (PDT) Received: from [192.168.30.36] ([54.239.6.185]) by smtp.gmail.com with ESMTPSA id q15-20020adffecf000000b003142439c7bcsm1112093wrs.80.2023.07.10.21.54.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 10 Jul 2023 21:54:25 -0700 (PDT) Message-ID: Date: Tue, 11 Jul 2023 06:54:23 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: Autogenerate some wait events code and documentation Content-Language: en-US To: Michael Paquier , Alvaro Herrera Cc: Andres Freund , PostgreSQL Hackers References: <20230710071136.jiedze443q7o5vsp@alvherre.pgsql> 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 7/11/23 12:52 AM, Michael Paquier wrote: > On Mon, Jul 10, 2023 at 09:11:36AM +0200, Alvaro Herrera wrote: >> I don't like this bit, because it means the .txt file is now ungreppable >> as source of the enum name. Things become mysterious and people have to >> track down the event name by reading the the Perl generating script. >> It's annoying. I'd rather have the extra column, even if it means a >> little duplicity. > > Hmm. I can see your point that we'd lose the direct relationship > between the enum and string when running a single `git grep` from the > tree, still attempting to do that does not actually lead to much > information gained? Personally, I usually grep for code when looking > for consistent information across various paths in the tree. Wait > events are very different: each enum is used in a single place in the > tree making their grep search the equivalent of looking at > wait_event_names.txt anyway? > Before commit fa88928470 one could find the relationship between the enum and the name in wait_event.c (a simple git grep would provide it). With commit fa88928470 in place, one could find the relationship between the enum and the name in wait_event_names.txt (a simple git grep would provide it). With the proposal we are discussing here, once the build is done and so the pgstat_wait_event.c file is generated then we have the same "grep" capability than pre commit fa88928470 (except that "git grep" can't be used and one would need things like find . -name "*.c" -exec grep -il "WAIT_EVENT_CHECKPOINTER_MAIN" {} \;) I agree that it is less "obvious" than pre fa88928470 but still doable though. Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com