From: Martin Martin <martin@infinio.com>
To: systemtap@sourceware.org
Subject: DTRACE_PROBE macro fails to compile with Clang++
Date: Wed, 11 Sep 2013 17:32:00 -0000 [thread overview]
Message-ID: <CAAQ0mPgq32wUcFVX824duqR8k=cg-9ToLLY6WaD=mv41nzktDw@mail.gmail.com> (raw)
The following code:
#include <sys/sdt.h>
int main() {
DTRACE_PROBE(a, b);
}
compiles with with G++, but when compiled with clang++ 3.3 gives:
clang++ dtrace_probe.cpp
dtrace_probe.cpp:4:5: error: unknown flag
DTRACE_PROBE(a, b);
^
/usr/include/sys/sdt.h:362:3: note: expanded from macro 'DTRACE_PROBE'
STAP_PROBE(provider,probe)
^
/usr/include/sys/sdt.h:254:3: note: expanded from macro 'STAP_PROBE'
_SDT_PROBE(provider, name, 0, ())
^
/usr/include/sys/sdt.h:36:27: note: expanded from macro '_SDT_PROBE'
__asm__ __volatile__ (_SDT_ASM_BODY(provider, name, _SDT_ASM_ARGS, (n)) \
^
note: (skipping 1 expansions in backtrace; use
-fmacro-backtrace-limit=0 to see all)
/usr/include/sys/sdt.h:43:31: note: expanded from macro '_SDT_ASM_3'
# define _SDT_ASM_3(a, b, c) _SDT_S(a) "," _SDT_S(b) "," \
^
/usr/include/sys/sdt.h:40:22: note: expanded from macro '_SDT_S'
# define _SDT_S(x) #x
^
<scratch space>:9:2: note: expanded from here
".pushsection .note.stapsdt"
^
<inline asm>:2:31: note: instantiated into assembly here
.pushsection .note.stapsdt,"?","note"
^
dtrace_probe.cpp:4:5: error: .popsection without corresponding .pushsection
DTRACE_PROBE(a, b);
^
/usr/include/sys/sdt.h:362:3: note: expanded from macro 'DTRACE_PROBE'
STAP_PROBE(provider,probe)
^
/usr/include/sys/sdt.h:254:3: note: expanded from macro 'STAP_PROBE'
_SDT_PROBE(provider, name, 0, ())
^
/usr/include/sys/sdt.h:36:27: note: expanded from macro '_SDT_PROBE'
__asm__ __volatile__ (_SDT_ASM_BODY(provider, name, _SDT_ASM_ARGS, (n)) \
^
note: (skipping 1 expansions in backtrace; use
-fmacro-backtrace-limit=0 to see all)
/usr/include/sys/sdt.h:41:26: note: expanded from macro '_SDT_ASM_1'
# define _SDT_ASM_1(x) _SDT_S(x) "\n"
^
/usr/include/sys/sdt.h:40:22: note: expanded from macro '_SDT_S'
# define _SDT_S(x) #x
^
<scratch space>:29:2: note: expanded from here
".popsection"
^
<inline asm>:14:12: note: instantiated into assembly here
.popsection
^
dtrace_probe.cpp:4:5: error: expected '@' or '%' before type
DTRACE_PROBE(a, b);
^
/usr/include/sys/sdt.h:362:3: note: expanded from macro 'DTRACE_PROBE'
STAP_PROBE(provider,probe)
^
/usr/include/sys/sdt.h:254:3: note: expanded from macro 'STAP_PROBE'
_SDT_PROBE(provider, name, 0, ())
^
/usr/include/sys/sdt.h:38:27: note: expanded from macro '_SDT_PROBE'
__asm__ __volatile__ (_SDT_ASM_BASE); \
^
note: (skipping 1 expansions in backtrace; use
-fmacro-backtrace-limit=0 to see all)
/usr/include/sys/sdt.h:45:36: note: expanded from macro '_SDT_ASM_5'
# define _SDT_ASM_5(a, b, c, d, e) _SDT_S(a) "," _SDT_S(b) "," \
^
/usr/include/sys/sdt.h:40:22: note: expanded from macro '_SDT_S'
# define _SDT_S(x) #x
^
<scratch space>:32:2: note: expanded from here
".pushsection .stapsdt.base"
^
<inline asm>:2:33: note: instantiated into assembly here
.pushsection .stapsdt.base,"aG","progbits",.stapsdt.base,comdat
^
dtrace_probe.cpp:4:5: error: .popsection without corresponding .pushsection
DTRACE_PROBE(a, b);
^
/usr/include/sys/sdt.h:362:3: note: expanded from macro 'DTRACE_PROBE'
STAP_PROBE(provider,probe)
^
/usr/include/sys/sdt.h:254:3: note: expanded from macro 'STAP_PROBE'
_SDT_PROBE(provider, name, 0, ())
^
/usr/include/sys/sdt.h:38:27: note: expanded from macro '_SDT_PROBE'
__asm__ __volatile__ (_SDT_ASM_BASE); \
^
note: (skipping 1 expansions in backtrace; use
-fmacro-backtrace-limit=0 to see all)
/usr/include/sys/sdt.h:41:26: note: expanded from macro '_SDT_ASM_1'
# define _SDT_ASM_1(x) _SDT_S(x) "\n"
^
/usr/include/sys/sdt.h:40:22: note: expanded from macro '_SDT_S'
# define _SDT_S(x) #x
^
<scratch space>:42:2: note: expanded from here
".popsection"
^
<inline asm>:7:12: note: instantiated into assembly here
.popsection
^
4 errors generated.
$ clang++ --version
clang version 3.3 (tags/RELEASE_33/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
next reply other threads:[~2013-09-11 17:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-11 17:32 Martin Martin [this message]
2013-09-11 17:38 ` Daniel P. Berrange
2013-09-11 17:45 ` Mark Wielaard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAAQ0mPgq32wUcFVX824duqR8k=cg-9ToLLY6WaD=mv41nzktDw@mail.gmail.com' \
--to=martin@infinio.com \
--cc=systemtap@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).