[HACKERS] memory fields from getrusage()
От | Justin Pryzby |
---|---|
Тема | [HACKERS] memory fields from getrusage() |
Дата | |
Msg-id | 20170610222026.GE18003@telsasoft.com обсуждение исходный текст |
Ответы |
Re: [HACKERS] memory fields from getrusage()
|
Список | pgsql-hackers |
I'm interested to expose output of the remaining (memory) fields from getrusage(). postgres=# SET log_parser_stats='on'; postgres=# SELECT c.oid::regclass, usagecount FROM pg_buffercache b JOIN pg_class c USING (relfilenode) WHERE usagecount=1; LOG: PARSER STATISTICS DETAIL: ! system usage stats: ! 0.000197 elapsed 0.000119 user 0.000079 system sec ! [0.011572 user0.007714 sys total] ! 0/0 [0/264] filesystem blocks in/out ! 0/39 [0/989] page faults/reclaims,0 [0] swaps ! 0 [0] signals rcvd, 0/0 [0/0] messages rcvd/sent ! 0/0 [2/2] voluntary/involuntarycontext switches ! 3920 MAX RESIDENT, 0 SHARED, 0 UNSHARED DATA, 0 UNSHARED STACK (Kb) Before that can work for some platforms, it looks like rusagestub.h needs to have any desired fields added, and ./src/port/getrusage.c should memset(0) in the non-windows case before adding any reliance on the rest of the structure. This comment from ~1996 says: https://doxygen.postgresql.org/postgres_8c_source.html4421 * the only stats we don't show here are for memory usage-- i can't4422 * figure out how to interpret the relevant fields in the rusage struct,4423 * and they changenames across o/s platforms, anyway. if you can figure4424 * out what the entries mean, you can somehow extractresident set size,4425 * shared text size, and unshared data and stack sizes. .. is that really (still) the case for supported platforms? I'm hoping that in 2017 one can just call getrusage() if autoconf says it's okay ?? Justin
В списке pgsql-hackers по дате отправления: