Re: Using ProcSignal to get memory context stats from a running backend - Mailing list pgsql-hackers

From Craig Ringer
Subject Re: Using ProcSignal to get memory context stats from a running backend
Date
Msg-id CAMsr+YG3KSH9RCDe0ifFbxjEo6s4m95mJXfXo4v9Cm=bMXDvRw@mail.gmail.com
Whole thread Raw
In response to Re: Using ProcSignal to get memory context stats from a runningbackend  (Andres Freund <andres@anarazel.de>)
Responses Re: Using ProcSignal to get memory context stats from a running backend
List pgsql-hackers
On 20 December 2017 at 02:35, Andres Freund <andres@anarazel.de> wrote:
 


> Yeah.  But please don't mess with MemoryContextStats per se ---
> I dunno about you guys but "call MemoryContextStats(TopMemoryContext)"
> is kinda wired into my gdb reflexes.  I think what'd make sense
> is a new function "MemoryContextStatsTo(context, function_pointer)".
> It's okay to redefine the APIs of the per-context-type functions
> these would call, though, because nobody calls those functions directly.

We already have MemoryContextStatsDetail() - it seems to make sense to
expand that API and leave MemoryContextStats() alone. I don't think
there's a need for a third variant?

Cool, can do.

I'll have to expose a typedef for the printf-wrapper callback in memnodes.h and add it to the stats method, which I thought would be more likely to get complaints than the global hook. I'm actually happier to do it with a passed callback.

Will revise when I get a chance in the next couple of days.

--
 Craig Ringer                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: [JDBC] [HACKERS] Channel binding support for SCRAM-SHA-256
Next
From: Craig Ringer
Date:
Subject: Re: access/parallel.h lacks PGDLLIMPORT