Re: Printing backtrace of postgres processes
vignesh C <vignesh21@gmail.com>
From: vignesh C <vignesh21@gmail.com>
To: Andres Freund <andres@anarazel.de>
Cc: Tom Lane <tgl@sss.pgh.pa.us>,
Craig Ringer <craig.ringer@enterprisedb.com>, Robert Haas <robertmhaas@gmail.com>, Peter Eisentraut <peter.eisentraut@enterprisedb.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2021-01-28T11:52:24Z
Lists: pgsql-hackers
Attachments
- v4-0001-Print-backtrace-of-postgres-process-that-are-part.patch (text/x-patch) patch v4-0001
On Wed, Jan 27, 2021 at 10:40 PM Andres Freund <andres@anarazel.de> wrote:
>
> Hi,
>
> On 2021-01-27 19:05:16 +0530, vignesh C wrote:
>
> > /*
> > + * LogBackTrace
> > + *
> > + * Get the backtrace and log the backtrace to log file.
> > + */
> > +void
> > +LogBackTrace(void)
> > +{
> > + int save_errno = errno;
> > +
> > + void *buf[100];
> > + int nframes;
> > + char **strfrms;
> > + StringInfoData errtrace;
> > +
> > + /* OK to process messages. Reset the flag saying there are more to do. */
> > + PrintBacktracePending = false;
>
> ISTM that it'd be better to do this in the caller, allowing this
> function to be used outside of signal triggered backtraces.
>
> >
> > +extern void LogBackTrace(void); /* Called from EmitProcSignalPrintCallStack */
>
> I don't think this comment is correct anymore?
Thanks for the comments, I have fixed and attached an updated patch
with the fixes for the same.
Thoughts?
Regards,
Vignesh
Commits
-
Perform apply of large transactions by parallel workers.
- 216a784829c2 16.0 cited
-
Enhance pg_log_backend_memory_contexts() for auxiliary processes.
- 790fbda90209 15.0 cited
-
Allow GRANT on pg_log_backend_memory_contexts().
- f0b051e322d5 15.0 cited
-
Move Perl test modules to a better namespace
- b3b4d8e68ae8 15.0 cited
-
Unify PostgresNode's new() and get_new_node() methods
- 201a76183e20 15.0 cited
-
Add backtrace support for error reporting
- 71a8a4f6e365 13.0 cited