# regex/regerrs.h is not meant to be included standalone.
 # parser/gram.h will be included by parser/gramparse.h.
 # parser/kwlist.h is not meant to be included standalone.
+# pg_trace.h and utils/probes.h can include sys/sdt.h from SystemTap,
+# which itself contains C++ code and so won't compile with a C++
+# compiler under extern "C" linkage.
 
 for f in `find src/include src/interfaces/libpq/libpq-fe.h src/interfaces/libpq/libpq-events.h -name '*.h' -print | \
     grep -v -e ^src/include/port/ \
    -e ^src/include/rusagestub.h -e ^src/include/regex/regerrs.h \
-   -e ^src/include/parser/gram.h -e ^src/include/parser/kwlist.h`
+   -e ^src/include/parser/gram.h -e ^src/include/parser/kwlist.h \
+   -e ^src/include/pg_trace.h -e ^src/include/utils/probes.h`
 do
    {
        echo ' extern "C" {'