Re: Using ProcSignal to get memory context stats from a running backend

From: Craig Ringer <craig(at)2ndquadrant(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Greg Stark <stark(at)mit(dot)edu>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Using ProcSignal to get memory context stats from a running backend
Date: 2017-12-20 00:46:30
Message-ID: CAMsr+YG3KSH9RCDe0ifFbxjEo6s4m95mJXfXo4v9Cm=bMXDvRw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 20 December 2017 at 02:35, Andres Freund <andres(at)anarazel(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Craig Ringer 2017-12-20 00:48:59 Re: access/parallel.h lacks PGDLLIMPORT
Previous Message Michael Paquier 2017-12-20 00:35:55 Re: [JDBC] [HACKERS] Channel binding support for SCRAM-SHA-256