Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZcFXZ-00046Z-Qp for pgsql-hackers@arkaria.postgresql.org; Wed, 16 Sep 2015 16:26:37 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZcFXY-0006cZ-LZ for pgsql-hackers@arkaria.postgresql.org; Wed, 16 Sep 2015 16:26:36 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZcFXW-0006b4-O6 for pgsql-hackers@postgresql.org; Wed, 16 Sep 2015 16:26:34 +0000 Received: from mail.anarazel.de ([217.115.131.40]) by makus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1ZcFXT-0001cv-VJ for pgsql-hackers@postgresql.org; Wed, 16 Sep 2015 16:26:33 +0000 Received: from intern.anarazel.de (unknown [184.23.178.130]) (Authenticated sender: andres@anarazel.de) by mail.anarazel.de (Postfix) with ESMTPSA id 5C067860001; Wed, 16 Sep 2015 18:26:30 +0200 (CEST) Date: Wed, 16 Sep 2015 18:26:27 +0200 From: Andres Freund To: Jesper Pedersen Cc: "pgsql-hackers@postgresql.org" Subject: Re: Additional LWLOCK_STATS statistics Message-ID: <20150916162627.GF2086@alap3.anarazel.de> References: <55F82AE1.3010407@redhat.com> <55F871BA.4060404@redhat.com> <55F876CA.8020702@redhat.com> <55F97909.3010101@redhat.com> <55F97BF0.70503@redhat.com> <55F97EB7.8080308@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55F97EB7.8080308@redhat.com> X-Pg-Spam-Score: -4.2 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Hi, On 2015-09-16 10:37:43 -0400, Jesper Pedersen wrote: > #ifdef LWLOCK_STATS > lwstats->spin_delay_count += SpinLockAcquire(&lock->mutex); > + > + /* > + * We scan the list of waiters from the back in order to find > + * out how many of the same lock type are waiting for a lock. > + * Similar types have the potential to be groupped together. > + * Except for LW_WAIT_UNTIL_FREE there shouldn't be much in terms of grouping? Can't you instead iterate and count counter[waiter->lwWaitMode]++ or so? Greetings, Andres Freund -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers