Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ $(OUTPUT) $(OBJDIR):

# arg_types.c/cxx_arg_types.cpp generate "warning: unsupported size for integer register"
$(OBJDIR)/arg_types.o: CFLAGS += -w
$(OBJDIR)/long_nop_usdt.o: CFLAGS += -w
$(OBJDIR)/cxx_arg_types.opp: CXXFLAGS += -w
$(OBJDIR)/cxx_long_nop_usdt.opp: CXXFLAGS += -w

$(OBJDIR)/%.o: %.c $(wildcard *.h) | $(OBJDIR)
$(call msg,CC,$@)
Expand Down
5 changes: 5 additions & 0 deletions tests/cxx_long_nop_usdt.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// SPDX-License-Identifier: BSD-2-Clause
#if __x86_64__
#define USDT_NOP .byte 0x0f, 0x1f, 0x44, 0x00, 0x00 /* nop5 */
#endif
#include "cxx_arg_types.cpp"
5 changes: 5 additions & 0 deletions tests/long_nop_usdt.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// SPDX-License-Identifier: BSD-2-Clause
#if __x86_64__
#define USDT_NOP .byte 0x0f, 0x1f, 0x44, 0x00, 0x00 /* nop5 */
#endif
#include "arg_types.c"
21 changes: 15 additions & 6 deletions usdt.h
Original file line number Diff line number Diff line change
Expand Up @@ -348,11 +348,20 @@ struct usdt_sema { volatile unsigned short active; };
#define __usdt_asm_name(name) __asm__(__usdt_str(name))
#endif

#define __usdt_asm1(a) __usdt_str(a) "\n"
#define __usdt_asm2(a,b) __usdt_str(a) "," __usdt_str(b) "\n"
#define __usdt_asm3(a,b,c) __usdt_str(a) "," __usdt_str(b) "," __usdt_str(c) "\n"
#define __usdt_asm5(a,b,c,d,e) __usdt_str(a) "," __usdt_str(b) "," __usdt_str(c) "," \
__usdt_str(d) "," __usdt_str(e) "\n"
#define __usdt_asm0() "\n"
#define __usdt_asm1(x) __usdt_str(x) "\n"
#define __usdt_asm2(x, ...) __usdt_str(x) "," __usdt_asm1(__VA_ARGS__)
#define __usdt_asm3(x, ...) __usdt_str(x) "," __usdt_asm2(__VA_ARGS__)
#define __usdt_asm4(x, ...) __usdt_str(x) "," __usdt_asm3(__VA_ARGS__)
#define __usdt_asm5(x, ...) __usdt_str(x) "," __usdt_asm4(__VA_ARGS__)
#define __usdt_asm6(x, ...) __usdt_str(x) "," __usdt_asm5(__VA_ARGS__)
#define __usdt_asm7(x, ...) __usdt_str(x) "," __usdt_asm6(__VA_ARGS__)
#define __usdt_asm8(x, ...) __usdt_str(x) "," __usdt_asm7(__VA_ARGS__)
#define __usdt_asm9(x, ...) __usdt_str(x) "," __usdt_asm8(__VA_ARGS__)
#define __usdt_asm10(x, ...) __usdt_str(x) "," __usdt_asm9(__VA_ARGS__)
#define __usdt_asm11(x, ...) __usdt_str(x) "," __usdt_asm10(__VA_ARGS__)
#define __usdt_asm12(x, ...) __usdt_str(x) "," __usdt_asm11(__VA_ARGS__)
#define __usdt_asm(...) __usdt_apply(__usdt_asm, __usdt_narg(__VA_ARGS__))(__VA_ARGS__)

#ifdef __LP64__
#define __usdt_asm_addr .8byte
Expand Down Expand Up @@ -398,7 +407,7 @@ struct usdt_sema { volatile unsigned short active; };
#define __usdt_probe(group, name, sema_def, sema, ...) do { \
sema_def(sema) \
__asm__ __volatile__ ( \
__usdt_asm1(990: USDT_NOP) \
__usdt_asm( 990: USDT_NOP) \
__usdt_asm3( .pushsection .note.stapsdt, "", "note") \
__usdt_asm1( .balign 4) \
__usdt_asm3( .4byte 992f-991f,994f-993f,3) \
Expand Down