#define pt_dwarf_register_13(regs) regs->r13
#define pt_dwarf_register_14(regs) regs->r14
#define pt_dwarf_register_15(regs) regs->r15
-#define pt_regs_maxno 15
+#define pt_dwarf_register_17(regs) ({uint64_t v; __asm__ __volatile__("movq %%xmm0, %0" : "=r"(v)); v;})
+#define pt_dwarf_register_18(regs) ({uint64_t v; __asm__ __volatile__("movq %%xmm1, %0" : "=r"(v)); v;})
+#define pt_dwarf_register_19(regs) ({uint64_t v; __asm__ __volatile__("movq %%xmm2, %0" : "=r"(v)); v;})
+#define pt_dwarf_register_20(regs) ({uint64_t v; __asm__ __volatile__("movq %%xmm3, %0" : "=r"(v)); v;})
+#define pt_dwarf_register_21(regs) ({uint64_t v; __asm__ __volatile__("movq %%xmm4, %0" : "=r"(v)); v;})
+#define pt_dwarf_register_22(regs) ({uint64_t v; __asm__ __volatile__("movq %%xmm5, %0" : "=r"(v)); v;})
+#define pt_dwarf_register_23(regs) ({uint64_t v; __asm__ __volatile__("movq %%xmm6, %0" : "=r"(v)); v;})
+#define pt_dwarf_register_24(regs) ({uint64_t v; __asm__ __volatile__("movq %%xmm7, %0" : "=r"(v)); v;})
+#define pt_dwarf_register_25(regs) ({uint64_t v; __asm__ __volatile__("movq %%xmm8, %0" : "=r"(v)); v;})
+#define pt_dwarf_register_26(regs) ({uint64_t v; __asm__ __volatile__("movq %%xmm9, %0" : "=r"(v)); v;})
+#define pt_dwarf_register_27(regs) ({uint64_t v; __asm__ __volatile__("movq %%xmm10, %0" : "=r"(v)); v;})
+#define pt_dwarf_register_28(regs) ({uint64_t v; __asm__ __volatile__("movq %%xmm11, %0" : "=r"(v)); v;})
+#define pt_dwarf_register_29(regs) ({uint64_t v; __asm__ __volatile__("movq %%xmm12, %0" : "=r"(v)); v;})
+#define pt_dwarf_register_30(regs) ({uint64_t v; __asm__ __volatile__("movq %%xmm13, %0" : "=r"(v)); v;})
+#define pt_dwarf_register_31(regs) ({uint64_t v; __asm__ __volatile__("movq %%xmm14, %0" : "=r"(v)); v;})
+#define pt_dwarf_register_32(regs) ({uint64_t v; __asm__ __volatile__("movq %%xmm15, %0" : "=r"(v)); v;})
+#define pt_regs_maxno 32
#elif defined __powerpc__
//#include <stdbool.h>
//#include <stdint.h>
+/* --dyninst includes stdint.h so avoid stdint.h conflicts
+ * INT64_C and UINT64_C are macros so undef them
+ * *fast* are typedefs so define them
+ * TODO: Consider changing softfloat to use stdint defs
+ */
+#undef INT64_C
+#undef UINT64_C
+#define int_fast16_t sf_int_fast16_t
+#define uint_fast16_t sf_uint_fast16_t
+#define int_fast32_t sf_int_fast32_t
+#define uint_fast32_t sf_uint_fast32_t
#include "softfloat/platform.h"
#include "softfloat/internals.h"
#include "softfloat.h"
# 1. Test executable built with dtrace generated header file
foreach runtime [get_runtime_list] {
+ if {$runtime == "dyninst" && $pbtype_mssg != "V3_uprobe"} {
+ continue }
set test_xtra ""
if {$runtime != ""} {
set test_xtra " ($runtime)"
}
foreach runtime [get_runtime_list] {
+ if {$runtime == "dyninst" && $pbtype_mssg != "V3_uprobe"} {
+ continue }
set test_xtra ""
if {$runtime != ""} {
set test_xtra " ($runtime)"
# On ARM these tests are known to fail with timeout for V1
# and V2 probes. Skip them altogether to speed execution.
if {[istarget "arm*-*-*"] \
- && ($pbtype_mssg == "V1_uprobe" \
- || $pbtype_mssg == "V2_kprobe" \
- || $pbtype_mssg == "V2_uprobe")} {
+ && ($pbtype_mssg == "V1_uprobe" || $pbtype_mssg == "V2_uprobe")} {
xfail "$test types $test_suffix"
continue
}
}
foreach runtime [get_runtime_list] {
+ if {$runtime == "dyninst" && $pbtype_mssg != "V3_uprobe"} {
+ continue }
set test_xtra ""
if {$runtime != ""} {
set test_xtra " ($runtime)"
set notok 0
set fail ""
set uns_notok 0
+ set float_notok 0
expect {
-timeout 180
# i386 unsigned may xfail because of sign extension
set s $expect_out(1,string);
if {[regexp "unsigned" $s] && [istarget "i*86-*-*"]} {
incr uns_notok }
+ if {[regexp "float" $s] || [regexp "double" $s]} {
+ incr float_notok }
incr notok; set fail "$fail $s"; exp_continue }
-re {^[^\r]*\r\n} { incr notok; exp_continue }
timeout { fail "$test types (timeout) $test_suffix" }
catch {close}; catch {wait}
if { $notok != 0 || $ok == 0} {
- if { [lindex $type_xfail $j] || $notok == $uns_notok} {
+ if { $notok == $float_notok } {
+ # Ignore float failures for V1, V2, and dyninst
+ if { $pbtype_mssg != "V3_uprobe" || $runtime == "dyninst" } {
+ pass "$test types $test_suffix"
+ } else {
+ incr fail_count
+ fail "$test types $fail $test_suffix"
+ }
+ } elseif { [lindex $type_xfail $j] || $notok == $uns_notok } {
xfail "$test types $fail $test_suffix"
} else {
incr fail_count
}
foreach runtime [get_runtime_list] {
+ if {$runtime == "dyninst" && $pbtype_mssg != "V3_uprobe"} {
+ continue }
set test_xtra ""
if {$runtime != ""} {
set test_xtra " ($runtime)"
}
foreach runtime [get_runtime_list] {
+ if {$runtime == "dyninst" && $pbtype_mssg != "V3_uprobe"} {
+ continue }
set test_xtra ""
if {$runtime != ""} {
set test_xtra " ($runtime)"
# 7. Test V3 $$parms support
foreach runtime [get_runtime_list] {
+ if {$runtime == "dyninst" && $pbtype_mssg != "V3_uprobe"} {
+ continue }
set test_xtra ""
if {$runtime != ""} {
set test_xtra " ($runtime)"
#include "sys/sdt.h"
#include <stdint.h>
#include <values.h>
+#include <stdio.h>
struct opaque;
long int * volatile long_int_ptr_volatile_var = &long_int_var;
/* c89 doesn't define __STDC_VERSION. With -pedantic warns about long long. */
+
#if ! defined NO_LONG_LONG && __SIZEOF_SIZE_T__ == 8
long long int long_long_int_var = 0x7fffffffffffffffLL;
const long long int const_long_long_int_var = -0x7fffffffffffffffLL;
struct opaque_struct *incomplete_struct_type = 0;
# endif
+ float float_var;
+ double double_var;
+ /* Avoid float_var being treated as .Label(Reg) which is not supported by stap */
+ sscanf("3.14159", "%f", &float_var);
+ double_var = (double)float_var;
+
/* gnu90 and gnu99 don't support this so for now don't test it
enum opaque_enum *incomplete_enum_type = 0; */
STAP_PROBE2(provider,ptr_volatile_long_int_var,ptr_volatile_long_int_var,&long_int_var);
STAP_PROBE2(provider,long_int_ptr_volatile_var,long_int_ptr_volatile_var,&long_int_var);
+ /* float / double */
+ STAP_PROBE1(provider,float_var,float_var);
+ STAP_PROBE1(provider,double_var,double_var);
+
/* long long */
#if ! defined NO_LONG_LONG && __SIZEOF_SIZE_T__ == 8
STAP_PROBE1(provider,long_long_int_var,long_long_int_var);
printf ("sdt_types FAIL: %s (%#x != %#x)\n", name, value, expected)
}
+function check_float(name, value, expected, need_double)
+{
+ if (need_double)
+ value = fp32_to_fp64(value)
+ range = string_to_fp("0.00001")
+ /* Check that value is in the interval [expected - range < x < expected + range] */
+ if (fp_le(fp_sub(expected,range),value) && fp_le(value,fp_add(expected,range)))
+ printf ("sdt_types PASS: %s\n", name)
+ else
+ printf ("sdt_types FAIL: %s (%s != %s)\n", name, fp_to_string(value,8), fp_to_string(expected,8))
+}
+
function check_string(name, value, expected)
{
if (value == expected)
}
+/********** float / double **********/
+
+probe process(@1).mark("float_var")
+{
+ check_float($$name, $arg1, string_to_fp("3.14159"),1)
+}
+
+probe process(@1).mark("double_var")
+{
+ check_float($$name, $arg1, string_to_fp("3.14159"),0)
+}
+
/********** long long **********/
probe process(@1).mark("long_long_int_var") ?