Re: Get memory contexts of an arbitrary backend process

torikoshia <torikoshia@oss.nttdata.com>

From: torikoshia <torikoshia@oss.nttdata.com>
To: Fujii Masao <masao.fujii@oss.nttdata.com>
Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>, pgsql-hackers@postgresql.org, tgl@sss.pgh.pa.us, gkokolatos@protonmail.com, kasahara.tatsuhito@gmail.com, craig@2ndquadrant.com
Date: 2021-03-25T14:45:17Z
Lists: pgsql-hackers

Attachments

On 2021-03-25 22:02, Fujii Masao wrote:
> On 2021/03/25 0:17, torikoshia wrote:
>> On 2021-03-23 17:24, Kyotaro Horiguchi wrote:
>> 
>> Thanks for reviewing and suggestions!
> 
> The patched version failed to be compiled as follows. Could you fix 
> this issue?

Sorry, it included a header file that's not contained in
the current version patch.

Attached new one.

> mcxtfuncs.c:22:10: fatal error: utils/mcxtfuncs.h: No such file or 
> directory
>  #include "utils/mcxtfuncs.h"
>           ^~~~~~~~~~~~~~~~~~~
> compilation terminated.
> make[4]: *** [<builtin>: mcxtfuncs.o] Error 1
> make[4]: *** Waiting for unfinished jobs....
> make[3]: *** [../../../src/backend/common.mk:39: adt-recursive] Error 2
> make[3]: *** Waiting for unfinished jobs....
> make[2]: *** [common.mk:39: utils-recursive] Error 2
> make[1]: *** [Makefile:42: all-backend-recurse] Error 2
> make: *** [GNUmakefile:11: all-src-recurse] Error 2
> 
> https://cirrus-ci.com/task/4621477321375744
> 
> Regards,

Commits

  1. Add function to log the memory contexts of specified backend process.

  2. Add pg_backend_memory_contexts system view.

  3. Limit the verbosity of memory context statistics dumps.