Re: Compiler warnings with --enable-dtrace - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: Compiler warnings with --enable-dtrace
Date
Msg-id CAH2-WznHEfw6jJiyH8mBLPT=VKcLyOfwjXEQCHidCkDNv72PSA@mail.gmail.com
Whole thread Raw
In response to Re: Compiler warnings with --enable-dtrace  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Compiler warnings with --enable-dtrace  (Christoph Berg <myon@debian.org>)
List pgsql-hackers
On Mon, May 7, 2018 at 9:42 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Thomas Munro <thomas.munro@enterprisedb.com> writes:
>> --enable-dtrace produces compiler warnings about const correctness,
>> except on macOS.  That's because Apple's dtrace produces function
>> declarations in probes.h that take strings as const char * whereas
>> AFAIK on all other operating systems they take char * (you can see
>> that possibly recent difference in Apple's version of dt_header_decl()
>> in dt_program.c).  People have complained before[1].
>
> Yeah, it's a bit annoying, although AFAICT hardly anyone uses dtrace.

You're probably right about that, but the "--enable-dtrace" configure
option is another matter. I started to use it for release builds on my
personal Linux system a few months back, though not because I am a
SystemTap user.

lwn.net had a great (subscriber only) article just today about new
Linux tooling for USDT probes [1]. The BPF/BCC + USDT stuff only
became available in the last year or so. It seems like a technology
that has the potential to be enormously useful for debugging complex
production issues, while still being relatively easy to use. The BCC
"trace" utility [2] can be used to produce simple one-liners that spit
out interesting information about a running Postgres instance. It
seems to be surprisingly low overhead in many cases.

I've been meaning to do a write-up on all of this to make it more
accessible, though it's already quite accessible.

[1] https://lwn.net/Articles/753601/
[2] https://github.com/iovisor/bcc/blob/master/tools/trace_example.txt
-- 
Peter Geoghegan


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: allow psql to watch \dt
Next
From: Christoph Berg
Date:
Subject: Re: Compiler warnings with --enable-dtrace