Re: Compiler warnings with --enable-dtrace

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Compiler warnings with --enable-dtrace
Date: 2018-05-12 02:24:41
Message-ID: CAH2-WznHEfw6jJiyH8mBLPT=VKcLyOfwjXEQCHidCkDNv72PSA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, May 7, 2018 at 9:42 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Christoph Berg 2018-05-12 06:46:12 Re: Compiler warnings with --enable-dtrace
Previous Message Tom Lane 2018-05-12 01:30:01 Re: allow psql to watch \dt