some v2 patches
Here are some v2 patches. (I suppose they're really v3, but let us ignore the original 14-patch series.) Notice that two patches underwent name changes:
#29:
old: Allow relocation of the ERROR PRID
new: Set the ERROR PRID in BPF code
#36:
old: Inline copyout_val()
new: Simplify trampoline_is_enabled()
PATCH v2 32/38 Widen the EPID to include the PRID
From: Eugene Loh <[email protected]>
Each output record has a EPID associated with it, allowing the consumer to get both a data description and a PRID (so it can report PRID and probe function and name). We want to support uprobes that trigger for multiple PRIDs, however, basically breaking this scheme.
So, expand the EPID to 64 bits, half for the old-style EPID (based on static information about the D programs) and half for the PRID (discovered at run time).
The EPID seen by compile-time files like dt_cc.c or dt_map.c are still the old-style EPIDs (even if now 64-bit) since they have no knowledge of the run-time PRIDs.
Further, we do not need to expand:
- the mstate (since it already had the PRID anyhow)
- the output buffer (since it already had an unused 4-byte pad)
The combination of EPID and PRID is for the built-in variable epid as well as what the consumer reads.
--- bpf/get_bvar.c | 6 ++- bpf/probe_error.c | 2 +- include/dtrace/universal.h | 2 +- libdtrace/dt_bpf.c | 2 - libdtrace/dt_cg.c | 43 +++++++++++-------- libdtrace/dt_consume.c | 28 ++++++++---- libdtrace/dt_dctx.h | 12 ++++-- libdtrace/dt_handle.c | 9 ++-- libdtrace/dt_map.c | 3 ++ libdtrace/dt_open.c | 2 +- test/demo/dtrace/error.r | 2 +- test/stress/buffering/tst.resize3-manual.r | 2 +- test/stress/buffering/tst.resize3.r | 2 +- test/unittest/actions/setopt/tst.badopt.r | 14 +++--- .../arrays/tst.declared-bounds.runtime_out.r | 2 +- test/unittest/codegen/err.deref_0.r | 2 +- test/unittest/codegen/err.deref_1.r | 2 +- test/unittest/codegen/err.deref_i0.r | 2 +- test/unittest/codegen/err.deref_i1.r | 2 +- .../unittest/codegen/err.deref_string-assoc.r | 2 +- test/unittest/codegen/err.deref_string-gvar.r | 2 +- test/unittest/codegen/err.deref_string-lvar.r | 2 +- test/unittest/codegen/err.deref_string-tvar.r | 2 +- .../codegen/err.str_NULL_plus_offset-assoc.r | 2 +- .../codegen/err.str_NULL_plus_offset-lvar.r | 2 +- .../codegen/err.str_NULL_plus_offset-tvar.r | 2 +- .../codegen/err.str_NULL_plus_offset.r | 2 +- test/unittest/disasm/tst.vartab-bvar.r | 2 +- .../tst.DTRACEFLT_BADADDR.null_ptr_field.r | 2 +- test/unittest/error/tst.DTRACEFLT_BADADDR.r | 4 +- .../error/tst.DTRACEFLT_DIVZERO.div.r | 2 +- .../error/tst.DTRACEFLT_DIVZERO.mod.r | 2 +- test/unittest/error/tst.DTRACEFLT_UNKNOWN.r | 4 +- .../error/tst.clause_scope-begin-ended.r | 2 +- test/unittest/error/tst.clause_scope-begin.r | 2 +- .../error/tst.clause_scope-regular.r.p | 12 +++++- test/unittest/error/tst.error.r | 2 +- test/unittest/error/tst.errorend.r | 2 +- .../alloca/err.alloca-bcopy-before-beyond.r | 2 +- .../alloca/err.alloca-bcopy-before-bottom.r | 2 +- .../alloca/err.alloca-bcopy-beyond-top.r | 2 +- .../alloca/err.alloca-bcopy-crossing-bottom.r | 2 +- .../alloca/err.alloca-bcopy-crossing-top.r | 2 +- .../alloca/err.alloca-crossing-clauses.r | 2 +- .../alloca/err.alloca-load-before-bottom.r | 2 +- .../funcs/alloca/err.alloca-load-beyond-top.r | 2 +- .../alloca/err.alloca-load-crossing-bottom.r | 2 +- .../alloca/err.alloca-null-deref-lvalue.r | 2 +- .../funcs/alloca/err.alloca-null-deref.r | 2 +- .../err.alloca-scratch-exceeding-bcopy.r | 2 +- .../alloca/err.alloca-store-before-bottom.r | 2 +- .../alloca/err.alloca-store-beyond-top.r | 2 +- .../alloca/err.alloca-store-crossing-bottom.r | 2 +- test/unittest/funcs/bcopy/err.badbcopy1.r | 2 +- test/unittest/funcs/bcopy/err.badbcopy4.r | 2 +- test/unittest/funcs/bcopy/err.badbcopy5.r | 2 +- test/unittest/funcs/bcopy/err.badbcopy6.r | 2 +- test/unittest/funcs/bcopy/err.badbcopy7.r | 2 +- test/unittest/funcs/bcopy/err.badbcopy8.r | 2 +- test/unittest/funcs/copyin/err.badaddr.r | 2 +- test/unittest/funcs/copyin/err.null_arg1.r | 2 +- test/unittest/funcs/copyinstr/err.badaddr.r | 2 +- test/unittest/funcs/copyinstr/err.null_arg1.r | 2 +- test/unittest/funcs/copyinto/err.badaddr.r | 2 +- test/unittest/funcs/copyinto/err.badsize.r | 2 +- test/unittest/funcs/copyinto/err.null_arg1.r | 2 +- test/unittest/funcs/err.badalloca.r.p | 12 +++++- test/unittest/funcs/err.link_ntopbadaddr.r | 2 +- test/unittest/funcs/err.link_ntopbadarg.r | 2 +- .../inet_ntoa6/err.inet_ntoa6.arg1_null.r | 2 +- .../err.inet_ntoa6.arg1_null_const.r | 2 +- test/unittest/funcs/strlen/tst.null.r | 2 +- test/unittest/funcs/strtok/tst.strtok_null.r | 2 +- .../funcs/strtok/tst.strtok_nulldel.r | 2 +- .../funcs/strtok/tst.strtok_nullstr.r | 2 +- .../funcs/strtok/tst.strtok_nullstr2.r | 2 +- .../funcs/substr/err.substr_null_arg1.r | 2 +- test/unittest/pointers/err.AllocaOverrun.r | 2 +- test/unittest/pointers/err.BadAlign.r | 2 +- test/unittest/pointers/err.InvalidAddress2.r | 2 +- test/unittest/pointers/err.InvalidAddress4.r | 2 +- .../speculation/err.CommitWithInvalid.r | 2 +- .../speculation/err.DiscardWithInvalid.r | 2 +- .../speculation/tst.SpecSizeVariations.r | 22 ---------- .../speculation/tst.SpecSizeVariations.sh | 2 +- test/unittest/speculation/tst.negcommit.r | 2 +- 86 files changed, 169 insertions(+), 148 deletions(-)
bpf/get_bvar.c +4 -2
@@ -48,8 +48,10 @@ noinline uint64_t dt_get_bvar(const dt_dctx_t *dctx, uint32_t id, uint32_t idx) mst->tstamp =bpf_ktime_get_ns ();return mst->tstamp; -case DIF_VAR_EPID : -return mst->epid; +case DIF_VAR_EPID : { +uint64_t val = mst->prid; +return (val <<32 ) | mst->epid; + }case DIF_VAR_ID :return mst->prid;case DIF_VAR_ARG0 :case DIF_VAR_ARG1 :case DIF_VAR_ARG2 :
bpf/probe_error.c +1 -1
@@ -31,7 +31,7 @@ noinline void dt_probe_error(const dt_dctx_t *dctx, uint64_t pc, uint64_t fault,int oldprid = mst->prid; mst->argv[0 ] =0 ; - mst->argv[1 ] = mst->epid; + mst->argv[1 ] = (((uint64_t )mst->prid) <<32 ) | mst->epid; mst->argv[2 ] = mst->clid; mst->argv[3 ] = pc; mst->argv[4 ] = fault;
include/dtrace/universal.h +1 -1
@@ -37,7 +37,7 @@ typedef uint16_t dtrace_actkind_t; /* action kind */typedef uint32_t dtrace_aggid_t ;/* aggregation identifier */ typedef uint32_t dtrace_cacheid_t ;/* predicate cache identifier */ -typedef uint32_t dtrace_epid_t ;/* enabled probe identifier */ +typedef uint64_t dtrace_epid_t ;/* enabled probe identifier */ typedef uint32_t dtrace_optid_t ;/* option identifier */ typedef uint32_t dtrace_specid_t ;/* speculation identifier */
libdtrace/dt_bpf.c +0 -2
@@ -778,7 +778,6 @@ gmap_create_cpuinfo(dtrace_hdl_t *dtp)* The size of the memory region is the sum of: * - size of the DTrace machine state, rounded up to the nearest * multiple of 8 -* - 8 bytes padding for trace buffer alignment purposes * - maximum trace buffer record size, rounded up to the nearest * multiple of 8 * - size of dctx->mem (see dt_dctx.h)
@@ -787,7 +786,6 @@ static int gmap_create_mem(dtrace_hdl_t *dtp) {size_t sz =roundup (sizeof (dt_mstate_t),8 ) + -8 +roundup (dtp->dt_maxreclen,8 ) +DMEM_SIZE (dtp);
libdtrace/dt_cg.c +26 -17
96 lines not on this page · raw message
libdtrace/dt_consume.c +19 -9
@@ -14,9 +14,11 @@#include <ctype.h> #include <alloca.h> #include <dt_impl.h> +#include <dt_dctx.h> #include <dt_module.h> #include <dt_pcap.h> #include <dt_peb.h> +#include <dt_probe.h> #include <dt_state.h> #include <dt_string.h> #include <libproc.h>
@@ -478,7 +480,7 @@ dt_flowindent(dtrace_hdl_t *dtp, dtrace_probedata_t *data, dtrace_epid_t last)*/ if (flow ==DTRACEFLOW_ENTRY ) {if (last !=DTRACE_EPIDNONE && id != last && - pd->id == dtp->dt_pdesc[last]->id) + pd->id == dtp->dt_probes[last >>32 ]->desc->id) flow =DTRACEFLOW_NONE ; }
@@ -2202,19 +2204,23 @@ dt_consume_one_probe(dtrace_hdl_t *dtp, FILE *fp, char *data, uint32_t size, int peekflags, dtrace_epid_t *last, int committing, void *arg) { + int specid;dtrace_epid_t epid; +uint32_t prid;dtrace_datadesc_t *epd;dt_spec_buf_t tmpl;dt_spec_buf_t *dtsb; -int specid;int i;int rval;dtrace_workstatus_t ret;int commit_discard_seen, only_commit_discards;int data_recording =1 ; - epid = ((uint32_t *)data)[0 ]; - specid = ((uint32_t *)data)[1 ]; + specid = *((uint32_t *)(data +DBUF_SPECID )); + epid = *((uint64_t *)(data +DBUF_EPID )); + prid = epid >>32 ; +if (prid > dtp->dt_probe_id) +return dt_set_errno (dtp,EDT_BADEPID );/* * Fill in the epid and address of the epid in the buffer. We need to
@@ -2227,6 +2233,7 @@ dt_consume_one_probe(dtrace_hdl_t *dtp, FILE *fp, char *data, uint32_t size, &pdat->dtpda_pdesc);if (rval !=0 )return dt_set_errno (dtp,EDT_BADEPID ); + pdat->dtpda_pdesc = (dtrace_probedesc_t *)dtp->dt_probes[prid]->desc; epd = pdat->dtpda_ddesc;if (epd->dtdd_uarg !=DT_ECB_DEFAULT ) {
@@ -2661,9 +2668,8 @@ dt_consume_one(dtrace_hdl_t *dtp, FILE *fp, char *buf,* struct { * struct perf_event_header header; * uint32_t size; -* uint32_t pad; -* uint32_t epid; * uint32_t specid; +* dtrace_epid_t epid; * uint64_t data[n]; * } * and 'data' points to the 'size' member at this point.
@@ -2673,13 +2679,17 @@ dt_consume_one(dtrace_hdl_t *dtp, FILE *fp, char *buf,return dt_set_errno (dtp,EDT_DSIZE ); size = *(uint32_t *)data; - data +=sizeof (size); ptr +=sizeof (size) + size;if (ptr != buf + hdr->size)return dt_set_errno (dtp,EDT_DSIZE ); - data +=sizeof (uint32_t );/* skip padding */ - size -=sizeof (uint32_t ); +/* +* The "size" measures from specid to the end. But our buffer +* offsets are relative to &size itself, to preserve 8-byte +* alignment. So, we leave data pointing at size, and we increase +* size by 4 bytes. +*/ + size +=4 ; return dt_consume_one_probe(dtp, fp, data, size, pdat, efunc, rfunc, flow, quiet, peekflags,
libdtrace/dt_dctx.h +8 -4
@@ -82,16 +82,20 @@ typedef struct dt_dctx {* The dctx->buf pointer references a block of memory that contains: * * +----------------+ -* 0 -> | EPID | +* 0 -> | pad | * +----------------+ -* 4 -> | Speculation ID | +* 4 -> | Speculation ID | * +----------------+ -* | Trace Data | +* 8 -> | EPID | +* +----------------+ +* 16 -> | Trace Data | * | ... | * +----------------+ */ -#define DBUF_EPID 0 +#define DBUF_PAD 0#define DBUF_SPECID 4 +#define DBUF_EPID 8 +#define DBUF_DATA 16/* * The dctx->mem pointer references a block of memory that contains:
libdtrace/dt_handle.c +5 -4
@@ -14,6 +14,7 @@#include <alloca.h> #include <dt_impl.h> +#include <dt_probe.h> #include <dt_program.h> static const char _dt_errprog[] =
@@ -147,11 +148,11 @@ dt_handle_err(dtrace_hdl_t *dtp, dtrace_probedata_t *data)* This is an error. We have the following items here: EPID, * faulting action, BPF pc, fault code and faulting address. */ - epid = (uint32_t )DT_REC (uint64_t,0 ); + epid =DT_REC (uint64_t,0 );if (dt_epid_lookup (dtp, epid, &errdd, &errpd) !=0 )return dt_set_errno (dtp,EDT_BADERROR ); - + errpd = (dtrace_probedesc_t *)dtp->dt_probes[epid>>32 ]->desc; err.dteda_ddesc = errdd; err.dteda_pdesc = errpd; err.dteda_cpu = data->dtpda_cpu;
@@ -195,7 +196,7 @@ no_addr: details[0 ] =0 ; } - snprintf(str, len, "error on enabled probe ID %u (ID %u: %s:%s:%s:%s): " + snprintf(str, len, "error on enabled probe ID %lu (ID %u: %s:%s:%s:%s): " "%s%s in %s%s", epid, errpd->id, errpd->prv, errpd->mod, errpd->fun, errpd->prb, dtrace_faultstr(dtp, err.dteda_fault), details,
@@ -256,7 +257,7 @@ dt_handle_liberr(dtrace_hdl_t *dtp, const dtrace_probedata_t *data, str =alloca (len);snprintf (str, len, -"error on enabled probe ID %u (ID %u: %s:%s:%s:%s): %s" , +"error on enabled probe ID %lu (ID %u: %s:%s:%s:%s): %s" , data->dtpda_epid, errpd->id, errpd->prv, errpd->mod, errpd->fun, errpd->prb, faultstr);
libdtrace/dt_map.c +3 -0
@@ -137,6 +137,9 @@ int dt_epid_lookup(dtrace_hdl_t *dtp, dtrace_epid_t epid, dtrace_datadesc_t **ddp, dtrace_probedesc_t **pdp) { +/* Remove the PRID portion of the EPID. */ + epid &=0xffffffff ; +if (epid >= dtp->dt_maxprobe || dtp->dt_ddesc[epid] ==NULL || dtp->dt_pdesc[epid] ==NULL )return -1 ;
libdtrace/dt_open.c +1 -1
@@ -169,7 +169,7 @@ static const dt_ident_t _dtrace_globals[] = { {"discard" ,DT_IDENT_ACTFUNC ,0 ,DT_ACT_DISCARD ,DT_ATTR_STABCMN ,DT_VERS_1_0 , &dt_idops_func, "void(int)" }, { "epid", DT_IDENT_SCALAR, 0, DIF_VAR_EPID, DT_ATTR_STABCMN, DT_VERS_1_0, - &dt_idops_type, "uint_t" }, + &dt_idops_type, "uint64_t" }, { "errno", DT_IDENT_SCALAR, 0, DIF_VAR_ERRNO, DT_ATTR_STABCMN, DT_VERS_1_0, &dt_idops_type, "int" }, { "execname", DT_IDENT_SCALAR, 0, DIF_VAR_EXECNAME,
test/demo/dtrace/error.r +1 -1
@@ -3,4 +3,4 @@ -- @@stderr -- dtrace: script 'test/demo/dtrace/error.d' matched 2 probes -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN
test/stress/buffering/tst.resize3-manual.r +1 -1
@@ -1,5 +1,5 @@ FUNCTION:NAME - :BEGIN 3 + :BEGIN 4294967299 :BEGIN -- @@stderr --
test/stress/buffering/tst.resize3.r +1 -1
@@ -1,5 +1,5 @@ FUNCTION:NAME - :BEGIN 3 + :BEGIN 4294967299 :BEGIN -- @@stderr --
test/unittest/actions/setopt/tst.badopt.r +7 -7
@@ -1,16 +1,16 @@ -- @@stderr -- -dtrace: error on enabled probe ID 2 (ID 1: dtrace:::BEGIN): couldn't set option "Nixon" to "1": Invalid option name +dtrace: error on enabled probe ID 4294967298 (ID 1: dtrace:::BEGIN): couldn't set option "Nixon" to "1": Invalid option name -dtrace: error on enabled probe ID 2 (ID 1: dtrace:::BEGIN): couldn't set option "Harding" to "1": Invalid option name +dtrace: error on enabled probe ID 4294967298 (ID 1: dtrace:::BEGIN): couldn't set option "Harding" to "1": Invalid option name -dtrace: error on enabled probe ID 2 (ID 1: dtrace:::BEGIN): couldn't set option "Hoover" to "1": Invalid option name +dtrace: error on enabled probe ID 4294967298 (ID 1: dtrace:::BEGIN): couldn't set option "Hoover" to "1": Invalid option name -dtrace: error on enabled probe ID 2 (ID 1: dtrace:::BEGIN): couldn't set option "Bush" to "1": Invalid option name +dtrace: error on enabled probe ID 4294967298 (ID 1: dtrace:::BEGIN): couldn't set option "Bush" to "1": Invalid option name -dtrace: error on enabled probe ID 2 (ID 1: dtrace:::BEGIN): couldn't set option "quiet" to "um, no": Invalid value for specified option +dtrace: error on enabled probe ID 4294967298 (ID 1: dtrace:::BEGIN): couldn't set option "quiet" to "um, no": Invalid value for specified option -dtrace: error on enabled probe ID 2 (ID 1: dtrace:::BEGIN): couldn't set option "aggrate" to "0.5hz": Invalid value for specified option +dtrace: error on enabled probe ID 4294967298 (ID 1: dtrace:::BEGIN): couldn't set option "aggrate" to "0.5hz": Invalid value for specified option -dtrace: error on enabled probe ID 2 (ID 1: dtrace:::BEGIN): couldn't set option "bufsize" to "1m": Operation illegal when tracing is active +dtrace: error on enabled probe ID 4294967298 (ID 1: dtrace:::BEGIN): couldn't set option "bufsize" to "1m": Operation illegal when tracing is active
test/unittest/arrays/tst.declared-bounds.runtime_out.r +1 -1
@@ -1,3 +1,3 @@ expected run-time error -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): index out of bounds (8) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): index out of bounds (8) in action #1 at BPF pc NNN
test/unittest/codegen/err.deref_0.r +1 -1
@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address (0) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address (0) in action #1 at BPF pc NNN
test/unittest/codegen/err.deref_1.r +1 -1
@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address (1) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address (1) in action #1 at BPF pc NNN
test/unittest/codegen/err.deref_i0.r +1 -1
@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address (0) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address (0) in action #1 at BPF pc NNN
test/unittest/codegen/err.deref_i1.r +1 -1
@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address (1) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address (1) in action #1 at BPF pc NNN
test/unittest/codegen/err.deref_string-assoc.r +1 -1
@@ -1,3 +1,3 @@ 66 -- @@stderr -- -dtrace: error on enabled probe ID 4 (ID 1: dtrace:::BEGIN): invalid address (1) in action #2 at BPF pc NNN +dtrace: error on enabled probe ID 4294967300 (ID 1: dtrace:::BEGIN): invalid address (1) in action #2 at BPF pc NNN
test/unittest/codegen/err.deref_string-gvar.r +1 -1
@@ -1,3 +1,3 @@ 66 -- @@stderr -- -dtrace: error on enabled probe ID 4 (ID 1: dtrace:::BEGIN): invalid address (1) in action #2 at BPF pc NNN +dtrace: error on enabled probe ID 4294967300 (ID 1: dtrace:::BEGIN): invalid address (1) in action #2 at BPF pc NNN
test/unittest/codegen/err.deref_string-lvar.r +1 -1
@@ -1,3 +1,3 @@ 66 -- @@stderr -- -dtrace: error on enabled probe ID 4 (ID 1: dtrace:::BEGIN): invalid address (1) in action #2 at BPF pc NNN +dtrace: error on enabled probe ID 4294967300 (ID 1: dtrace:::BEGIN): invalid address (1) in action #2 at BPF pc NNN
test/unittest/codegen/err.deref_string-tvar.r +1 -1
@@ -1,3 +1,3 @@ 66 -- @@stderr -- -dtrace: error on enabled probe ID 4 (ID 1: dtrace:::BEGIN): invalid address (1) in action #2 at BPF pc NNN +dtrace: error on enabled probe ID 4294967300 (ID 1: dtrace:::BEGIN): invalid address (1) in action #2 at BPF pc NNN
test/unittest/codegen/err.str_NULL_plus_offset-assoc.r +1 -1
@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN
test/unittest/codegen/err.str_NULL_plus_offset-lvar.r +1 -1
@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN
test/unittest/codegen/err.str_NULL_plus_offset-tvar.r +1 -1
@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN
test/unittest/codegen/err.str_NULL_plus_offset.r +1 -1
@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN
test/unittest/disasm/tst.vartab-bvar.r +1 -1
@@ -4,7 +4,7 @@ curthread scl glb r D type (pointer) (size 8) timestamp scl glb r D type (integer) (size 8) vtimestamp scl glb r D type (integer) (size 8) ipl scl glb r D type (integer) (size 4) -epid scl glb r D type (integer) (size 4) +epid scl glb r D type (integer) (size 8) id scl glb r D type (integer) (size 4) arg0 scl glb r D type (integer) (size 8) arg1 scl glb r D type (integer) (size 8)
test/unittest/error/tst.DTRACEFLT_BADADDR.null_ptr_field.r +1 -1
@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN
test/unittest/error/tst.DTRACEFLT_BADADDR.r +2 -2
@@ -1,6 +1,6 @@ -The arguments are 3 1 1 0 +The arguments are 4294967299 1 1 0 The value of arg4 should be 1 The value of arg5 should be 0 -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN
test/unittest/error/tst.DTRACEFLT_DIVZERO.div.r +1 -1
@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): divide-by-zero in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): divide-by-zero in action #1 at BPF pc NNN
test/unittest/error/tst.DTRACEFLT_DIVZERO.mod.r +1 -1
@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): divide-by-zero in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): divide-by-zero in action #1 at BPF pc NNN
test/unittest/error/tst.DTRACEFLT_UNKNOWN.r +2 -2
@@ -1,5 +1,5 @@ -The arguments are 3 1 PC 1 64 +The arguments are 4294967299 1 PC 1 64 The value of arg4 = 0 -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN
test/unittest/error/tst.clause_scope-begin-ended.r +1 -1
@@ -2,4 +2,4 @@ Error fired Clause executed -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN
test/unittest/error/tst.clause_scope-begin.r +1 -1
@@ -2,4 +2,4 @@ Error fired Clause executed -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN
test/unittest/error/tst.clause_scope-regular.r.p +10 -2
@@ -1,3 +1,11 @@ -#!/bin/sed -f +#!/usr/bin/awk -f + # This report has a variable probe ID in it. -s/ID [0-9][0-9]*: profile/ID nnn: profile/ +/^dtrace: error on enabled probe ID / { + $7 = and($7, 0xffffffff); # mask out the high 32 bits (variable prid) +} + +{ + sub("ID [0-9][0-9]*: profile", "ID nnn: profile"); + print; +}
test/unittest/error/tst.error.r +1 -1
@@ -1,4 +1,4 @@ Error fired -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN
test/unittest/error/tst.errorend.r +1 -1
@@ -2,4 +2,4 @@ Error fired End fired after exit -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN
test/unittest/funcs/alloca/err.alloca-bcopy-before-beyond.r +1 -1
@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN
test/unittest/funcs/alloca/err.alloca-bcopy-before-bottom.r +1 -1
@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN
test/unittest/funcs/alloca/err.alloca-bcopy-beyond-top.r +1 -1
@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN
test/unittest/funcs/alloca/err.alloca-bcopy-crossing-bottom.r +1 -1
@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN
test/unittest/funcs/alloca/err.alloca-bcopy-crossing-top.r +1 -1
@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid size ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid size ({ptr}) in action #1 at BPF pc NNN
test/unittest/funcs/alloca/err.alloca-crossing-clauses.r +1 -1
@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 4 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #2 at BPF pc NNN +dtrace: error on enabled probe ID 4294967300 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #2 at BPF pc NNN
test/unittest/funcs/alloca/err.alloca-load-before-bottom.r +1 -1
@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN
test/unittest/funcs/alloca/err.alloca-load-beyond-top.r +1 -1
@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN
test/unittest/funcs/alloca/err.alloca-load-crossing-bottom.r +1 -1
@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN
test/unittest/funcs/alloca/err.alloca-null-deref-lvalue.r +1 -1
@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN
test/unittest/funcs/alloca/err.alloca-null-deref.r +1 -1
@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN
test/unittest/funcs/alloca/err.alloca-scratch-exceeding-bcopy.r +1 -1
@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid size ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid size ({ptr}) in action #1 at BPF pc NNN
test/unittest/funcs/alloca/err.alloca-store-before-bottom.r +1 -1
@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN
test/unittest/funcs/alloca/err.alloca-store-beyond-top.r +1 -1
@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN
test/unittest/funcs/alloca/err.alloca-store-crossing-bottom.r +1 -1
@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN
test/unittest/funcs/bcopy/err.badbcopy1.r +1 -1
@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN
test/unittest/funcs/bcopy/err.badbcopy4.r +1 -1
@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN
test/unittest/funcs/bcopy/err.badbcopy5.r +1 -1
@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN
test/unittest/funcs/bcopy/err.badbcopy6.r +1 -1
@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid size ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid size ({ptr}) in action #1 at BPF pc NNN
test/unittest/funcs/bcopy/err.badbcopy7.r +1 -1
@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid size ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid size ({ptr}) in action #1 at BPF pc NNN
test/unittest/funcs/bcopy/err.badbcopy8.r +1 -1
@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid size ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid size ({ptr}) in action #1 at BPF pc NNN
test/unittest/funcs/copyin/err.badaddr.r +1 -1
@@ -3,4 +3,4 @@ -- @@stderr -- dtrace: script 'test/unittest/funcs/copyin/err.badaddr.d' matched 2 probes -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN
test/unittest/funcs/copyin/err.null_arg1.r +1 -1
@@ -3,4 +3,4 @@ -- @@stderr -- dtrace: script 'test/unittest/funcs/copyin/err.null_arg1.d' matched 2 probes -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN
test/unittest/funcs/copyinstr/err.badaddr.r +1 -1
@@ -3,4 +3,4 @@ -- @@stderr -- dtrace: script 'test/unittest/funcs/copyinstr/err.badaddr.d' matched 2 probes -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN
test/unittest/funcs/copyinstr/err.null_arg1.r +1 -1
@@ -3,4 +3,4 @@ -- @@stderr -- dtrace: script 'test/unittest/funcs/copyinstr/err.null_arg1.d' matched 2 probes -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN
test/unittest/funcs/copyinto/err.badaddr.r +1 -1
@@ -3,4 +3,4 @@ -- @@stderr -- dtrace: script 'test/unittest/funcs/copyinto/err.badaddr.d' matched 2 probes -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN
test/unittest/funcs/copyinto/err.badsize.r +1 -1
@@ -3,4 +3,4 @@ -- @@stderr -- dtrace: script 'test/unittest/funcs/copyinto/err.badsize.d' matched 2 probes -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid size ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid size ({ptr}) in action #1 at BPF pc NNN
test/unittest/funcs/copyinto/err.null_arg1.r +1 -1
@@ -3,4 +3,4 @@ -- @@stderr -- dtrace: script 'test/unittest/funcs/copyinto/err.null_arg1.d' matched 2 probes -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN
test/unittest/funcs/err.badalloca.r.p +10 -2
@@ -1,3 +1,11 @@ -#!/bin/sed -f +#!/usr/bin/awk -f -s/(ID [0-9]*/(ID NNN/g +# This report has a variable probe ID in it. +/^dtrace: error on enabled probe ID / { + $7 = and($7, 0xffffffff); # mask out the high 32 bits (variable prid) +} + +{ + sub("ID [0-9]*: profile", "ID NNN: profile"); + print; +}
test/unittest/funcs/err.link_ntopbadaddr.r +1 -1
@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN
test/unittest/funcs/err.link_ntopbadarg.r +1 -1
@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): illegal operation in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): illegal operation in action #1 at BPF pc NNN
test/unittest/funcs/inet_ntoa6/err.inet_ntoa6.arg1_null.r +1 -1
@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN
test/unittest/funcs/inet_ntoa6/err.inet_ntoa6.arg1_null_const.r +1 -1
@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN
test/unittest/funcs/strlen/tst.null.r +1 -1
@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN
test/unittest/funcs/strtok/tst.strtok_null.r +1 -1
@@ -3,4 +3,4 @@ -- @@stderr -- dtrace: script 'test/unittest/funcs/strtok/tst.strtok_null.d' matched 2 probes -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN
test/unittest/funcs/strtok/tst.strtok_nulldel.r +1 -1
@@ -3,4 +3,4 @@ -- @@stderr -- dtrace: script 'test/unittest/funcs/strtok/tst.strtok_nulldel.d' matched 2 probes -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN
test/unittest/funcs/strtok/tst.strtok_nullstr.r +1 -1
@@ -3,4 +3,4 @@ -- @@stderr -- dtrace: script 'test/unittest/funcs/strtok/tst.strtok_nullstr.d' matched 2 probes -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN
test/unittest/funcs/strtok/tst.strtok_nullstr2.r +1 -1
@@ -4,4 +4,4 @@ -- @@stderr -- dtrace: script 'test/unittest/funcs/strtok/tst.strtok_nullstr2.d' matched 4 probes -dtrace: error on enabled probe ID 4 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #2 at BPF pc NNN +dtrace: error on enabled probe ID 4294967300 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #2 at BPF pc NNN
test/unittest/funcs/substr/err.substr_null_arg1.r +1 -1
@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN
test/unittest/pointers/err.AllocaOverrun.r +1 -1
@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN
test/unittest/pointers/err.BadAlign.r +1 -1
@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN
test/unittest/pointers/err.InvalidAddress2.r +1 -1
@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN
test/unittest/pointers/err.InvalidAddress4.r +1 -1
@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN
test/unittest/speculation/err.CommitWithInvalid.r +1 -1
@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 4 (ID 1: dtrace:::BEGIN): illegal operation in action #2 at BPF pc NNN +dtrace: error on enabled probe ID 4294967300 (ID 1: dtrace:::BEGIN): illegal operation in action #2 at BPF pc NNN
test/unittest/speculation/err.DiscardWithInvalid.r +1 -1
@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 4 (ID 1: dtrace:::BEGIN): illegal operation in action #2 at BPF pc NNN +dtrace: error on enabled probe ID 4294967300 (ID 1: dtrace:::BEGIN): illegal operation in action #2 at BPF pc NNN
test/unittest/speculation/tst.SpecSizeVariations.r +0 -22
@@ -11,26 +11,6 @@ Speculative buffer ID: 1 123456706 counts: 1 1 -Speculative buffer ID: 1 -123456700 -123456701 -123456702 -123456703 -123456704 -123456705 -123456706 -counts: 1 1 - -Speculative buffer ID: 1 -123456700 -123456701 -123456702 -123456703 -123456704 -123456705 -123456706 -counts: 2 1 - Speculative buffer ID: 1 123456700 123456701
@@ -64,5 +44,3 @@ counts: 2 1 dtrace: 2 speculative drops dtrace: 1 speculative drop dtrace: 1 speculative drop -dtrace: 1 speculative drop -dtrace: 1 speculative drop
test/unittest/speculation/tst.SpecSizeVariations.sh +1 -1
@@ -9,7 +9,7 @@ dtrace=$1 -for x in 63 64 79 80 143 144; do +for x in 71 72 159 160; do $dtrace $dt_flags -xspecsize=$x -qn ' BEGIN {
test/unittest/speculation/tst.negcommit.r +1 -1
@@ -3,4 +3,4 @@ -- @@stderr -- dtrace: script 'test/unittest/speculation/tst.negcommit.d' matched 2 probes -dtrace: error on enabled probe ID 2 (ID 1: dtrace:::BEGIN): illegal operation in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967298 (ID 1: dtrace:::BEGIN): illegal operation in action #1 at BPF pc NNN
Signature · 1 line
2.43.5
PATCH v2 38/38 Systemwide USDT WIP
In reply to [email protected]From: Eugene Loh <[email protected]>
need to:
- review tests
- handle globs in dt_pid_create_probes_module()
- add process monitoring / inotify
- deal with FIXMEs
--- libdtrace/dt_cc.c | 3 +- libdtrace/dt_pid.c | 132 +++++++++++++++--- .../dtrace-util/tst.ListProbesNameUSDT.sh | 1 - .../dtrace-util/tst.ListProbesProviderUSDT.sh | 1 - test/unittest/usdt/tst.forker.sh | 1 - 5 files changed, 118 insertions(+), 20 deletions(-)
libdtrace/dt_cc.c +2 -1
@@ -278,7 +278,8 @@ dt_setcontext(dtrace_hdl_t *dtp, const dtrace_probedesc_t *pdp)* and tag -- we just have to longjmp() out of here. */ if (pdp->prv && pdp->prv[0 ] && -isdigit (pdp->prv[strlen (pdp->prv) -1 ]) && + (isdigit (pdp->prv[strlen (pdp->prv) -1 ]) || + pdp->prv[strlen (pdp->prv) -1 ] =='*' ) && ((pvp =dt_provider_lookup (dtp, pdp->prv)) ==NULL || pvp->pv_flags &DT_PROVIDER_PID ) &&dt_pid_create_probes ((dtrace_probedesc_t *)pdp, dtp, yypcb) !=0 ) {
libdtrace/dt_pid.c +116 -16
198 lines not on this page · raw message
test/unittest/dtrace-util/tst.ListProbesNameUSDT.sh +0 -1
@@ -5,7 +5,6 @@ # Licensed under the Universal Permissive License v 1.0 as shown at # http://oss.oracle.com/licenses/upl. # -# @@xfail: dtv2 ## #
test/unittest/dtrace-util/tst.ListProbesProviderUSDT.sh +0 -1
@@ -5,7 +5,6 @@ # Licensed under the Universal Permissive License v 1.0 as shown at # http://oss.oracle.com/licenses/upl. # -# @@xfail: dtv2 ## #
test/unittest/usdt/tst.forker.sh +0 -1
@@ -7,7 +7,6 @@ # # # @@timeout: 120 -# @@xfail: dtv2 USDT wildcard if [ $# != 1 ]; then echo expected one argument: '<'dtrace-path'>'
Signature · 1 line
2.43.5
PATCH v2 36/38 Simplify trampoline_is_enabled()
In reply to [email protected]From: Eugene Loh <[email protected]>
Do not bother with dt_cg_tramp_copy_regs() since the copied values will not be used.
Do not bother with the (second) copy of regs[arg0] to mst->arg[0].
Inline copyout_val().
--- libdtrace/dt_prov_uprobe.c | 48 +++++++------------------------------- 1 file changed, 8 insertions(+), 40 deletions(-)
libdtrace/dt_prov_uprobe.c +8 -40
@@ -611,33 +611,6 @@ static int trampoline(dt_pcb_t *pcb, uint_t exitlbl)return 0 ; } -/* -* Copy the given immediate value into the address given by the specified probe -* argument. -*/ -static void -copyout_val (dt_pcb_t *pcb,uint_t lbl,uint32_t val,int arg) -{ -dt_regset_t *drp = pcb->pcb_regs; -dt_irlist_t *dlp = &pcb->pcb_ir; - -emitl (dlp, lbl,BPF_STORE_IMM (BPF_DW ,BPF_REG_FP ,DT_TRAMP_SP_SLOT (0 ), - val)); - -if (dt_regset_xalloc_args (drp) ==-1 ) -longjmp (yypcb->pcb_jmpbuf,EDT_NOREG ); -emit (dlp,BPF_LOAD (BPF_DW ,BPF_REG_1 ,BPF_REG_7 ,DMST_ARG (arg))); -emit (dlp,BPF_MOV_REG (BPF_REG_2 ,BPF_REG_FP )); -emit (dlp,BPF_ALU64_IMM (BPF_ADD ,BPF_REG_2 ,DT_TRAMP_SP_SLOT (0 ))); -emit (dlp,BPF_MOV_IMM (BPF_REG_3 ,sizeof (uint32_t ))); -dt_regset_xalloc (drp,BPF_REG_0 ); -emit (dlp,BPF_CALL_HELPER (BPF_FUNC_probe_write_user)); - -/* XXX any point error-checking here? What can we possibly do? */ -dt_regset_free (drp,BPF_REG_0 ); -dt_regset_free_args (drp); -} -/* * Generate a BPF trampoline for an is-enabled probe. The is-enabled probe * prototype looks like:
@@ -655,22 +628,12 @@ static int trampoline_is_enabled(dt_pcb_t *pcb, uint_t exitlbl)assert (uprobes !=NULL ); -dt_cg_tramp_prologue (pcb); -/* * After the dt_cg_tramp_prologue() call, we have: * // (%r7 = dctx->mst) * // (%r8 = dctx->ctx) */ -dt_cg_tramp_copy_regs (pcb); - -/* -* Copy in the first function argument, a pointer value to which -* the is-enabled state of the probe will be written (necessarily -* 1 if this probe is running at all). -*/ -emit (dlp,BPF_LOAD (BPF_DW ,BPF_REG_0 ,BPF_REG_8 ,PT_REGS_ARG0 )); -emit (dlp,BPF_STORE (BPF_DW ,BPF_REG_7 ,DMST_ARG (0 ),BPF_REG_0 )); +dt_cg_tramp_prologue (pcb);/* * Retrieve the PID of the process that caused the probe to fire.
@@ -699,10 +662,15 @@ static int trampoline_is_enabled(dt_pcb_t *pcb, uint_t exitlbl)emit (dlp,BPF_BRANCH_IMM (BPF_JEQ ,BPF_REG_0 ,0 , pcb->pcb_exitlbl));/* -* If we succeeded, then we use copyout_val() above to assign: +* If we succeeded, then we assign: * *arg0 = 1; */ -copyout_val (pcb,DT_LBL_NONE ,1 ,0 ); +emit (dlp,BPF_STORE_IMM (BPF_W ,BPF_REG_FP ,DT_TRAMP_SP_SLOT (0 ),1 )); +emit (dlp,BPF_LOAD (BPF_DW ,BPF_REG_1 ,BPF_REG_8 ,PT_REGS_ARG0 )); +emit (dlp,BPF_MOV_REG (BPF_REG_2 ,BPF_REG_FP )); +emit (dlp,BPF_ALU64_IMM (BPF_ADD ,BPF_REG_2 ,DT_TRAMP_SP_SLOT (0 ))); +emit (dlp,BPF_MOV_IMM (BPF_REG_3 ,sizeof (uint32_t ))); +emit (dlp,BPF_CALL_HELPER (BPF_FUNC_probe_write_user));dt_cg_tramp_return (pcb);
Signature · 1 line
2.43.5
PATCH v2 29/38 Set the ERROR PRID in BPF code
In reply to [email protected]From: Eugene Loh <[email protected]>
The patch can be simplified if we are willing to assume the ERROR PRID is always 3, which is probably safe.
--- bpf/probe_error.c | 5 ++++ libdtrace/dt_bpf.h | 1 + libdtrace/dt_cc.c | 3 +++ libdtrace/dt_dlibs.c | 1 + test/unittest/builtinvar/tst.id_ERROR.d | 32 +++++++++++++++++++++++ test/unittest/builtinvar/tst.id_ERROR.r | 3 +++ test/unittest/builtinvar/tst.id_ERROR.r.p | 4 +++ 7 files changed, 49 insertions(+) create mode 100644 test/unittest/builtinvar/tst.id_ERROR.d create mode 100644 test/unittest/builtinvar/tst.id_ERROR.r create mode 100755 test/unittest/builtinvar/tst.id_ERROR.r.p
bpf/probe_error.c +5 -0
@@ -7,6 +7,8 @@#include <bpf/bpf_helpers.h> #include <dt_dctx.h> +extern uint64_t ERROR_PRID ; +#ifndef noinline# define noinline __attribute__((noinline))#endif
@@ -26,6 +28,7 @@ noinline void dt_probe_error(const dt_dctx_t *dctx, uint64_t pc, uint64_t fault, uint64_t illval) {dt_mstate_t *mst = dctx->mst; +int oldprid = mst->prid; mst->argv[0 ] =0 ; mst->argv[1 ] = mst->epid;
@@ -34,7 +37,9 @@ noinline void dt_probe_error(const dt_dctx_t *dctx, uint64_t pc, uint64_t fault, mst->argv[4 ] = fault; mst->argv[5 ] = illval; + mst->prid = ((uint64_t )&ERROR_PRID );dt_error (dctx); + mst->prid = oldprid; mst->fault = fault; }
libdtrace/dt_bpf.h +1 -0
@@ -56,6 +56,7 @@ extern "C" {#define DT_CONST_ZERO_OFF 22#define DT_CONST_STACK_OFF 23#define DT_CONST_STACK_SKIP 24 +#define DT_CONST_ERROR_PRID 25#define DT_BPF_LOG_SIZE_DEFAULT (UINT32_MAX >> 8)#define DT_BPF_LOG_SIZE_SMALL 4096
libdtrace/dt_cc.c +3 -0
@@ -1076,6 +1076,9 @@ dt_link_construct(dtrace_hdl_t *dtp, const dt_probe_t *prp, dtrace_difo_t *dp, nrp->dofr_data =sizeof (uint64_t ) * dtp->dt_options[DTRACEOPT_MAXFRAMES ];continue ; +case DT_CONST_ERROR_PRID : + nrp->dofr_data = dtp->dt_error->desc->id; +continue ;case DT_CONST_BOOTTM :if (boottime ==0 &&get_boottime ())return -1 ;
libdtrace/dt_dlibs.c +1 -0
@@ -80,6 +80,7 @@ static const dt_ident_t dt_bpf_symbols[] = {DT_BPF_SYMBOL_ID (STBSZ ,DT_IDENT_SCALAR ,DT_CONST_STBSZ ),DT_BPF_SYMBOL_ID (STRSZ ,DT_IDENT_SCALAR ,DT_CONST_STRSZ ),DT_BPF_SYMBOL_ID (STKSIZ ,DT_IDENT_SCALAR ,DT_CONST_STKSIZ ), +DT_BPF_SYMBOL_ID (ERROR_PRID ,DT_IDENT_SCALAR ,DT_CONST_ERROR_PRID ),DT_BPF_SYMBOL_ID (BOOTTM ,DT_IDENT_SCALAR ,DT_CONST_BOOTTM ),DT_BPF_SYMBOL_ID (NSPEC ,DT_IDENT_SCALAR ,DT_CONST_NSPEC ), DT_BPF_SYMBOL_ID(NCPUS, DT_IDENT_SCALAR, DT_CONST_NCPUS),
test/unittest/builtinvar/tst.id_ERROR.d new file +32 -0
@@ -0,0 +1,32 @@ +/* + * Oracle Linux DTrace. + * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * Licensed under the Universal Permissive License v 1.0 as shown at + * http://oss.oracle.com/licenses/upl. + */ + +/* + * ASSERTION: + * The id in the ERROR probe is 3. + * + * SECTION: Variables/Built-in Variables + */ + +#pragma D option quiet + +tick-1s +{ + /* trigger the ERROR probe */ + trace(*((int*)0)); +} + +tick-2s +{ + exit(1); +} + +ERROR +{ + printf("id of the ERROR probe = %d\n", id); + exit(0); +}
test/unittest/builtinvar/tst.id_ERROR.r new file +3 -0
@@ -0,0 +1,3 @@ +id of the ERROR probe = 3 + +-- @@stderr --
test/unittest/builtinvar/tst.id_ERROR.r.p new file +4 -0
@@ -0,0 +1,4 @@ +#!/usr/bin/gawk -f + +# Drop the line with run-dependent PRID for profile probe. +!/error on enabled probe ID/ { print }
Signature · 1 line
2.43.5
PATCH v2 35/38 Use uprobes map to call clauses conditionally
In reply to [email protected]From: Eugene Loh <[email protected]>
This version supports only up to 64 clauses for an underlying probe, but it can be extended to more clauses.
This version also does not work when two overlying probes that differ in more than just pid map to the same underlying probe. For example, a pid$pid:::offset probe could map to the same underlying probe as a usdt$pid::: probe. In the current scheme, only the "first" overlying probe would fire.
--- libdtrace/dt_prov_uprobe.c | 151 +++++++++++++++++++------------------ 1 file changed, 77 insertions(+), 74 deletions(-)
libdtrace/dt_prov_uprobe.c +77 -74
@@ -517,8 +517,11 @@ static int trampoline(dt_pcb_t *pcb, uint_t exitlbl)dt_irlist_t *dlp = &pcb->pcb_ir;const dt_probe_t *uprp = pcb->pcb_probe;const dt_uprobe_t *upp = uprp->prv_data; -const list_probe_t *pop;uint_t lbl_exit = pcb->pcb_exitlbl; +dt_ident_t *uprobes =dt_dlib_get_map (pcb->pcb_hdl,"uprobes" ); +dt_probe_clause_t *pcp; + +assert (uprobes !=NULL );dt_cg_tramp_prologue (pcb);
@@ -527,7 +530,6 @@ static int trampoline(dt_pcb_t *pcb, uint_t exitlbl)* // (%r7 = dctx->mst) * // (%r8 = dctx->ctx) */ -dt_cg_tramp_copy_regs (pcb);if (upp->flags &PP_IS_RETURN )dt_cg_tramp_copy_rval_from_regs (pcb);
@@ -542,47 +544,66 @@ static int trampoline(dt_pcb_t *pcb, uint_t exitlbl)emit (dlp,BPF_ALU64_IMM (BPF_RSH ,BPF_REG_0 ,32 ));/* -* Generate a composite conditional clause: +* Look up in the BPF uprobes map. Space for the look-up key will be used +* on the BPF stack: * -* if (pid == PID1) { -* dctx->mst->prid = PRID1; -* < any number of clause calls > -* goto exit; -* } else if (pid == PID2) { -* dctx->mst->prid = PRID2; -* < any number of clause calls > -* goto exit; -* } else if (pid == ...) { -* < ... > -* } +* offset value * -* It is valid and safe to use %r0 to hold the pid value because there -* are no assignments to %r0 possible in between the conditional -* statements. +* -sizeof(uprobe_map_key_t) pid (in %r0) +* +* -sizeof(uprobe_map_key_t) + sizeof(pid_t) +* == +* -sizeof(dtrace_id_t) underlying-probe prid */ -for (pop =dt_list_next (&upp->probes); pop !=NULL ; - pop =dt_list_next (pop)) { -const dt_probe_t *prp = pop->probe; -uint_t lbl_next =dt_irlist_label (dlp); -pid_t pid; -dt_ident_t *idp; +emit (dlp,BPF_STORE (BPF_W ,BPF_REG_9 , (int )(-sizeof (uprobe_map_key_t)),BPF_REG_0 )); +emit (dlp,BPF_STORE_IMM (BPF_W ,BPF_REG_9 , (int )(-sizeof (dtrace_id_t)), uprp->desc->id)); +dt_cg_xsetx (dlp, uprobes,DT_LBL_NONE ,BPF_REG_1 , uprobes->di_id); +emit (dlp,BPF_MOV_REG (BPF_REG_2 ,BPF_REG_9 )); +emit (dlp,BPF_ALU64_IMM (BPF_ADD ,BPF_REG_2 , (int )(-sizeof (uprobe_map_key_t)))); +emit (dlp,BPF_CALL_HELPER (BPF_FUNC_map_lookup_elem)); +emit (dlp,BPF_BRANCH_IMM (BPF_JEQ ,BPF_REG_0 ,0 , lbl_exit)); - pid =dt_pid_get_pid (prp->desc, pcb->pcb_hdl, pcb,NULL ); -assert (pid !=-1 ); +/* Read the PRID from the table lookup and store to mst->prid. */ +emit (dlp,BPF_LOAD (BPF_W ,BPF_REG_1 ,BPF_REG_0 ,0 )); +emit (dlp,BPF_STORE (BPF_W ,BPF_REG_7 ,DMST_PRID ,BPF_REG_1 )); + +/* Read the bit mask from the table lookup in %r6. */ // FIXME someday, extend this past 64 bits +emit (dlp,BPF_LOAD (BPF_DW ,BPF_REG_6 ,BPF_REG_0 , offsetof(uprobe_map_val_t , mask))); + +/* +* Hold the bit mask in %r6 between clause calls. +*/ +for (pcp =dt_list_next (&uprp->clauses); pcp; pcp =dt_list_next (pcp)) { +dt_ident_t *idp = pcp->clause; +uint_t lbl_next =dt_irlist_label (dlp); - idp =dt_dlib_add_probe_var (pcb->pcb_hdl, prp); -assert (idp !=NULL ); +/* If the lowest %r6 bit is 0, skip over this clause. */ +emit (dlp,BPF_MOV_REG (BPF_REG_1 ,BPF_REG_6 )); +emit (dlp,BPF_ALU64_IMM (BPF_AND ,BPF_REG_1 ,1 )); +emit (dlp,BPF_BRANCH_IMM (BPF_JEQ ,BPF_REG_1 ,0 , lbl_next));/* -* Check whether this pid-provider probe serves the current -* process, and emit a sequence of clauses for it when it does. +* if (*dctx.act != act) // ldw %r0, [%r9 + DCTX_ACT] +* goto exit; // ldw %r0, [%r0 + 0] +* // jne %r0, act, lbl_exit */ -emit (dlp,BPF_BRANCH_IMM (BPF_JNE ,BPF_REG_0 , pid, lbl_next)); -emite (dlp,BPF_STORE_IMM (BPF_W ,BPF_REG_7 ,DMST_PRID , prp->desc->id), idp); -dt_cg_tramp_call_clauses (pcb, prp,DT_ACTIVITY_ACTIVE ); -emit (dlp,BPF_JUMP (lbl_exit)); +emit (dlp,BPF_LOAD (BPF_DW ,BPF_REG_0 ,BPF_REG_9 ,DCTX_ACT )); +emit (dlp,BPF_LOAD (BPF_W ,BPF_REG_0 ,BPF_REG_0 ,0 )); +emit (dlp,BPF_BRANCH_IMM (BPF_JNE ,BPF_REG_0 ,DT_ACTIVITY_ACTIVE , lbl_exit)); + +/* dctx.mst->scratch_top = 8 */ +emit (dlp,BPF_STORE_IMM (BPF_W ,BPF_REG_7 ,DMST_SCRATCH_TOP ,8 )); + +/* Call clause. */ +emit (dlp,BPF_MOV_REG (BPF_REG_1 ,BPF_REG_9 )); +emite (dlp,BPF_CALL_FUNC (idp->di_id), idp); + +/* Finished this clause. */ emitl (dlp, lbl_next,BPF_NOP ()); + +/* Right-shift %r6. */ +emit (dlp,BPF_ALU64_IMM (BPF_RSH ,BPF_REG_6 ,1 )); }dt_cg_tramp_return (pcb);
@@ -630,10 +651,9 @@ static int trampoline_is_enabled(dt_pcb_t *pcb, uint_t exitlbl) {dt_irlist_t *dlp = &pcb->pcb_ir;const dt_probe_t *uprp = pcb->pcb_probe; -const dt_uprobe_t *upp = uprp->prv_data; -const list_probe_t *pop; -uint_t lbl_assign =dt_irlist_label (dlp); -uint_t lbl_exit = pcb->pcb_exitlbl; +dt_ident_t *uprobes =dt_dlib_get_map (pcb->pcb_hdl,"uprobes" ); + +assert (uprobes !=NULL );dt_cg_tramp_prologue (pcb);
@@ -642,7 +662,6 @@ static int trampoline_is_enabled(dt_pcb_t *pcb, uint_t exitlbl)* // (%r7 = dctx->mst) * // (%r8 = dctx->ctx) */ -dt_cg_tramp_copy_regs (pcb);/*
@@ -660,46 +679,30 @@ static int trampoline_is_enabled(dt_pcb_t *pcb, uint_t exitlbl)emit (dlp,BPF_ALU64_IMM (BPF_RSH ,BPF_REG_0 ,32 ));/* -* Generate a composite conditional clause, as above, except that rather -* than emitting call_clauses, we emit copyouts instead, using -* copyout_val() above: +* Look up in the BPF uprobes map. Space for the look-up key will be used +* on the BPF stack: * -* if (pid == PID1) { -* goto assign; -* } else if (pid == PID2) { -* goto assign; -* } else if (pid == ...) { -* goto assign; -* } -* goto exit; -* assign: -* *arg0 = 1; -* goto exit; +* offset value +* +* -sizeof(uprobe_map_key_t) pid (in %r0) * -* It is valid and safe to use %r0 to hold the pid value because there -* are no assignments to %r0 possible in between the conditional -* statements. +* -sizeof(uprobe_map_key_t) + sizeof(pid_t) +* == +* -sizeof(dtrace_id_t) underlying-probe prid */ -for (pop =dt_list_next (&upp->probes); pop !=NULL ; - pop =dt_list_next (pop)) { -const dt_probe_t *prp = pop->probe; -pid_t pid; -dt_ident_t *idp; - - pid =dt_pid_get_pid (prp->desc, pcb->pcb_hdl, pcb,NULL ); -assert (pid !=-1 ); - - idp =dt_dlib_add_probe_var (pcb->pcb_hdl, prp); -assert (idp !=NULL ); +emit (dlp,BPF_STORE (BPF_W ,BPF_REG_9 , (int )(-sizeof (uprobe_map_key_t)),BPF_REG_0 )); +emit (dlp,BPF_STORE_IMM (BPF_W ,BPF_REG_9 , (int )(-sizeof (dtrace_id_t)), uprp->desc->id)); +dt_cg_xsetx (dlp, uprobes,DT_LBL_NONE ,BPF_REG_1 , uprobes->di_id); +emit (dlp,BPF_MOV_REG (BPF_REG_2 ,BPF_REG_9 )); +emit (dlp,BPF_ALU64_IMM (BPF_ADD ,BPF_REG_2 , (int )(-sizeof (uprobe_map_key_t)))); +emit (dlp,BPF_CALL_HELPER (BPF_FUNC_map_lookup_elem)); +emit (dlp,BPF_BRANCH_IMM (BPF_JEQ ,BPF_REG_0 ,0 , pcb->pcb_exitlbl)); -/* -* Check whether this pid-provider probe serves the current -* process, and copy out a 1 into arg 0 if so. -*/ -emit (dlp,BPF_BRANCH_IMM (BPF_JEQ ,BPF_REG_0 , pid, lbl_assign)); - } -emit (dlp,BPF_JUMP (lbl_exit)); -copyout_val (pcb, lbl_assign,1 ,0 ); +/* +* If we succeeded, then we use copyout_val() above to assign: +* *arg0 = 1; +*/ +copyout_val (pcb,DT_LBL_NONE ,1 ,0 );dt_cg_tramp_return (pcb);
Signature · 1 line
2.43.5
Re: [DTrace-devel] [PATCH v2 32/38] Widen the EPID to include the PRID
In reply to [email protected]Quoted 6 lines · eugene.loh--- via DTrace-devel
From: Eugene Loh <[email protected]>
Each output record has a EPID associated with it, allowing the consumer to get both a data description and a PRID (so it can report PRID and probe function and name). We want to support uprobes that trigger for multiple PRIDs, however, basically breaking this scheme.
So, the EPID is (before this patch) an index into a list of ddescs and pdescs, effectively associating an id (EPID) with a { ddesc, pdesc } pair. It is also a unique id for a clause as it is used for a particular pdesc. When you have multiple probes that match a given pdesc for a given clause, the EPID still identifies the correct ddesc, but obviously the pdesc data won't be quite what you expect since that is PRID dependent.
Which is indeed why we need extra information, as you outline below...
Quoted 3 lines
So, expand the EPID to 64 bits, half for the old-style EPID (based on static information about the D programs) and half for the PRID (discovered at run time).
Of course, this is only really needed for select providers (e.g. USDT) whereas for all other cases, the single EPID suffices on its own. Therefore, I would expect that we do not place the PRID in the upper 32 buts of the EPID *unless* it is needed to override the "template" PRID that is associated with the basic EPID (lower 32 bits). Doing things that way things will look more familiar anyway for users who expect to typically see EPIDs in low values, and it also keeps the code design where (in general) the EPID identifies the ddesc and the pdesc.
It means we have some code that needs to deal with the exception case, but I don't see that as a problem becacuse most of the time it won't be used.
In that sense, we could look at the USDT-type case as an exceptional case. So, it would need special code in dt_get_bvar() to put the PRID in the top 32 bits of the EPID when it needs to return the value for epid. Which means it needs to know when to do so. That could perhaps be done using some flag in the mstate or something. Similarly, the prologue of the clause could put the PRID in those top 32 bits when the clause is called for a case that needs it (which perhaps again could be indicated in the mstate)?
In fact, if that works, then such a flag in the mstate can also be used to dynamically generate the provider name (probeprov bvar) rather than needing to add it to the strtab as a string. That might solve some additional issues or complexities that are seen in other patches where the strtab is getting updated at runtime to add more strings.
Why would a scheme like this not work? I.e. why do we need to add the PRID in the top 32 bits of a 64-bit EPID for *all* cases when only USDT needs it?
Quoted 1,256 lines
The EPID seen by compile-time files like
dt_cc.cordt_map.care still the old-style EPIDs (even if now 64-bit) since they have no knowledge of the run-time PRIDs.Further, we do not need to expand:
- the mstate (since it already had the PRID anyhow)
- the output buffer (since it already had an unused 4-byte pad)The combination of EPID and PRID is for the built-in variable epid as well as what the consumer reads.
Signed-off-by Eugene Loh <[email protected]>--- bpf/get_bvar.c | 6 ++- bpf/probe_error.c | 2 +- include/dtrace/universal.h | 2 +- libdtrace/dt_bpf.c | 2 - libdtrace/dt_cg.c | 43 +++++++++++-------- libdtrace/dt_consume.c | 28 ++++++++---- libdtrace/dt_dctx.h | 12 ++++-- libdtrace/dt_handle.c | 9 ++-- libdtrace/dt_map.c | 3 ++ libdtrace/dt_open.c | 2 +- test/demo/dtrace/error.r | 2 +- test/stress/buffering/tst.resize3-manual.r | 2 +- test/stress/buffering/tst.resize3.r | 2 +- test/unittest/actions/setopt/tst.badopt.r | 14 +++--- .../arrays/tst.declared-bounds.runtime_out.r | 2 +- test/unittest/codegen/err.deref_0.r | 2 +- test/unittest/codegen/err.deref_1.r | 2 +- test/unittest/codegen/err.deref_i0.r | 2 +- test/unittest/codegen/err.deref_i1.r | 2 +- .../unittest/codegen/err.deref_string-assoc.r | 2 +- test/unittest/codegen/err.deref_string-gvar.r | 2 +- test/unittest/codegen/err.deref_string-lvar.r | 2 +- test/unittest/codegen/err.deref_string-tvar.r | 2 +- .../codegen/err.str_NULL_plus_offset-assoc.r | 2 +- .../codegen/err.str_NULL_plus_offset-lvar.r | 2 +- .../codegen/err.str_NULL_plus_offset-tvar.r | 2 +- .../codegen/err.str_NULL_plus_offset.r | 2 +- test/unittest/disasm/tst.vartab-bvar.r | 2 +- .../tst.DTRACEFLT_BADADDR.null_ptr_field.r | 2 +- test/unittest/error/tst.DTRACEFLT_BADADDR.r | 4 +- .../error/tst.DTRACEFLT_DIVZERO.div.r | 2 +- .../error/tst.DTRACEFLT_DIVZERO.mod.r | 2 +- test/unittest/error/tst.DTRACEFLT_UNKNOWN.r | 4 +- .../error/tst.clause_scope-begin-ended.r | 2 +- test/unittest/error/tst.clause_scope-begin.r | 2 +- .../error/tst.clause_scope-regular.r.p | 12 +++++- test/unittest/error/tst.error.r | 2 +- test/unittest/error/tst.errorend.r | 2 +- .../alloca/err.alloca-bcopy-before-beyond.r | 2 +- .../alloca/err.alloca-bcopy-before-bottom.r | 2 +- .../alloca/err.alloca-bcopy-beyond-top.r | 2 +- .../alloca/err.alloca-bcopy-crossing-bottom.r | 2 +- .../alloca/err.alloca-bcopy-crossing-top.r | 2 +- .../alloca/err.alloca-crossing-clauses.r | 2 +- .../alloca/err.alloca-load-before-bottom.r | 2 +- .../funcs/alloca/err.alloca-load-beyond-top.r | 2 +- .../alloca/err.alloca-load-crossing-bottom.r | 2 +- .../alloca/err.alloca-null-deref-lvalue.r | 2 +- .../funcs/alloca/err.alloca-null-deref.r | 2 +- .../err.alloca-scratch-exceeding-bcopy.r | 2 +- .../alloca/err.alloca-store-before-bottom.r | 2 +- .../alloca/err.alloca-store-beyond-top.r | 2 +- .../alloca/err.alloca-store-crossing-bottom.r | 2 +- test/unittest/funcs/bcopy/err.badbcopy1.r | 2 +- test/unittest/funcs/bcopy/err.badbcopy4.r | 2 +- test/unittest/funcs/bcopy/err.badbcopy5.r | 2 +- test/unittest/funcs/bcopy/err.badbcopy6.r | 2 +- test/unittest/funcs/bcopy/err.badbcopy7.r | 2 +- test/unittest/funcs/bcopy/err.badbcopy8.r | 2 +- test/unittest/funcs/copyin/err.badaddr.r | 2 +- test/unittest/funcs/copyin/err.null_arg1.r | 2 +- test/unittest/funcs/copyinstr/err.badaddr.r | 2 +- test/unittest/funcs/copyinstr/err.null_arg1.r | 2 +- test/unittest/funcs/copyinto/err.badaddr.r | 2 +- test/unittest/funcs/copyinto/err.badsize.r | 2 +- test/unittest/funcs/copyinto/err.null_arg1.r | 2 +- test/unittest/funcs/err.badalloca.r.p | 12 +++++- test/unittest/funcs/err.link_ntopbadaddr.r | 2 +- test/unittest/funcs/err.link_ntopbadarg.r | 2 +- .../inet_ntoa6/err.inet_ntoa6.arg1_null.r | 2 +- .../err.inet_ntoa6.arg1_null_const.r | 2 +- test/unittest/funcs/strlen/tst.null.r | 2 +- test/unittest/funcs/strtok/tst.strtok_null.r | 2 +- .../funcs/strtok/tst.strtok_nulldel.r | 2 +- .../funcs/strtok/tst.strtok_nullstr.r | 2 +- .../funcs/strtok/tst.strtok_nullstr2.r | 2 +- .../funcs/substr/err.substr_null_arg1.r | 2 +- test/unittest/pointers/err.AllocaOverrun.r | 2 +- test/unittest/pointers/err.BadAlign.r | 2 +- test/unittest/pointers/err.InvalidAddress2.r | 2 +- test/unittest/pointers/err.InvalidAddress4.r | 2 +- .../speculation/err.CommitWithInvalid.r | 2 +- .../speculation/err.DiscardWithInvalid.r | 2 +- .../speculation/tst.SpecSizeVariations.r | 22 ---------- .../speculation/tst.SpecSizeVariations.sh | 2 +- test/unittest/speculation/tst.negcommit.r | 2 +- 86 files changed, 169 insertions(+), 148 deletions(-)bpf/get_bvar.c +4
-2@@ -48,8 +48,10 @@ noinline uint64_t dt_get_bvar(const dt_dctx_t *dctx, uint32_t id, uint32_t idx) mst->tstamp =bpf_ktime_get_ns ();return mst->tstamp; -case DIF_VAR_EPID : -return mst->epid; +case DIF_VAR_EPID : { +uint64_t val = mst->prid; +return (val <<32 ) | mst->epid; + }case DIF_VAR_ID :return mst->prid;case DIF_VAR_ARG0 :case DIF_VAR_ARG1 :case DIF_VAR_ARG2 :bpf/probe_error.c +1
-1@@ -31,7 +31,7 @@ noinline void dt_probe_error(const dt_dctx_t *dctx, uint64_t pc, uint64_t fault,int oldprid = mst->prid; mst->argv[0 ] =0 ; - mst->argv[1 ] = mst->epid; + mst->argv[1 ] = (((uint64_t )mst->prid) <<32 ) | mst->epid; mst->argv[2 ] = mst->clid; mst->argv[3 ] = pc; mst->argv[4 ] = fault;include/dtrace/universal.h +1
-1@@ -37,7 +37,7 @@ typedef uint16_t dtrace_actkind_t; /* action kind */typedef uint32_t dtrace_aggid_t ;/* aggregation identifier */ typedef uint32_t dtrace_cacheid_t ;/* predicate cache identifier */ -typedef uint32_t dtrace_epid_t ;/* enabled probe identifier */ +typedef uint64_t dtrace_epid_t ;/* enabled probe identifier */ typedef uint32_t dtrace_optid_t ;/* option identifier */ typedef uint32_t dtrace_specid_t ;/* speculation identifier */ libdtrace/dt_bpf.c +0
-2@@ -778,7 +778,6 @@ gmap_create_cpuinfo(dtrace_hdl_t *dtp)* The size of the memory region is the sum of: * - size of the DTrace machine state, rounded up to the nearest * multiple of 8 -* - 8 bytes padding for trace buffer alignment purposes * - maximum trace buffer record size, rounded up to the nearest * multiple of 8 * - size of dctx->mem (see dt_dctx.h) @@ -787,7 +786,6 @@ static int gmap_create_mem(dtrace_hdl_t *dtp) {size_t sz =roundup (sizeof (dt_mstate_t),8 ) + -8 +roundup (dtp->dt_maxreclen,8 ) +DMEM_SIZE (dtp);libdtrace/dt_cg.c +26
-17@@ -275,15 +275,9 @@ dt_cg_tramp_prologue_act(dt_pcb_t *pcb, dt_activity_t act)* buf = rc + roundup(sizeof(dt_mstate_t), 8); * // add %r0, roundup( * sizeof(dt_mstate_t), 8) -* *((uint64_t *)&buf[0]) = 0; -* // stdw [%r0 + 0], 0 -* buf += 8; // add %r0, 8 -* // (%r0 = pointer to buffer space) * dctx.buf = buf; // stdw [%r9 + DCTX_BUF], %r0 */ emit (dlp,BPF_ALU64_IMM (BPF_ADD ,BPF_REG_0 ,roundup (sizeof (dt_mstate_t),8 ))); -emit (dlp,BPF_STORE_IMM (BPF_DW ,BPF_REG_0 ,0 ,0 )); -emit (dlp,BPF_ALU64_IMM (BPF_ADD ,BPF_REG_0 ,8 ));emit (dlp,BPF_STORE (BPF_DW ,BPF_REG_9 ,DCTX_BUF ,BPF_REG_0 ));/* @@ -1094,8 +1088,6 @@ dt_cg_prologue(dt_pcb_t *pcb, dt_node_t *pred)* dctx->mst->specsize = 0;// stdw [%r0 + DMST_SPECSIZE], 0 * dctx->mst->epid = EPID; // stw [%r0 + DMST_EPID], EPID * dctx->mst->clid = CLID; // stw [%r0 + DMST_CLID], CLID -* *((uint32_t *)&buf[DBUF_EPID]) = EPID; -* // stw [%r9 + DBUF_EPID], EPID */ emit (dlp,BPF_LOAD (BPF_DW ,BPF_REG_0 ,BPF_REG_0 ,DCTX_MST ));emit (dlp,BPF_STORE_IMM (BPF_DW ,BPF_REG_0 ,DMST_FAULT ,0 ));@@ -1103,7 +1095,13 @@ dt_cg_prologue(dt_pcb_t *pcb, dt_node_t *pred)emit (dlp,BPF_STORE_IMM (BPF_DW ,BPF_REG_0 ,DMST_SPECSIZE ,0 ));emite (dlp,BPF_STORE_IMM (BPF_W ,BPF_REG_0 ,DMST_EPID ,-1 ), epid);emite (dlp,BPF_STORE_IMM (BPF_W ,BPF_REG_0 ,DMST_CLID ,-1 ), clid); -emite (dlp,BPF_STORE_IMM (BPF_W ,BPF_REG_9 ,DBUF_EPID ,-1 ), epid); + +/* +* Zero out the leading 4 bytes of the buffer. +* *((uint32_t *)&buf[DBUF_PAD]) = 0; +* // stw [%r9 + DBUF_PAD], 0 +*/ +emit (dlp,BPF_STORE_IMM (BPF_W ,BPF_REG_9 ,DBUF_PAD ,0 ));/* * Set the speculation ID field to zero to indicate no active @@ -1113,6 +1111,18 @@ dt_cg_prologue(dt_pcb_t *pcb, dt_node_t *pred)*/ emit (dlp,BPF_STORE_IMM (BPF_W ,BPF_REG_9 ,DBUF_SPECID ,0 )); +/* +* *((uint64_t *)&buf[DBUF_EPID]) = (dctx->mst->prid << 32) | EPID; +* // ld %r1, [%r0 + DMST_PRID] +* // lsh %r1, 32 +* // or %r1, epid +* // stdw [%r9 + DBUF_EPID], %r1 +*/ +emit (dlp,BPF_LOAD (BPF_W ,BPF_REG_1 ,BPF_REG_0 ,DMST_PRID )); +emit (dlp,BPF_ALU64_IMM (BPF_LSH ,BPF_REG_1 ,32 )); +emite (dlp,BPF_ALU64_IMM (BPF_OR ,BPF_REG_1 ,-1 ), epid); +emit (dlp,BPF_STORE (BPF_DW ,BPF_REG_9 ,DBUF_EPID ,BPF_REG_1 )); +/* * If there is a predicate: * @@ -1131,10 +1141,9 @@ dt_cg_prologue(dt_pcb_t *pcb, dt_node_t *pred)TRACE_REGSET ("Prologue: End " );/* -* Account for 32-bit EPID (at offset 0) and 32-bit speculation ID (at -* offset 4). +* Set the offset for the beginning of trace data. */ - pcb->pcb_bufoff +=2 *sizeof (uint32_t ); + pcb->pcb_bufoff =DBUF_DATA ; }/* @@ -1169,15 +1178,15 @@ dt_cg_epilogue(dt_pcb_t *pcb)/* * rc = bpf_perf_event_output(dctx->ctx, &buffers, * BPF_F_CURRENT_CPU, -* buf - 4, bufoff + 4); +* buf + 4, bufoff - 4); * // lddw %r1, [%fp + DT_STK_DCTX] * // lddw %r1, [%r1 + DCTX_CTX] * // lddw %r2, &buffers * // lddw %r3, BPF_F_CURRENT_CPU * // mov %r4, %r9 -* // add %r4, -4 +* // add %r4, 4 * // mov %r5, pcb->pcb_bufoff -* // add %r5, 4 +* // add %r5, -4 * // call bpf_perf_event_output */ emit (dlp,BPF_LOAD (BPF_DW ,BPF_REG_1 ,BPF_REG_FP ,DT_STK_DCTX ));@@ -1185,9 +1194,9 @@ dt_cg_epilogue(dt_pcb_t *pcb)dt_cg_xsetx (dlp, buffers,DT_LBL_NONE ,BPF_REG_2 , buffers->di_id);dt_cg_xsetx (dlp,NULL ,DT_LBL_NONE ,BPF_REG_3 ,BPF_F_CURRENT_CPU );emit (dlp,BPF_MOV_REG (BPF_REG_4 ,BPF_REG_9 )); -emit (dlp,BPF_ALU64_IMM (BPF_ADD ,BPF_REG_4 ,-4 )); +emit (dlp,BPF_ALU64_IMM (BPF_ADD ,BPF_REG_4 ,4 ));emit (dlp,BPF_MOV_IMM (BPF_REG_5 , pcb->pcb_bufoff)); -emit (dlp,BPF_ALU64_IMM (BPF_ADD ,BPF_REG_5 ,4 )); +emit (dlp,BPF_ALU64_IMM (BPF_ADD ,BPF_REG_5 ,-4 ));emit (dlp,BPF_CALL_HELPER (BPF_FUNC_perf_event_output));/* libdtrace/dt_consume.c +19
-9@@ -14,9 +14,11 @@#include <ctype.h> #include <alloca.h> #include <dt_impl.h> +#include <dt_dctx.h> #include <dt_module.h> #include <dt_pcap.h> #include <dt_peb.h> +#include <dt_probe.h> #include <dt_state.h> #include <dt_string.h> #include <libproc.h> @@ -478,7 +480,7 @@ dt_flowindent(dtrace_hdl_t *dtp, dtrace_probedata_t *data, dtrace_epid_t last)*/ if (flow ==DTRACEFLOW_ENTRY ) {if (last !=DTRACE_EPIDNONE && id != last && - pd->id == dtp->dt_pdesc[last]->id) + pd->id == dtp->dt_probes[last >>32 ]->desc->id) flow =DTRACEFLOW_NONE ; }@@ -2202,19 +2204,23 @@ dt_consume_one_probe(dtrace_hdl_t *dtp, FILE *fp, char *data, uint32_t size, int peekflags, dtrace_epid_t *last, int committing, void *arg) { + int specid;dtrace_epid_t epid; +uint32_t prid;dtrace_datadesc_t *epd;dt_spec_buf_t tmpl;dt_spec_buf_t *dtsb; -int specid;int i;int rval;dtrace_workstatus_t ret;int commit_discard_seen, only_commit_discards;int data_recording =1 ; - epid = ((uint32_t *)data)[0 ]; - specid = ((uint32_t *)data)[1 ]; + specid = *((uint32_t *)(data +DBUF_SPECID )); + epid = *((uint64_t *)(data +DBUF_EPID )); + prid = epid >>32 ; +if (prid > dtp->dt_probe_id) +return dt_set_errno (dtp,EDT_BADEPID );/* * Fill in the epid and address of the epid in the buffer. We need to @@ -2227,6 +2233,7 @@ dt_consume_one_probe(dtrace_hdl_t *dtp, FILE *fp, char *data, uint32_t size, &pdat->dtpda_pdesc);if (rval !=0 )return dt_set_errno (dtp,EDT_BADEPID ); + pdat->dtpda_pdesc = (dtrace_probedesc_t *)dtp->dt_probes[prid]->desc; epd = pdat->dtpda_ddesc;if (epd->dtdd_uarg !=DT_ECB_DEFAULT ) {@@ -2661,9 +2668,8 @@ dt_consume_one(dtrace_hdl_t *dtp, FILE *fp, char *buf,* struct { * struct perf_event_header header; * uint32_t size; -* uint32_t pad; -* uint32_t epid; * uint32_t specid; +* dtrace_epid_t epid; * uint64_t data[n]; * } * and 'data' points to the 'size' member at this point. @@ -2673,13 +2679,17 @@ dt_consume_one(dtrace_hdl_t *dtp, FILE *fp, char *buf,return dt_set_errno (dtp,EDT_DSIZE ); size = *(uint32_t *)data; - data +=sizeof (size); ptr +=sizeof (size) + size;if (ptr != buf + hdr->size)return dt_set_errno (dtp,EDT_DSIZE ); - data +=sizeof (uint32_t );/* skip padding */ - size -=sizeof (uint32_t ); +/* +* The "size" measures from specid to the end. But our buffer +* offsets are relative to &size itself, to preserve 8-byte +* alignment. So, we leave data pointing at size, and we increase +* size by 4 bytes. +*/ + size +=4 ; return dt_consume_one_probe(dtp, fp, data, size, pdat, efunc, rfunc, flow, quiet, peekflags,libdtrace/dt_dctx.h +8
-4@@ -82,16 +82,20 @@ typedef struct dt_dctx {* The dctx->buf pointer references a block of memory that contains: * * +----------------+ -* 0 -> | EPID | +* 0 -> | pad | * +----------------+ -* 4 -> | Speculation ID | +* 4 -> | Speculation ID | * +----------------+ -* | Trace Data | +* 8 -> | EPID | +* +----------------+ +* 16 -> | Trace Data | * | ... | * +----------------+ */ -#define DBUF_EPID 0 +#define DBUF_PAD 0#define DBUF_SPECID 4 +#define DBUF_EPID 8 +#define DBUF_DATA 16/* * The dctx->mem pointer references a block of memory that contains: libdtrace/dt_handle.c +5
-4@@ -14,6 +14,7 @@#include <alloca.h> #include <dt_impl.h> +#include <dt_probe.h> #include <dt_program.h> static const char _dt_errprog[] =@@ -147,11 +148,11 @@ dt_handle_err(dtrace_hdl_t *dtp, dtrace_probedata_t *data)* This is an error. We have the following items here: EPID, * faulting action, BPF pc, fault code and faulting address. */ - epid = (uint32_t )DT_REC (uint64_t,0 ); + epid =DT_REC (uint64_t,0 );if (dt_epid_lookup (dtp, epid, &errdd, &errpd) !=0 )return dt_set_errno (dtp,EDT_BADERROR ); - + errpd = (dtrace_probedesc_t *)dtp->dt_probes[epid>>32 ]->desc; err.dteda_ddesc = errdd; err.dteda_pdesc = errpd; err.dteda_cpu = data->dtpda_cpu;@@ -195,7 +196,7 @@ no_addr: details[0 ] =0 ; } - snprintf(str, len, "error on enabled probe ID %u (ID %u: %s:%s:%s:%s): " + snprintf(str, len, "error on enabled probe ID %lu (ID %u: %s:%s:%s:%s): " "%s%s in %s%s", epid, errpd->id, errpd->prv, errpd->mod, errpd->fun, errpd->prb, dtrace_faultstr(dtp, err.dteda_fault), details,@@ -256,7 +257,7 @@ dt_handle_liberr(dtrace_hdl_t *dtp, const dtrace_probedata_t *data, str =alloca (len);snprintf (str, len, -"error on enabled probe ID %u (ID %u: %s:%s:%s:%s): %s" , +"error on enabled probe ID %lu (ID %u: %s:%s:%s:%s): %s" , data->dtpda_epid, errpd->id, errpd->prv, errpd->mod, errpd->fun, errpd->prb, faultstr);libdtrace/dt_map.c +3
-0@@ -137,6 +137,9 @@ int dt_epid_lookup(dtrace_hdl_t *dtp, dtrace_epid_t epid, dtrace_datadesc_t **ddp, dtrace_probedesc_t **pdp) { +/* Remove the PRID portion of the EPID. */ + epid &=0xffffffff ; +if (epid >= dtp->dt_maxprobe || dtp->dt_ddesc[epid] ==NULL || dtp->dt_pdesc[epid] ==NULL )return -1 ;libdtrace/dt_open.c +1
-1@@ -169,7 +169,7 @@ static const dt_ident_t _dtrace_globals[] = { {"discard" ,DT_IDENT_ACTFUNC ,0 ,DT_ACT_DISCARD ,DT_ATTR_STABCMN ,DT_VERS_1_0 , &dt_idops_func, "void(int)" }, { "epid", DT_IDENT_SCALAR, 0, DIF_VAR_EPID, DT_ATTR_STABCMN, DT_VERS_1_0, - &dt_idops_type, "uint_t" }, + &dt_idops_type, "uint64_t" }, { "errno", DT_IDENT_SCALAR, 0, DIF_VAR_ERRNO, DT_ATTR_STABCMN, DT_VERS_1_0, &dt_idops_type, "int" }, { "execname", DT_IDENT_SCALAR, 0, DIF_VAR_EXECNAME,test/demo/dtrace/error.r +1
-1@@ -3,4 +3,4 @@ -- @@stderr -- dtrace: script 'test/demo/dtrace/error.d' matched 2 probes -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/stress/buffering/tst.resize3-manual.r +1
-1@@ -1,5 +1,5 @@ FUNCTION:NAME - :BEGIN 3 + :BEGIN 4294967299 :BEGIN -- @@stderr --test/stress/buffering/tst.resize3.r +1
-1@@ -1,5 +1,5 @@ FUNCTION:NAME - :BEGIN 3 + :BEGIN 4294967299 :BEGIN -- @@stderr --test/unittest/actions/setopt/tst.badopt.r +7
-7@@ -1,16 +1,16 @@ -- @@stderr -- -dtrace: error on enabled probe ID 2 (ID 1: dtrace:::BEGIN): couldn't set option "Nixon" to "1": Invalid option name +dtrace: error on enabled probe ID 4294967298 (ID 1: dtrace:::BEGIN): couldn't set option "Nixon" to "1": Invalid option name -dtrace: error on enabled probe ID 2 (ID 1: dtrace:::BEGIN): couldn't set option "Harding" to "1": Invalid option name +dtrace: error on enabled probe ID 4294967298 (ID 1: dtrace:::BEGIN): couldn't set option "Harding" to "1": Invalid option name -dtrace: error on enabled probe ID 2 (ID 1: dtrace:::BEGIN): couldn't set option "Hoover" to "1": Invalid option name +dtrace: error on enabled probe ID 4294967298 (ID 1: dtrace:::BEGIN): couldn't set option "Hoover" to "1": Invalid option name -dtrace: error on enabled probe ID 2 (ID 1: dtrace:::BEGIN): couldn't set option "Bush" to "1": Invalid option name +dtrace: error on enabled probe ID 4294967298 (ID 1: dtrace:::BEGIN): couldn't set option "Bush" to "1": Invalid option name -dtrace: error on enabled probe ID 2 (ID 1: dtrace:::BEGIN): couldn't set option "quiet" to "um, no": Invalid value for specified option +dtrace: error on enabled probe ID 4294967298 (ID 1: dtrace:::BEGIN): couldn't set option "quiet" to "um, no": Invalid value for specified option -dtrace: error on enabled probe ID 2 (ID 1: dtrace:::BEGIN): couldn't set option "aggrate" to "0.5hz": Invalid value for specified option +dtrace: error on enabled probe ID 4294967298 (ID 1: dtrace:::BEGIN): couldn't set option "aggrate" to "0.5hz": Invalid value for specified option -dtrace: error on enabled probe ID 2 (ID 1: dtrace:::BEGIN): couldn't set option "bufsize" to "1m": Operation illegal when tracing is active +dtrace: error on enabled probe ID 4294967298 (ID 1: dtrace:::BEGIN): couldn't set option "bufsize" to "1m": Operation illegal when tracing is activetest/unittest/arrays/tst.declared-bounds.runtime_out.r +1
-1@@ -1,3 +1,3 @@ expected run-time error -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): index out of bounds (8) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): index out of bounds (8) in action #1 at BPF pc NNNtest/unittest/codegen/err.deref_0.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address (0) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address (0) in action #1 at BPF pc NNNtest/unittest/codegen/err.deref_1.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address (1) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address (1) in action #1 at BPF pc NNNtest/unittest/codegen/err.deref_i0.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address (0) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address (0) in action #1 at BPF pc NNNtest/unittest/codegen/err.deref_i1.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address (1) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address (1) in action #1 at BPF pc NNNtest/unittest/codegen/err.deref_string-assoc.r +1
-1@@ -1,3 +1,3 @@ 66 -- @@stderr -- -dtrace: error on enabled probe ID 4 (ID 1: dtrace:::BEGIN): invalid address (1) in action #2 at BPF pc NNN +dtrace: error on enabled probe ID 4294967300 (ID 1: dtrace:::BEGIN): invalid address (1) in action #2 at BPF pc NNNtest/unittest/codegen/err.deref_string-gvar.r +1
-1@@ -1,3 +1,3 @@ 66 -- @@stderr -- -dtrace: error on enabled probe ID 4 (ID 1: dtrace:::BEGIN): invalid address (1) in action #2 at BPF pc NNN +dtrace: error on enabled probe ID 4294967300 (ID 1: dtrace:::BEGIN): invalid address (1) in action #2 at BPF pc NNNtest/unittest/codegen/err.deref_string-lvar.r +1
-1@@ -1,3 +1,3 @@ 66 -- @@stderr -- -dtrace: error on enabled probe ID 4 (ID 1: dtrace:::BEGIN): invalid address (1) in action #2 at BPF pc NNN +dtrace: error on enabled probe ID 4294967300 (ID 1: dtrace:::BEGIN): invalid address (1) in action #2 at BPF pc NNNtest/unittest/codegen/err.deref_string-tvar.r +1
-1@@ -1,3 +1,3 @@ 66 -- @@stderr -- -dtrace: error on enabled probe ID 4 (ID 1: dtrace:::BEGIN): invalid address (1) in action #2 at BPF pc NNN +dtrace: error on enabled probe ID 4294967300 (ID 1: dtrace:::BEGIN): invalid address (1) in action #2 at BPF pc NNNtest/unittest/codegen/err.str_NULL_plus_offset-assoc.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/codegen/err.str_NULL_plus_offset-lvar.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/codegen/err.str_NULL_plus_offset-tvar.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/codegen/err.str_NULL_plus_offset.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/disasm/tst.vartab-bvar.r +1
-1@@ -4,7 +4,7 @@ curthread scl glb r D type (pointer) (size 8) timestamp scl glb r D type (integer) (size 8) vtimestamp scl glb r D type (integer) (size 8) ipl scl glb r D type (integer) (size 4) -epid scl glb r D type (integer) (size 4) +epid scl glb r D type (integer) (size 8) id scl glb r D type (integer) (size 4) arg0 scl glb r D type (integer) (size 8) arg1 scl glb r D type (integer) (size 8)test/unittest/error/tst.DTRACEFLT_BADADDR.null_ptr_field.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/error/tst.DTRACEFLT_BADADDR.r +2
-2@@ -1,6 +1,6 @@ -The arguments are 3 1 1 0 +The arguments are 4294967299 1 1 0 The value of arg4 should be 1 The value of arg5 should be 0 -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/error/tst.DTRACEFLT_DIVZERO.div.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): divide-by-zero in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): divide-by-zero in action #1 at BPF pc NNNtest/unittest/error/tst.DTRACEFLT_DIVZERO.mod.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): divide-by-zero in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): divide-by-zero in action #1 at BPF pc NNNtest/unittest/error/tst.DTRACEFLT_UNKNOWN.r +2
-2@@ -1,5 +1,5 @@ -The arguments are 3 1 PC 1 64 +The arguments are 4294967299 1 PC 1 64 The value of arg4 = 0 -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/error/tst.clause_scope-begin-ended.r +1
-1@@ -2,4 +2,4 @@ Error fired Clause executed -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/error/tst.clause_scope-begin.r +1
-1@@ -2,4 +2,4 @@ Error fired Clause executed -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/error/tst.clause_scope-regular.r.p +10
-2@@ -1,3 +1,11 @@ -#!/bin/sed -f +#!/usr/bin/awk -f + # This report has a variable probe ID in it. -s/ID [0-9][0-9]*: profile/ID nnn: profile/ +/^dtrace: error on enabled probe ID / { + $7 = and($7, 0xffffffff); # mask out the high 32 bits (variable prid) +} + +{ + sub("ID [0-9][0-9]*: profile", "ID nnn: profile"); + print; +}test/unittest/error/tst.error.r +1
-1@@ -1,4 +1,4 @@ Error fired -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/error/tst.errorend.r +1
-1@@ -2,4 +2,4 @@ Error fired End fired after exit -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/alloca/err.alloca-bcopy-before-beyond.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/alloca/err.alloca-bcopy-before-bottom.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/alloca/err.alloca-bcopy-beyond-top.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/alloca/err.alloca-bcopy-crossing-bottom.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/alloca/err.alloca-bcopy-crossing-top.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid size ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid size ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/alloca/err.alloca-crossing-clauses.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 4 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #2 at BPF pc NNN +dtrace: error on enabled probe ID 4294967300 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #2 at BPF pc NNNtest/unittest/funcs/alloca/err.alloca-load-before-bottom.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/alloca/err.alloca-load-beyond-top.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/alloca/err.alloca-load-crossing-bottom.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/alloca/err.alloca-null-deref-lvalue.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/alloca/err.alloca-null-deref.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/alloca/err.alloca-scratch-exceeding-bcopy.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid size ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid size ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/alloca/err.alloca-store-before-bottom.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/alloca/err.alloca-store-beyond-top.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/alloca/err.alloca-store-crossing-bottom.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/bcopy/err.badbcopy1.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/bcopy/err.badbcopy4.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/bcopy/err.badbcopy5.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/bcopy/err.badbcopy6.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid size ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid size ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/bcopy/err.badbcopy7.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid size ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid size ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/bcopy/err.badbcopy8.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid size ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid size ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/copyin/err.badaddr.r +1
-1@@ -3,4 +3,4 @@ -- @@stderr -- dtrace: script 'test/unittest/funcs/copyin/err.badaddr.d' matched 2 probes -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/copyin/err.null_arg1.r +1
-1@@ -3,4 +3,4 @@ -- @@stderr -- dtrace: script 'test/unittest/funcs/copyin/err.null_arg1.d' matched 2 probes -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/copyinstr/err.badaddr.r +1
-1@@ -3,4 +3,4 @@ -- @@stderr -- dtrace: script 'test/unittest/funcs/copyinstr/err.badaddr.d' matched 2 probes -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/copyinstr/err.null_arg1.r +1
-1@@ -3,4 +3,4 @@ -- @@stderr -- dtrace: script 'test/unittest/funcs/copyinstr/err.null_arg1.d' matched 2 probes -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/copyinto/err.badaddr.r +1
-1@@ -3,4 +3,4 @@ -- @@stderr -- dtrace: script 'test/unittest/funcs/copyinto/err.badaddr.d' matched 2 probes -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/copyinto/err.badsize.r +1
-1@@ -3,4 +3,4 @@ -- @@stderr -- dtrace: script 'test/unittest/funcs/copyinto/err.badsize.d' matched 2 probes -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid size ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid size ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/copyinto/err.null_arg1.r +1
-1@@ -3,4 +3,4 @@ -- @@stderr -- dtrace: script 'test/unittest/funcs/copyinto/err.null_arg1.d' matched 2 probes -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/err.badalloca.r.p +10
-2@@ -1,3 +1,11 @@ -#!/bin/sed -f +#!/usr/bin/awk -f -s/(ID [0-9]*/(ID NNN/g +# This report has a variable probe ID in it. +/^dtrace: error on enabled probe ID / { + $7 = and($7, 0xffffffff); # mask out the high 32 bits (variable prid) +} + +{ + sub("ID [0-9]*: profile", "ID NNN: profile"); + print; +}test/unittest/funcs/err.link_ntopbadaddr.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/err.link_ntopbadarg.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): illegal operation in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): illegal operation in action #1 at BPF pc NNNtest/unittest/funcs/inet_ntoa6/err.inet_ntoa6.arg1_null.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/inet_ntoa6/err.inet_ntoa6.arg1_null_const.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/strlen/tst.null.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/strtok/tst.strtok_null.r +1
-1@@ -3,4 +3,4 @@ -- @@stderr -- dtrace: script 'test/unittest/funcs/strtok/tst.strtok_null.d' matched 2 probes -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/strtok/tst.strtok_nulldel.r +1
-1@@ -3,4 +3,4 @@ -- @@stderr -- dtrace: script 'test/unittest/funcs/strtok/tst.strtok_nulldel.d' matched 2 probes -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/strtok/tst.strtok_nullstr.r +1
-1@@ -3,4 +3,4 @@ -- @@stderr -- dtrace: script 'test/unittest/funcs/strtok/tst.strtok_nullstr.d' matched 2 probes -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/strtok/tst.strtok_nullstr2.r +1
-1@@ -4,4 +4,4 @@ -- @@stderr -- dtrace: script 'test/unittest/funcs/strtok/tst.strtok_nullstr2.d' matched 4 probes -dtrace: error on enabled probe ID 4 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #2 at BPF pc NNN +dtrace: error on enabled probe ID 4294967300 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #2 at BPF pc NNNtest/unittest/funcs/substr/err.substr_null_arg1.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/pointers/err.AllocaOverrun.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/pointers/err.BadAlign.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/pointers/err.InvalidAddress2.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/pointers/err.InvalidAddress4.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/speculation/err.CommitWithInvalid.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 4 (ID 1: dtrace:::BEGIN): illegal operation in action #2 at BPF pc NNN +dtrace: error on enabled probe ID 4294967300 (ID 1: dtrace:::BEGIN): illegal operation in action #2 at BPF pc NNNtest/unittest/speculation/err.DiscardWithInvalid.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 4 (ID 1: dtrace:::BEGIN): illegal operation in action #2 at BPF pc NNN +dtrace: error on enabled probe ID 4294967300 (ID 1: dtrace:::BEGIN): illegal operation in action #2 at BPF pc NNNtest/unittest/speculation/tst.SpecSizeVariations.r +0
-22@@ -11,26 +11,6 @@ Speculative buffer ID: 1 123456706 counts: 1 1 -Speculative buffer ID: 1 -123456700 -123456701 -123456702 -123456703 -123456704 -123456705 -123456706 -counts: 1 1 - -Speculative buffer ID: 1 -123456700 -123456701 -123456702 -123456703 -123456704 -123456705 -123456706 -counts: 2 1 - Speculative buffer ID: 1 123456700 123456701@@ -64,5 +44,3 @@ counts: 2 1 dtrace: 2 speculative drops dtrace: 1 speculative drop dtrace: 1 speculative drop -dtrace: 1 speculative drop -dtrace: 1 speculative droptest/unittest/speculation/tst.SpecSizeVariations.sh +1
-1@@ -9,7 +9,7 @@ dtrace=$1 -for x in 63 64 79 80 143 144; do +for x in 71 72 159 160; do $dtrace $dt_flags -xspecsize=$x -qn ' BEGIN {test/unittest/speculation/tst.negcommit.r +1
-1@@ -3,4 +3,4 @@ -- @@stderr -- dtrace: script 'test/unittest/speculation/tst.negcommit.d' matched 2 probes -dtrace: error on enabled probe ID 2 (ID 1: dtrace:::BEGIN): illegal operation in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967298 (ID 1: dtrace:::BEGIN): illegal operation in action #1 at BPF pc NNNSignature · 7 lines
2.43.5 _______________________________________________ DTrace-devel mailing list [email protected] https://oss.oracle.com/mailman/listinfo/dtrace-devel
Re: [DTrace-devel] [PATCH v2 32/38] Widen the EPID to include the PRID
Quoted 39 lines · Kris Van Hees
Quoted 6 lines · eugene.loh--- via DTrace-devel
From: Eugene Loh <[email protected]>
Each output record has a EPID associated with it, allowing the consumer to get both a data description and a PRID (so it can report PRID and probe function and name). We want to support uprobes that trigger for multiple PRIDs, however, basically breaking this scheme.
So, the EPID is (before this patch) an index into a list of ddescs and pdescs, effectively associating an id (EPID) with a { ddesc, pdesc } pair. It is also a unique id for a clause as it is used for a particular pdesc. When you have multiple probes that match a given pdesc for a given clause, the EPID still identifies the correct ddesc, but obviously the pdesc data won't be quite what you expect since that is PRID dependent.
Which is indeed why we need extra information, as you outline below...
Quoted 3 lines
So, expand the EPID to 64 bits, half for the old-style EPID (based on static information about the D programs) and half for the PRID (discovered at run time).
Of course, this is only really needed for select providers (e.g. USDT) whereas for all other cases, the single EPID suffices on its own. Therefore, I would expect that we do not place the PRID in the upper 32 buts of the EPID *unless* it is needed to override the "template" PRID that is associated with the basic EPID (lower 32 bits). Doing things that way things will look more familiar anyway for users who expect to typically see EPIDs in low values, and it also keeps the code design where (in general) the EPID identifies the ddesc and the pdesc.
It means we have some code that needs to deal with the exception case, but I don't see that as a problem becacuse most of the time it won't be used.
In that sense, we could look at the USDT-type case as an exceptional case. So, it would need special code in
dt_get_bvar()to put the PRID in the top 32 bits of the EPID when it needs to return the value for epid. Which means it needs to know when to do so. That could perhaps be done using some flag in the mstate or something. Similarly, the prologue of the clause could put the PRID in those top 32 bits when the clause is called for a case that needs it (which perhaps again could be indicated in the mstate)?
Quoted 8 lines
In fact, if that works, then such a flag in the mstate can also be used to dynamically generate the provider name (probeprov bvar) rather than needing to add it to the strtab as a string. That might solve some additional issues or complexities that are seen in other patches where the strtab is getting updated at runtime to add more strings.
Why would a scheme like this not work? I.e. why do we need to add the PRID in the top 32 bits of a 64-bit EPID for *all* cases when only USDT needs it?
I don't think we're forced into the choice presented by this patch. Other solutions are possible. I just don't see the value is having two solutions, one for non-USDT/non-pid and one for USDT/pid. (You say something will be more familiar to users, but... what exactly is more familiar? Users know what EPID 23 is?) (You talk about dynamically generating the provname bvar. That's a cool/interesting idea, but it seems to me to be independent of what we're talking about here.) Some things can be streamlined if we just settle on one way of capturing epid->prid info for the consumer. Instead of two solutions -- both "prid in high epid bits" as well as "pdesc[epid]" mapping -- we can throw the pdesc away.
tl/dr. We could maintain two mechanisms for doing this stuff. I just don't see what the value is in maintaining two mechanisms for solving one problem.
Quoted 1,256 lines
Quoted 1,256 lines
The EPID seen by compile-time files like
dt_cc.cordt_map.care still the old-style EPIDs (even if now 64-bit) since they have no knowledge of the run-time PRIDs.Further, we do not need to expand:
- the mstate (since it already had the PRID anyhow)
- the output buffer (since it already had an unused 4-byte pad)The combination of EPID and PRID is for the built-in variable epid as well as what the consumer reads.
Signed-off-by Eugene Loh <[email protected]>--- bpf/get_bvar.c | 6 ++- bpf/probe_error.c | 2 +- include/dtrace/universal.h | 2 +- libdtrace/dt_bpf.c | 2 - libdtrace/dt_cg.c | 43 +++++++++++-------- libdtrace/dt_consume.c | 28 ++++++++---- libdtrace/dt_dctx.h | 12 ++++-- libdtrace/dt_handle.c | 9 ++-- libdtrace/dt_map.c | 3 ++ libdtrace/dt_open.c | 2 +- test/demo/dtrace/error.r | 2 +- test/stress/buffering/tst.resize3-manual.r | 2 +- test/stress/buffering/tst.resize3.r | 2 +- test/unittest/actions/setopt/tst.badopt.r | 14 +++--- .../arrays/tst.declared-bounds.runtime_out.r | 2 +- test/unittest/codegen/err.deref_0.r | 2 +- test/unittest/codegen/err.deref_1.r | 2 +- test/unittest/codegen/err.deref_i0.r | 2 +- test/unittest/codegen/err.deref_i1.r | 2 +- .../unittest/codegen/err.deref_string-assoc.r | 2 +- test/unittest/codegen/err.deref_string-gvar.r | 2 +- test/unittest/codegen/err.deref_string-lvar.r | 2 +- test/unittest/codegen/err.deref_string-tvar.r | 2 +- .../codegen/err.str_NULL_plus_offset-assoc.r | 2 +- .../codegen/err.str_NULL_plus_offset-lvar.r | 2 +- .../codegen/err.str_NULL_plus_offset-tvar.r | 2 +- .../codegen/err.str_NULL_plus_offset.r | 2 +- test/unittest/disasm/tst.vartab-bvar.r | 2 +- .../tst.DTRACEFLT_BADADDR.null_ptr_field.r | 2 +- test/unittest/error/tst.DTRACEFLT_BADADDR.r | 4 +- .../error/tst.DTRACEFLT_DIVZERO.div.r | 2 +- .../error/tst.DTRACEFLT_DIVZERO.mod.r | 2 +- test/unittest/error/tst.DTRACEFLT_UNKNOWN.r | 4 +- .../error/tst.clause_scope-begin-ended.r | 2 +- test/unittest/error/tst.clause_scope-begin.r | 2 +- .../error/tst.clause_scope-regular.r.p | 12 +++++- test/unittest/error/tst.error.r | 2 +- test/unittest/error/tst.errorend.r | 2 +- .../alloca/err.alloca-bcopy-before-beyond.r | 2 +- .../alloca/err.alloca-bcopy-before-bottom.r | 2 +- .../alloca/err.alloca-bcopy-beyond-top.r | 2 +- .../alloca/err.alloca-bcopy-crossing-bottom.r | 2 +- .../alloca/err.alloca-bcopy-crossing-top.r | 2 +- .../alloca/err.alloca-crossing-clauses.r | 2 +- .../alloca/err.alloca-load-before-bottom.r | 2 +- .../funcs/alloca/err.alloca-load-beyond-top.r | 2 +- .../alloca/err.alloca-load-crossing-bottom.r | 2 +- .../alloca/err.alloca-null-deref-lvalue.r | 2 +- .../funcs/alloca/err.alloca-null-deref.r | 2 +- .../err.alloca-scratch-exceeding-bcopy.r | 2 +- .../alloca/err.alloca-store-before-bottom.r | 2 +- .../alloca/err.alloca-store-beyond-top.r | 2 +- .../alloca/err.alloca-store-crossing-bottom.r | 2 +- test/unittest/funcs/bcopy/err.badbcopy1.r | 2 +- test/unittest/funcs/bcopy/err.badbcopy4.r | 2 +- test/unittest/funcs/bcopy/err.badbcopy5.r | 2 +- test/unittest/funcs/bcopy/err.badbcopy6.r | 2 +- test/unittest/funcs/bcopy/err.badbcopy7.r | 2 +- test/unittest/funcs/bcopy/err.badbcopy8.r | 2 +- test/unittest/funcs/copyin/err.badaddr.r | 2 +- test/unittest/funcs/copyin/err.null_arg1.r | 2 +- test/unittest/funcs/copyinstr/err.badaddr.r | 2 +- test/unittest/funcs/copyinstr/err.null_arg1.r | 2 +- test/unittest/funcs/copyinto/err.badaddr.r | 2 +- test/unittest/funcs/copyinto/err.badsize.r | 2 +- test/unittest/funcs/copyinto/err.null_arg1.r | 2 +- test/unittest/funcs/err.badalloca.r.p | 12 +++++- test/unittest/funcs/err.link_ntopbadaddr.r | 2 +- test/unittest/funcs/err.link_ntopbadarg.r | 2 +- .../inet_ntoa6/err.inet_ntoa6.arg1_null.r | 2 +- .../err.inet_ntoa6.arg1_null_const.r | 2 +- test/unittest/funcs/strlen/tst.null.r | 2 +- test/unittest/funcs/strtok/tst.strtok_null.r | 2 +- .../funcs/strtok/tst.strtok_nulldel.r | 2 +- .../funcs/strtok/tst.strtok_nullstr.r | 2 +- .../funcs/strtok/tst.strtok_nullstr2.r | 2 +- .../funcs/substr/err.substr_null_arg1.r | 2 +- test/unittest/pointers/err.AllocaOverrun.r | 2 +- test/unittest/pointers/err.BadAlign.r | 2 +- test/unittest/pointers/err.InvalidAddress2.r | 2 +- test/unittest/pointers/err.InvalidAddress4.r | 2 +- .../speculation/err.CommitWithInvalid.r | 2 +- .../speculation/err.DiscardWithInvalid.r | 2 +- .../speculation/tst.SpecSizeVariations.r | 22 ---------- .../speculation/tst.SpecSizeVariations.sh | 2 +- test/unittest/speculation/tst.negcommit.r | 2 +- 86 files changed, 169 insertions(+), 148 deletions(-)bpf/get_bvar.c +4
-2@@ -48,8 +48,10 @@ noinline uint64_t dt_get_bvar(const dt_dctx_t *dctx, uint32_t id, uint32_t idx) mst->tstamp =bpf_ktime_get_ns ();return mst->tstamp; -case DIF_VAR_EPID : -return mst->epid; +case DIF_VAR_EPID : { +uint64_t val = mst->prid; +return (val <<32 ) | mst->epid; + }case DIF_VAR_ID :return mst->prid;case DIF_VAR_ARG0 :case DIF_VAR_ARG1 :case DIF_VAR_ARG2 :bpf/probe_error.c +1
-1@@ -31,7 +31,7 @@ noinline void dt_probe_error(const dt_dctx_t *dctx, uint64_t pc, uint64_t fault,int oldprid = mst->prid; mst->argv[0 ] =0 ; - mst->argv[1 ] = mst->epid; + mst->argv[1 ] = (((uint64_t )mst->prid) <<32 ) | mst->epid; mst->argv[2 ] = mst->clid; mst->argv[3 ] = pc; mst->argv[4 ] = fault;include/dtrace/universal.h +1
-1@@ -37,7 +37,7 @@ typedef uint16_t dtrace_actkind_t; /* action kind */typedef uint32_t dtrace_aggid_t ;/* aggregation identifier */ typedef uint32_t dtrace_cacheid_t ;/* predicate cache identifier */ -typedef uint32_t dtrace_epid_t ;/* enabled probe identifier */ +typedef uint64_t dtrace_epid_t ;/* enabled probe identifier */ typedef uint32_t dtrace_optid_t ;/* option identifier */ typedef uint32_t dtrace_specid_t ;/* speculation identifier */ libdtrace/dt_bpf.c +0
-2@@ -778,7 +778,6 @@ gmap_create_cpuinfo(dtrace_hdl_t *dtp)* The size of the memory region is the sum of: * - size of the DTrace machine state, rounded up to the nearest * multiple of 8 -* - 8 bytes padding for trace buffer alignment purposes * - maximum trace buffer record size, rounded up to the nearest * multiple of 8 * - size of dctx->mem (see dt_dctx.h) @@ -787,7 +786,6 @@ static int gmap_create_mem(dtrace_hdl_t *dtp) {size_t sz =roundup (sizeof (dt_mstate_t),8 ) + -8 +roundup (dtp->dt_maxreclen,8 ) +DMEM_SIZE (dtp);libdtrace/dt_cg.c +26
-17@@ -275,15 +275,9 @@ dt_cg_tramp_prologue_act(dt_pcb_t *pcb, dt_activity_t act)* buf = rc + roundup(sizeof(dt_mstate_t), 8); * // add %r0, roundup( * sizeof(dt_mstate_t), 8) -* *((uint64_t *)&buf[0]) = 0; -* // stdw [%r0 + 0], 0 -* buf += 8; // add %r0, 8 -* // (%r0 = pointer to buffer space) * dctx.buf = buf; // stdw [%r9 + DCTX_BUF], %r0 */ emit (dlp,BPF_ALU64_IMM (BPF_ADD ,BPF_REG_0 ,roundup (sizeof (dt_mstate_t),8 ))); -emit (dlp,BPF_STORE_IMM (BPF_DW ,BPF_REG_0 ,0 ,0 )); -emit (dlp,BPF_ALU64_IMM (BPF_ADD ,BPF_REG_0 ,8 ));emit (dlp,BPF_STORE (BPF_DW ,BPF_REG_9 ,DCTX_BUF ,BPF_REG_0 ));/* @@ -1094,8 +1088,6 @@ dt_cg_prologue(dt_pcb_t *pcb, dt_node_t *pred)* dctx->mst->specsize = 0;// stdw [%r0 + DMST_SPECSIZE], 0 * dctx->mst->epid = EPID; // stw [%r0 + DMST_EPID], EPID * dctx->mst->clid = CLID; // stw [%r0 + DMST_CLID], CLID -* *((uint32_t *)&buf[DBUF_EPID]) = EPID; -* // stw [%r9 + DBUF_EPID], EPID */ emit (dlp,BPF_LOAD (BPF_DW ,BPF_REG_0 ,BPF_REG_0 ,DCTX_MST ));emit (dlp,BPF_STORE_IMM (BPF_DW ,BPF_REG_0 ,DMST_FAULT ,0 ));@@ -1103,7 +1095,13 @@ dt_cg_prologue(dt_pcb_t *pcb, dt_node_t *pred)emit (dlp,BPF_STORE_IMM (BPF_DW ,BPF_REG_0 ,DMST_SPECSIZE ,0 ));emite (dlp,BPF_STORE_IMM (BPF_W ,BPF_REG_0 ,DMST_EPID ,-1 ), epid);emite (dlp,BPF_STORE_IMM (BPF_W ,BPF_REG_0 ,DMST_CLID ,-1 ), clid); -emite (dlp,BPF_STORE_IMM (BPF_W ,BPF_REG_9 ,DBUF_EPID ,-1 ), epid); + +/* +* Zero out the leading 4 bytes of the buffer. +* *((uint32_t *)&buf[DBUF_PAD]) = 0; +* // stw [%r9 + DBUF_PAD], 0 +*/ +emit (dlp,BPF_STORE_IMM (BPF_W ,BPF_REG_9 ,DBUF_PAD ,0 ));/* * Set the speculation ID field to zero to indicate no active @@ -1113,6 +1111,18 @@ dt_cg_prologue(dt_pcb_t *pcb, dt_node_t *pred)*/ emit (dlp,BPF_STORE_IMM (BPF_W ,BPF_REG_9 ,DBUF_SPECID ,0 )); +/* +* *((uint64_t *)&buf[DBUF_EPID]) = (dctx->mst->prid << 32) | EPID; +* // ld %r1, [%r0 + DMST_PRID] +* // lsh %r1, 32 +* // or %r1, epid +* // stdw [%r9 + DBUF_EPID], %r1 +*/ +emit (dlp,BPF_LOAD (BPF_W ,BPF_REG_1 ,BPF_REG_0 ,DMST_PRID )); +emit (dlp,BPF_ALU64_IMM (BPF_LSH ,BPF_REG_1 ,32 )); +emite (dlp,BPF_ALU64_IMM (BPF_OR ,BPF_REG_1 ,-1 ), epid); +emit (dlp,BPF_STORE (BPF_DW ,BPF_REG_9 ,DBUF_EPID ,BPF_REG_1 )); +/* * If there is a predicate: * @@ -1131,10 +1141,9 @@ dt_cg_prologue(dt_pcb_t *pcb, dt_node_t *pred)TRACE_REGSET ("Prologue: End " );/* -* Account for 32-bit EPID (at offset 0) and 32-bit speculation ID (at -* offset 4). +* Set the offset for the beginning of trace data. */ - pcb->pcb_bufoff +=2 *sizeof (uint32_t ); + pcb->pcb_bufoff =DBUF_DATA ; }/* @@ -1169,15 +1178,15 @@ dt_cg_epilogue(dt_pcb_t *pcb)/* * rc = bpf_perf_event_output(dctx->ctx, &buffers, * BPF_F_CURRENT_CPU, -* buf - 4, bufoff + 4); +* buf + 4, bufoff - 4); * // lddw %r1, [%fp + DT_STK_DCTX] * // lddw %r1, [%r1 + DCTX_CTX] * // lddw %r2, &buffers * // lddw %r3, BPF_F_CURRENT_CPU * // mov %r4, %r9 -* // add %r4, -4 +* // add %r4, 4 * // mov %r5, pcb->pcb_bufoff -* // add %r5, 4 +* // add %r5, -4 * // call bpf_perf_event_output */ emit (dlp,BPF_LOAD (BPF_DW ,BPF_REG_1 ,BPF_REG_FP ,DT_STK_DCTX ));@@ -1185,9 +1194,9 @@ dt_cg_epilogue(dt_pcb_t *pcb)dt_cg_xsetx (dlp, buffers,DT_LBL_NONE ,BPF_REG_2 , buffers->di_id);dt_cg_xsetx (dlp,NULL ,DT_LBL_NONE ,BPF_REG_3 ,BPF_F_CURRENT_CPU );emit (dlp,BPF_MOV_REG (BPF_REG_4 ,BPF_REG_9 )); -emit (dlp,BPF_ALU64_IMM (BPF_ADD ,BPF_REG_4 ,-4 )); +emit (dlp,BPF_ALU64_IMM (BPF_ADD ,BPF_REG_4 ,4 ));emit (dlp,BPF_MOV_IMM (BPF_REG_5 , pcb->pcb_bufoff)); -emit (dlp,BPF_ALU64_IMM (BPF_ADD ,BPF_REG_5 ,4 )); +emit (dlp,BPF_ALU64_IMM (BPF_ADD ,BPF_REG_5 ,-4 ));emit (dlp,BPF_CALL_HELPER (BPF_FUNC_perf_event_output));/* libdtrace/dt_consume.c +19
-9@@ -14,9 +14,11 @@#include <ctype.h> #include <alloca.h> #include <dt_impl.h> +#include <dt_dctx.h> #include <dt_module.h> #include <dt_pcap.h> #include <dt_peb.h> +#include <dt_probe.h> #include <dt_state.h> #include <dt_string.h> #include <libproc.h> @@ -478,7 +480,7 @@ dt_flowindent(dtrace_hdl_t *dtp, dtrace_probedata_t *data, dtrace_epid_t last)*/ if (flow ==DTRACEFLOW_ENTRY ) {if (last !=DTRACE_EPIDNONE && id != last && - pd->id == dtp->dt_pdesc[last]->id) + pd->id == dtp->dt_probes[last >>32 ]->desc->id) flow =DTRACEFLOW_NONE ; }@@ -2202,19 +2204,23 @@ dt_consume_one_probe(dtrace_hdl_t *dtp, FILE *fp, char *data, uint32_t size, int peekflags, dtrace_epid_t *last, int committing, void *arg) { + int specid;dtrace_epid_t epid; +uint32_t prid;dtrace_datadesc_t *epd;dt_spec_buf_t tmpl;dt_spec_buf_t *dtsb; -int specid;int i;int rval;dtrace_workstatus_t ret;int commit_discard_seen, only_commit_discards;int data_recording =1 ; - epid = ((uint32_t *)data)[0 ]; - specid = ((uint32_t *)data)[1 ]; + specid = *((uint32_t *)(data +DBUF_SPECID )); + epid = *((uint64_t *)(data +DBUF_EPID )); + prid = epid >>32 ; +if (prid > dtp->dt_probe_id) +return dt_set_errno (dtp,EDT_BADEPID );/* * Fill in the epid and address of the epid in the buffer. We need to @@ -2227,6 +2233,7 @@ dt_consume_one_probe(dtrace_hdl_t *dtp, FILE *fp, char *data, uint32_t size, &pdat->dtpda_pdesc);if (rval !=0 )return dt_set_errno (dtp,EDT_BADEPID ); + pdat->dtpda_pdesc = (dtrace_probedesc_t *)dtp->dt_probes[prid]->desc; epd = pdat->dtpda_ddesc;if (epd->dtdd_uarg !=DT_ECB_DEFAULT ) {@@ -2661,9 +2668,8 @@ dt_consume_one(dtrace_hdl_t *dtp, FILE *fp, char *buf,* struct { * struct perf_event_header header; * uint32_t size; -* uint32_t pad; -* uint32_t epid; * uint32_t specid; +* dtrace_epid_t epid; * uint64_t data[n]; * } * and 'data' points to the 'size' member at this point. @@ -2673,13 +2679,17 @@ dt_consume_one(dtrace_hdl_t *dtp, FILE *fp, char *buf,return dt_set_errno (dtp,EDT_DSIZE ); size = *(uint32_t *)data; - data +=sizeof (size); ptr +=sizeof (size) + size;if (ptr != buf + hdr->size)return dt_set_errno (dtp,EDT_DSIZE ); - data +=sizeof (uint32_t );/* skip padding */ - size -=sizeof (uint32_t ); +/* +* The "size" measures from specid to the end. But our buffer +* offsets are relative to &size itself, to preserve 8-byte +* alignment. So, we leave data pointing at size, and we increase +* size by 4 bytes. +*/ + size +=4 ; return dt_consume_one_probe(dtp, fp, data, size, pdat, efunc, rfunc, flow, quiet, peekflags,libdtrace/dt_dctx.h +8
-4@@ -82,16 +82,20 @@ typedef struct dt_dctx {* The dctx->buf pointer references a block of memory that contains: * * +----------------+ -* 0 -> | EPID | +* 0 -> | pad | * +----------------+ -* 4 -> | Speculation ID | +* 4 -> | Speculation ID | * +----------------+ -* | Trace Data | +* 8 -> | EPID | +* +----------------+ +* 16 -> | Trace Data | * | ... | * +----------------+ */ -#define DBUF_EPID 0 +#define DBUF_PAD 0#define DBUF_SPECID 4 +#define DBUF_EPID 8 +#define DBUF_DATA 16/* * The dctx->mem pointer references a block of memory that contains: libdtrace/dt_handle.c +5
-4@@ -14,6 +14,7 @@#include <alloca.h> #include <dt_impl.h> +#include <dt_probe.h> #include <dt_program.h> static const char _dt_errprog[] =@@ -147,11 +148,11 @@ dt_handle_err(dtrace_hdl_t *dtp, dtrace_probedata_t *data)* This is an error. We have the following items here: EPID, * faulting action, BPF pc, fault code and faulting address. */ - epid = (uint32_t )DT_REC (uint64_t,0 ); + epid =DT_REC (uint64_t,0 );if (dt_epid_lookup (dtp, epid, &errdd, &errpd) !=0 )return dt_set_errno (dtp,EDT_BADERROR ); - + errpd = (dtrace_probedesc_t *)dtp->dt_probes[epid>>32 ]->desc; err.dteda_ddesc = errdd; err.dteda_pdesc = errpd; err.dteda_cpu = data->dtpda_cpu;@@ -195,7 +196,7 @@ no_addr: details[0 ] =0 ; } - snprintf(str, len, "error on enabled probe ID %u (ID %u: %s:%s:%s:%s): " + snprintf(str, len, "error on enabled probe ID %lu (ID %u: %s:%s:%s:%s): " "%s%s in %s%s", epid, errpd->id, errpd->prv, errpd->mod, errpd->fun, errpd->prb, dtrace_faultstr(dtp, err.dteda_fault), details,@@ -256,7 +257,7 @@ dt_handle_liberr(dtrace_hdl_t *dtp, const dtrace_probedata_t *data, str =alloca (len);snprintf (str, len, -"error on enabled probe ID %u (ID %u: %s:%s:%s:%s): %s" , +"error on enabled probe ID %lu (ID %u: %s:%s:%s:%s): %s" , data->dtpda_epid, errpd->id, errpd->prv, errpd->mod, errpd->fun, errpd->prb, faultstr);libdtrace/dt_map.c +3
-0@@ -137,6 +137,9 @@ int dt_epid_lookup(dtrace_hdl_t *dtp, dtrace_epid_t epid, dtrace_datadesc_t **ddp, dtrace_probedesc_t **pdp) { +/* Remove the PRID portion of the EPID. */ + epid &=0xffffffff ; +if (epid >= dtp->dt_maxprobe || dtp->dt_ddesc[epid] ==NULL || dtp->dt_pdesc[epid] ==NULL )return -1 ;libdtrace/dt_open.c +1
-1@@ -169,7 +169,7 @@ static const dt_ident_t _dtrace_globals[] = { {"discard" ,DT_IDENT_ACTFUNC ,0 ,DT_ACT_DISCARD ,DT_ATTR_STABCMN ,DT_VERS_1_0 , &dt_idops_func, "void(int)" }, { "epid", DT_IDENT_SCALAR, 0, DIF_VAR_EPID, DT_ATTR_STABCMN, DT_VERS_1_0, - &dt_idops_type, "uint_t" }, + &dt_idops_type, "uint64_t" }, { "errno", DT_IDENT_SCALAR, 0, DIF_VAR_ERRNO, DT_ATTR_STABCMN, DT_VERS_1_0, &dt_idops_type, "int" }, { "execname", DT_IDENT_SCALAR, 0, DIF_VAR_EXECNAME,test/demo/dtrace/error.r +1
-1@@ -3,4 +3,4 @@ -- @@stderr -- dtrace: script 'test/demo/dtrace/error.d' matched 2 probes -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/stress/buffering/tst.resize3-manual.r +1
-1@@ -1,5 +1,5 @@ FUNCTION:NAME - :BEGIN 3 + :BEGIN 4294967299 :BEGIN -- @@stderr --test/stress/buffering/tst.resize3.r +1
-1@@ -1,5 +1,5 @@ FUNCTION:NAME - :BEGIN 3 + :BEGIN 4294967299 :BEGIN -- @@stderr --test/unittest/actions/setopt/tst.badopt.r +7
-7@@ -1,16 +1,16 @@ -- @@stderr -- -dtrace: error on enabled probe ID 2 (ID 1: dtrace:::BEGIN): couldn't set option "Nixon" to "1": Invalid option name +dtrace: error on enabled probe ID 4294967298 (ID 1: dtrace:::BEGIN): couldn't set option "Nixon" to "1": Invalid option name -dtrace: error on enabled probe ID 2 (ID 1: dtrace:::BEGIN): couldn't set option "Harding" to "1": Invalid option name +dtrace: error on enabled probe ID 4294967298 (ID 1: dtrace:::BEGIN): couldn't set option "Harding" to "1": Invalid option name -dtrace: error on enabled probe ID 2 (ID 1: dtrace:::BEGIN): couldn't set option "Hoover" to "1": Invalid option name +dtrace: error on enabled probe ID 4294967298 (ID 1: dtrace:::BEGIN): couldn't set option "Hoover" to "1": Invalid option name -dtrace: error on enabled probe ID 2 (ID 1: dtrace:::BEGIN): couldn't set option "Bush" to "1": Invalid option name +dtrace: error on enabled probe ID 4294967298 (ID 1: dtrace:::BEGIN): couldn't set option "Bush" to "1": Invalid option name -dtrace: error on enabled probe ID 2 (ID 1: dtrace:::BEGIN): couldn't set option "quiet" to "um, no": Invalid value for specified option +dtrace: error on enabled probe ID 4294967298 (ID 1: dtrace:::BEGIN): couldn't set option "quiet" to "um, no": Invalid value for specified option -dtrace: error on enabled probe ID 2 (ID 1: dtrace:::BEGIN): couldn't set option "aggrate" to "0.5hz": Invalid value for specified option +dtrace: error on enabled probe ID 4294967298 (ID 1: dtrace:::BEGIN): couldn't set option "aggrate" to "0.5hz": Invalid value for specified option -dtrace: error on enabled probe ID 2 (ID 1: dtrace:::BEGIN): couldn't set option "bufsize" to "1m": Operation illegal when tracing is active +dtrace: error on enabled probe ID 4294967298 (ID 1: dtrace:::BEGIN): couldn't set option "bufsize" to "1m": Operation illegal when tracing is activetest/unittest/arrays/tst.declared-bounds.runtime_out.r +1
-1@@ -1,3 +1,3 @@ expected run-time error -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): index out of bounds (8) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): index out of bounds (8) in action #1 at BPF pc NNNtest/unittest/codegen/err.deref_0.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address (0) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address (0) in action #1 at BPF pc NNNtest/unittest/codegen/err.deref_1.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address (1) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address (1) in action #1 at BPF pc NNNtest/unittest/codegen/err.deref_i0.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address (0) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address (0) in action #1 at BPF pc NNNtest/unittest/codegen/err.deref_i1.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address (1) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address (1) in action #1 at BPF pc NNNtest/unittest/codegen/err.deref_string-assoc.r +1
-1@@ -1,3 +1,3 @@ 66 -- @@stderr -- -dtrace: error on enabled probe ID 4 (ID 1: dtrace:::BEGIN): invalid address (1) in action #2 at BPF pc NNN +dtrace: error on enabled probe ID 4294967300 (ID 1: dtrace:::BEGIN): invalid address (1) in action #2 at BPF pc NNNtest/unittest/codegen/err.deref_string-gvar.r +1
-1@@ -1,3 +1,3 @@ 66 -- @@stderr -- -dtrace: error on enabled probe ID 4 (ID 1: dtrace:::BEGIN): invalid address (1) in action #2 at BPF pc NNN +dtrace: error on enabled probe ID 4294967300 (ID 1: dtrace:::BEGIN): invalid address (1) in action #2 at BPF pc NNNtest/unittest/codegen/err.deref_string-lvar.r +1
-1@@ -1,3 +1,3 @@ 66 -- @@stderr -- -dtrace: error on enabled probe ID 4 (ID 1: dtrace:::BEGIN): invalid address (1) in action #2 at BPF pc NNN +dtrace: error on enabled probe ID 4294967300 (ID 1: dtrace:::BEGIN): invalid address (1) in action #2 at BPF pc NNNtest/unittest/codegen/err.deref_string-tvar.r +1
-1@@ -1,3 +1,3 @@ 66 -- @@stderr -- -dtrace: error on enabled probe ID 4 (ID 1: dtrace:::BEGIN): invalid address (1) in action #2 at BPF pc NNN +dtrace: error on enabled probe ID 4294967300 (ID 1: dtrace:::BEGIN): invalid address (1) in action #2 at BPF pc NNNtest/unittest/codegen/err.str_NULL_plus_offset-assoc.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/codegen/err.str_NULL_plus_offset-lvar.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/codegen/err.str_NULL_plus_offset-tvar.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/codegen/err.str_NULL_plus_offset.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/disasm/tst.vartab-bvar.r +1
-1@@ -4,7 +4,7 @@ curthread scl glb r D type (pointer) (size 8) timestamp scl glb r D type (integer) (size 8) vtimestamp scl glb r D type (integer) (size 8) ipl scl glb r D type (integer) (size 4) -epid scl glb r D type (integer) (size 4) +epid scl glb r D type (integer) (size 8) id scl glb r D type (integer) (size 4) arg0 scl glb r D type (integer) (size 8) arg1 scl glb r D type (integer) (size 8)test/unittest/error/tst.DTRACEFLT_BADADDR.null_ptr_field.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/error/tst.DTRACEFLT_BADADDR.r +2
-2@@ -1,6 +1,6 @@ -The arguments are 3 1 1 0 +The arguments are 4294967299 1 1 0 The value of arg4 should be 1 The value of arg5 should be 0 -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/error/tst.DTRACEFLT_DIVZERO.div.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): divide-by-zero in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): divide-by-zero in action #1 at BPF pc NNNtest/unittest/error/tst.DTRACEFLT_DIVZERO.mod.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): divide-by-zero in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): divide-by-zero in action #1 at BPF pc NNNtest/unittest/error/tst.DTRACEFLT_UNKNOWN.r +2
-2@@ -1,5 +1,5 @@ -The arguments are 3 1 PC 1 64 +The arguments are 4294967299 1 PC 1 64 The value of arg4 = 0 -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/error/tst.clause_scope-begin-ended.r +1
-1@@ -2,4 +2,4 @@ Error fired Clause executed -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/error/tst.clause_scope-begin.r +1
-1@@ -2,4 +2,4 @@ Error fired Clause executed -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/error/tst.clause_scope-regular.r.p +10
-2@@ -1,3 +1,11 @@ -#!/bin/sed -f +#!/usr/bin/awk -f + # This report has a variable probe ID in it. -s/ID [0-9][0-9]*: profile/ID nnn: profile/ +/^dtrace: error on enabled probe ID / { + $7 = and($7, 0xffffffff); # mask out the high 32 bits (variable prid) +} + +{ + sub("ID [0-9][0-9]*: profile", "ID nnn: profile"); + print; +}test/unittest/error/tst.error.r +1
-1@@ -1,4 +1,4 @@ Error fired -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/error/tst.errorend.r +1
-1@@ -2,4 +2,4 @@ Error fired End fired after exit -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/alloca/err.alloca-bcopy-before-beyond.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/alloca/err.alloca-bcopy-before-bottom.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/alloca/err.alloca-bcopy-beyond-top.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/alloca/err.alloca-bcopy-crossing-bottom.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/alloca/err.alloca-bcopy-crossing-top.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid size ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid size ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/alloca/err.alloca-crossing-clauses.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 4 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #2 at BPF pc NNN +dtrace: error on enabled probe ID 4294967300 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #2 at BPF pc NNNtest/unittest/funcs/alloca/err.alloca-load-before-bottom.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/alloca/err.alloca-load-beyond-top.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/alloca/err.alloca-load-crossing-bottom.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/alloca/err.alloca-null-deref-lvalue.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/alloca/err.alloca-null-deref.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/alloca/err.alloca-scratch-exceeding-bcopy.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid size ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid size ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/alloca/err.alloca-store-before-bottom.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/alloca/err.alloca-store-beyond-top.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/alloca/err.alloca-store-crossing-bottom.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/bcopy/err.badbcopy1.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/bcopy/err.badbcopy4.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/bcopy/err.badbcopy5.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/bcopy/err.badbcopy6.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid size ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid size ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/bcopy/err.badbcopy7.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid size ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid size ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/bcopy/err.badbcopy8.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid size ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid size ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/copyin/err.badaddr.r +1
-1@@ -3,4 +3,4 @@ -- @@stderr -- dtrace: script 'test/unittest/funcs/copyin/err.badaddr.d' matched 2 probes -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/copyin/err.null_arg1.r +1
-1@@ -3,4 +3,4 @@ -- @@stderr -- dtrace: script 'test/unittest/funcs/copyin/err.null_arg1.d' matched 2 probes -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/copyinstr/err.badaddr.r +1
-1@@ -3,4 +3,4 @@ -- @@stderr -- dtrace: script 'test/unittest/funcs/copyinstr/err.badaddr.d' matched 2 probes -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/copyinstr/err.null_arg1.r +1
-1@@ -3,4 +3,4 @@ -- @@stderr -- dtrace: script 'test/unittest/funcs/copyinstr/err.null_arg1.d' matched 2 probes -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/copyinto/err.badaddr.r +1
-1@@ -3,4 +3,4 @@ -- @@stderr -- dtrace: script 'test/unittest/funcs/copyinto/err.badaddr.d' matched 2 probes -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/copyinto/err.badsize.r +1
-1@@ -3,4 +3,4 @@ -- @@stderr -- dtrace: script 'test/unittest/funcs/copyinto/err.badsize.d' matched 2 probes -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid size ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid size ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/copyinto/err.null_arg1.r +1
-1@@ -3,4 +3,4 @@ -- @@stderr -- dtrace: script 'test/unittest/funcs/copyinto/err.null_arg1.d' matched 2 probes -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/err.badalloca.r.p +10
-2@@ -1,3 +1,11 @@ -#!/bin/sed -f +#!/usr/bin/awk -f -s/(ID [0-9]*/(ID NNN/g +# This report has a variable probe ID in it. +/^dtrace: error on enabled probe ID / { + $7 = and($7, 0xffffffff); # mask out the high 32 bits (variable prid) +} + +{ + sub("ID [0-9]*: profile", "ID NNN: profile"); + print; +}test/unittest/funcs/err.link_ntopbadaddr.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/err.link_ntopbadarg.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): illegal operation in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): illegal operation in action #1 at BPF pc NNNtest/unittest/funcs/inet_ntoa6/err.inet_ntoa6.arg1_null.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/inet_ntoa6/err.inet_ntoa6.arg1_null_const.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/strlen/tst.null.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/strtok/tst.strtok_null.r +1
-1@@ -3,4 +3,4 @@ -- @@stderr -- dtrace: script 'test/unittest/funcs/strtok/tst.strtok_null.d' matched 2 probes -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/strtok/tst.strtok_nulldel.r +1
-1@@ -3,4 +3,4 @@ -- @@stderr -- dtrace: script 'test/unittest/funcs/strtok/tst.strtok_nulldel.d' matched 2 probes -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/strtok/tst.strtok_nullstr.r +1
-1@@ -3,4 +3,4 @@ -- @@stderr -- dtrace: script 'test/unittest/funcs/strtok/tst.strtok_nullstr.d' matched 2 probes -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/strtok/tst.strtok_nullstr2.r +1
-1@@ -4,4 +4,4 @@ -- @@stderr -- dtrace: script 'test/unittest/funcs/strtok/tst.strtok_nullstr2.d' matched 4 probes -dtrace: error on enabled probe ID 4 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #2 at BPF pc NNN +dtrace: error on enabled probe ID 4294967300 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #2 at BPF pc NNNtest/unittest/funcs/substr/err.substr_null_arg1.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/pointers/err.AllocaOverrun.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/pointers/err.BadAlign.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/pointers/err.InvalidAddress2.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/pointers/err.InvalidAddress4.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/speculation/err.CommitWithInvalid.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 4 (ID 1: dtrace:::BEGIN): illegal operation in action #2 at BPF pc NNN +dtrace: error on enabled probe ID 4294967300 (ID 1: dtrace:::BEGIN): illegal operation in action #2 at BPF pc NNNtest/unittest/speculation/err.DiscardWithInvalid.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 4 (ID 1: dtrace:::BEGIN): illegal operation in action #2 at BPF pc NNN +dtrace: error on enabled probe ID 4294967300 (ID 1: dtrace:::BEGIN): illegal operation in action #2 at BPF pc NNNtest/unittest/speculation/tst.SpecSizeVariations.r +0
-22@@ -11,26 +11,6 @@ Speculative buffer ID: 1 123456706 counts: 1 1 -Speculative buffer ID: 1 -123456700 -123456701 -123456702 -123456703 -123456704 -123456705 -123456706 -counts: 1 1 - -Speculative buffer ID: 1 -123456700 -123456701 -123456702 -123456703 -123456704 -123456705 -123456706 -counts: 2 1 - Speculative buffer ID: 1 123456700 123456701@@ -64,5 +44,3 @@ counts: 2 1 dtrace: 2 speculative drops dtrace: 1 speculative drop dtrace: 1 speculative drop -dtrace: 1 speculative drop -dtrace: 1 speculative droptest/unittest/speculation/tst.SpecSizeVariations.sh +1
-1@@ -9,7 +9,7 @@ dtrace=$1 -for x in 63 64 79 80 143 144; do +for x in 71 72 159 160; do $dtrace $dt_flags -xspecsize=$x -qn ' BEGIN {test/unittest/speculation/tst.negcommit.r +1
-1@@ -3,4 +3,4 @@ -- @@stderr -- dtrace: script 'test/unittest/speculation/tst.negcommit.d' matched 2 probes -dtrace: error on enabled probe ID 2 (ID 1: dtrace:::BEGIN): illegal operation in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967298 (ID 1: dtrace:::BEGIN): illegal operation in action #1 at BPF pc NNNSignature · 7 lines
2.43.5 _______________________________________________ DTrace-devel mailing list [email protected] https://oss.oracle.com/mailman/listinfo/dtrace-devel
Re: [DTrace-devel] [PATCH v2 32/38] Widen the EPID to include the PRID
Quoted 60 lines · Eugene Loh
Quoted 38 lines · Kris Van Hees
Quoted 6 lines · eugene.loh--- via DTrace-devel
From: Eugene Loh <[email protected]>
Each output record has a EPID associated with it, allowing the consumer to get both a data description and a PRID (so it can report PRID and probe function and name). We want to support uprobes that trigger for multiple PRIDs, however, basically breaking this scheme.
So, the EPID is (before this patch) an index into a list of ddescs and pdescs, effectively associating an id (EPID) with a { ddesc, pdesc } pair. It is also a unique id for a clause as it is used for a particular pdesc. When you have multiple probes that match a given pdesc for a given clause, the EPID still identifies the correct ddesc, but obviously the pdesc data won't be quite what you expect since that is PRID dependent.
Which is indeed why we need extra information, as you outline below...
Quoted 3 lines
So, expand the EPID to 64 bits, half for the old-style EPID (based on static information about the D programs) and half for the PRID (discovered at run time).
Of course, this is only really needed for select providers (e.g. USDT) whereas for all other cases, the single EPID suffices on its own. Therefore, I would expect that we do not place the PRID in the upper 32 buts of the EPID *unless* it is needed to override the "template" PRID that is associated with the basic EPID (lower 32 bits). Doing things that way things will look more familiar anyway for users who expect to typically see EPIDs in low values, and it also keeps the code design where (in general) the EPID identifies the ddesc and the pdesc.
It means we have some code that needs to deal with the exception case, but I don't see that as a problem becacuse most of the time it won't be used.
In that sense, we could look at the USDT-type case as an exceptional case. So, it would need special code in
dt_get_bvar()to put the PRID in the top 32 bits of the EPID when it needs to return the value for epid. Which means it needs to know when to do so. That could perhaps be done using some flag in the mstate or something. Similarly, the prologue of the clause could put the PRID in those top 32 bits when the clause is called for a case that needs it (which perhaps again could be indicated in the mstate)?Quoted 8 lines
In fact, if that works, then such a flag in the mstate can also be used to dynamically generate the provider name (probeprov bvar) rather than needing to add it to the strtab as a string. That might solve some additional issues or complexities that are seen in other patches where the strtab is getting updated at runtime to add more strings.
Why would a scheme like this not work? I.e. why do we need to add the PRID in the top 32 bits of a 64-bit EPID for *all* cases when only USDT needs it?
I don't think we're forced into the choice presented by this patch. Other solutions are possible. I just don't see the value is having two solutions, one for non-USDT/non-pid and one for USDT/pid. (You say something will be more familiar to users, but... what exactly is more familiar? Users know what EPID 23 is?) (You talk about dynamically generating the provname bvar. That's a cool/interesting idea, but it seems to me to be independent of what we're talking about here.) Some things can be streamlined if we just settle on one way of capturing
epid->pridinfo for the consumer. Instead of two solutions -- both "prid in high epid bits" as well as "pdesc[epid]" mapping -- we can throw the pdesc away.
Quoted 2 lines
tl/dr. We could maintain two mechanisms for doing this stuff. I just don't see what the value is in maintaining two mechanisms for solving one problem.
When I originally suggested widening the EPID, I envisioned only doing it for the cases thata need it, i.e. keep the EPID and its semantics the same for all probes, but adding in an 'override' PRID that represents that the 'native' EPID is being used for a probe that is created based on the probe that the 'native' EPID refers to. So, such USDT probes would be an exception.
I understand you prefer to make the widened EPID generic and make it apply to all cases. While that goes against the original design, I can see how we can redesign things to use such a mechanism, but then we essentially do away with what an EPID actually is. That is OK. But that implies greater changes are needed to make this approach a clean design. I.e. we no longer have an EPID that refers to a ( pdesc, ddesc ) pair.
In your current implementation you replace the EPID -> pdesc association with a direct use of the PRID that uniquely identifies the probe (which is in all technicality different from referring to a pdesc but in practice it is the same thing here because the pdesc that used to get associated with the EPID was for a single particular probe). But you keep the EPID as an index into the dt_ddescs. That is unnecessary and without the direct reference of the EPID to the pdesc, the entire meaning of the EPID (Enabled Probe ID) becomes meaningless as far as the internal implementation of DTrace is concerned.
With the approach you took, we really do not need EPIDs anymore and they should become an artifact of the consumer (mostly for backwards compatibility) and for that they can be assembled when needed (epid bvar and as a value passed to the consumer in dtrace_probedata_t).
Instead, we care about the PRID that uniquely identifies the probe we are storing data for, and the ddesc that is associated with the clause that is generating the data. That ddesc is uniquely associated with the clause that it gets constructed for, so if all clauses have a unique id, then that is quite sufficient to also determine the ddesc for that clause. And incidentally, we have such an id already because we generate one when we generate the identifier name for the clause (essentially a function name).
Therefore, it seems to me that a cleaner design would be to keep an array of clauses (or perhaps statements, so that it can be used as retained statements for wildcard matching on pdesc), indexed by clause id, and to store that clause id in the output buffer.
So, instead of storing EPID (even a widened EPID), we would store two values:
PRID and a clause ID (unique across the dtrace session - not to be confused by the clause id that we use in error probe arguments - that is a clause counter *within* a particular program). The PRID identifies the probe and the clause ID identifies the ddesc.
And for the two cases where an epid value is needed, it can be constructed as (PRID << 32) | clause-id.
By the way, the clause id within a program that we currently use will probably need to be replaced with more useful error location data like filename and line number. But in the meantime we might as well use the global clause id instead, because the in-program clause id was never really useful anyway. But using the actual clause id can be useful because it can be related to the clause identifier as reported in disassembler output. implementing because using the clause number
Quoted 1,154 lines
Quoted 1,154 lines
Quoted 1,154 lines
The EPID seen by compile-time files like
dt_cc.cordt_map.care still the old-style EPIDs (even if now 64-bit) since they have no knowledge of the run-time PRIDs.Further, we do not need to expand:
- the mstate (since it already had the PRID anyhow)
- the output buffer (since it already had an unused 4-byte pad)The combination of EPID and PRID is for the built-in variable epid as well as what the consumer reads.
Signed-off-by Eugene Loh <[email protected]>--- bpf/get_bvar.c | 6 ++- bpf/probe_error.c | 2 +- include/dtrace/universal.h | 2 +- libdtrace/dt_bpf.c | 2 - libdtrace/dt_cg.c | 43 +++++++++++-------- libdtrace/dt_consume.c | 28 ++++++++---- libdtrace/dt_dctx.h | 12 ++++-- libdtrace/dt_handle.c | 9 ++-- libdtrace/dt_map.c | 3 ++ libdtrace/dt_open.c | 2 +- test/demo/dtrace/error.r | 2 +- test/stress/buffering/tst.resize3-manual.r | 2 +- test/stress/buffering/tst.resize3.r | 2 +- test/unittest/actions/setopt/tst.badopt.r | 14 +++--- .../arrays/tst.declared-bounds.runtime_out.r | 2 +- test/unittest/codegen/err.deref_0.r | 2 +- test/unittest/codegen/err.deref_1.r | 2 +- test/unittest/codegen/err.deref_i0.r | 2 +- test/unittest/codegen/err.deref_i1.r | 2 +- .../unittest/codegen/err.deref_string-assoc.r | 2 +- test/unittest/codegen/err.deref_string-gvar.r | 2 +- test/unittest/codegen/err.deref_string-lvar.r | 2 +- test/unittest/codegen/err.deref_string-tvar.r | 2 +- .../codegen/err.str_NULL_plus_offset-assoc.r | 2 +- .../codegen/err.str_NULL_plus_offset-lvar.r | 2 +- .../codegen/err.str_NULL_plus_offset-tvar.r | 2 +- .../codegen/err.str_NULL_plus_offset.r | 2 +- test/unittest/disasm/tst.vartab-bvar.r | 2 +- .../tst.DTRACEFLT_BADADDR.null_ptr_field.r | 2 +- test/unittest/error/tst.DTRACEFLT_BADADDR.r | 4 +- .../error/tst.DTRACEFLT_DIVZERO.div.r | 2 +- .../error/tst.DTRACEFLT_DIVZERO.mod.r | 2 +- test/unittest/error/tst.DTRACEFLT_UNKNOWN.r | 4 +- .../error/tst.clause_scope-begin-ended.r | 2 +- test/unittest/error/tst.clause_scope-begin.r | 2 +- .../error/tst.clause_scope-regular.r.p | 12 +++++- test/unittest/error/tst.error.r | 2 +- test/unittest/error/tst.errorend.r | 2 +- .../alloca/err.alloca-bcopy-before-beyond.r | 2 +- .../alloca/err.alloca-bcopy-before-bottom.r | 2 +- .../alloca/err.alloca-bcopy-beyond-top.r | 2 +- .../alloca/err.alloca-bcopy-crossing-bottom.r | 2 +- .../alloca/err.alloca-bcopy-crossing-top.r | 2 +- .../alloca/err.alloca-crossing-clauses.r | 2 +- .../alloca/err.alloca-load-before-bottom.r | 2 +- .../funcs/alloca/err.alloca-load-beyond-top.r | 2 +- .../alloca/err.alloca-load-crossing-bottom.r | 2 +- .../alloca/err.alloca-null-deref-lvalue.r | 2 +- .../funcs/alloca/err.alloca-null-deref.r | 2 +- .../err.alloca-scratch-exceeding-bcopy.r | 2 +- .../alloca/err.alloca-store-before-bottom.r | 2 +- .../alloca/err.alloca-store-beyond-top.r | 2 +- .../alloca/err.alloca-store-crossing-bottom.r | 2 +- test/unittest/funcs/bcopy/err.badbcopy1.r | 2 +- test/unittest/funcs/bcopy/err.badbcopy4.r | 2 +- test/unittest/funcs/bcopy/err.badbcopy5.r | 2 +- test/unittest/funcs/bcopy/err.badbcopy6.r | 2 +- test/unittest/funcs/bcopy/err.badbcopy7.r | 2 +- test/unittest/funcs/bcopy/err.badbcopy8.r | 2 +- test/unittest/funcs/copyin/err.badaddr.r | 2 +- test/unittest/funcs/copyin/err.null_arg1.r | 2 +- test/unittest/funcs/copyinstr/err.badaddr.r | 2 +- test/unittest/funcs/copyinstr/err.null_arg1.r | 2 +- test/unittest/funcs/copyinto/err.badaddr.r | 2 +- test/unittest/funcs/copyinto/err.badsize.r | 2 +- test/unittest/funcs/copyinto/err.null_arg1.r | 2 +- test/unittest/funcs/err.badalloca.r.p | 12 +++++- test/unittest/funcs/err.link_ntopbadaddr.r | 2 +- test/unittest/funcs/err.link_ntopbadarg.r | 2 +- .../inet_ntoa6/err.inet_ntoa6.arg1_null.r | 2 +- .../err.inet_ntoa6.arg1_null_const.r | 2 +- test/unittest/funcs/strlen/tst.null.r | 2 +- test/unittest/funcs/strtok/tst.strtok_null.r | 2 +- .../funcs/strtok/tst.strtok_nulldel.r | 2 +- .../funcs/strtok/tst.strtok_nullstr.r | 2 +- .../funcs/strtok/tst.strtok_nullstr2.r | 2 +- .../funcs/substr/err.substr_null_arg1.r | 2 +- test/unittest/pointers/err.AllocaOverrun.r | 2 +- test/unittest/pointers/err.BadAlign.r | 2 +- test/unittest/pointers/err.InvalidAddress2.r | 2 +- test/unittest/pointers/err.InvalidAddress4.r | 2 +- .../speculation/err.CommitWithInvalid.r | 2 +- .../speculation/err.DiscardWithInvalid.r | 2 +- .../speculation/tst.SpecSizeVariations.r | 22 ---------- .../speculation/tst.SpecSizeVariations.sh | 2 +- test/unittest/speculation/tst.negcommit.r | 2 +- 86 files changed, 169 insertions(+), 148 deletions(-)bpf/get_bvar.c +4
-2@@ -48,8 +48,10 @@ noinline uint64_t dt_get_bvar(const dt_dctx_t *dctx, uint32_t id, uint32_t idx) mst->tstamp =bpf_ktime_get_ns ();return mst->tstamp; -case DIF_VAR_EPID : -return mst->epid; +case DIF_VAR_EPID : { +uint64_t val = mst->prid; +return (val <<32 ) | mst->epid; + }case DIF_VAR_ID :return mst->prid;case DIF_VAR_ARG0 :case DIF_VAR_ARG1 :case DIF_VAR_ARG2 :bpf/probe_error.c +1
-1@@ -31,7 +31,7 @@ noinline void dt_probe_error(const dt_dctx_t *dctx, uint64_t pc, uint64_t fault,int oldprid = mst->prid; mst->argv[0 ] =0 ; - mst->argv[1 ] = mst->epid; + mst->argv[1 ] = (((uint64_t )mst->prid) <<32 ) | mst->epid; mst->argv[2 ] = mst->clid; mst->argv[3 ] = pc; mst->argv[4 ] = fault;include/dtrace/universal.h +1
-1@@ -37,7 +37,7 @@ typedef uint16_t dtrace_actkind_t; /* action kind */typedef uint32_t dtrace_aggid_t ;/* aggregation identifier */ typedef uint32_t dtrace_cacheid_t ;/* predicate cache identifier */ -typedef uint32_t dtrace_epid_t ;/* enabled probe identifier */ +typedef uint64_t dtrace_epid_t ;/* enabled probe identifier */ typedef uint32_t dtrace_optid_t ;/* option identifier */ typedef uint32_t dtrace_specid_t ;/* speculation identifier */ libdtrace/dt_bpf.c +0
-2@@ -778,7 +778,6 @@ gmap_create_cpuinfo(dtrace_hdl_t *dtp)* The size of the memory region is the sum of: * - size of the DTrace machine state, rounded up to the nearest * multiple of 8 -* - 8 bytes padding for trace buffer alignment purposes * - maximum trace buffer record size, rounded up to the nearest * multiple of 8 * - size of dctx->mem (see dt_dctx.h) @@ -787,7 +786,6 @@ static int gmap_create_mem(dtrace_hdl_t *dtp) {size_t sz =roundup (sizeof (dt_mstate_t),8 ) + -8 +roundup (dtp->dt_maxreclen,8 ) +DMEM_SIZE (dtp);libdtrace/dt_cg.c +26
-17@@ -275,15 +275,9 @@ dt_cg_tramp_prologue_act(dt_pcb_t *pcb, dt_activity_t act)* buf = rc + roundup(sizeof(dt_mstate_t), 8); * // add %r0, roundup( * sizeof(dt_mstate_t), 8) -* *((uint64_t *)&buf[0]) = 0; -* // stdw [%r0 + 0], 0 -* buf += 8; // add %r0, 8 -* // (%r0 = pointer to buffer space) * dctx.buf = buf; // stdw [%r9 + DCTX_BUF], %r0 */ emit (dlp,BPF_ALU64_IMM (BPF_ADD ,BPF_REG_0 ,roundup (sizeof (dt_mstate_t),8 ))); -emit (dlp,BPF_STORE_IMM (BPF_DW ,BPF_REG_0 ,0 ,0 )); -emit (dlp,BPF_ALU64_IMM (BPF_ADD ,BPF_REG_0 ,8 ));emit (dlp,BPF_STORE (BPF_DW ,BPF_REG_9 ,DCTX_BUF ,BPF_REG_0 ));/* @@ -1094,8 +1088,6 @@ dt_cg_prologue(dt_pcb_t *pcb, dt_node_t *pred)* dctx->mst->specsize = 0;// stdw [%r0 + DMST_SPECSIZE], 0 * dctx->mst->epid = EPID; // stw [%r0 + DMST_EPID], EPID * dctx->mst->clid = CLID; // stw [%r0 + DMST_CLID], CLID -* *((uint32_t *)&buf[DBUF_EPID]) = EPID; -* // stw [%r9 + DBUF_EPID], EPID */ emit (dlp,BPF_LOAD (BPF_DW ,BPF_REG_0 ,BPF_REG_0 ,DCTX_MST ));emit (dlp,BPF_STORE_IMM (BPF_DW ,BPF_REG_0 ,DMST_FAULT ,0 ));@@ -1103,7 +1095,13 @@ dt_cg_prologue(dt_pcb_t *pcb, dt_node_t *pred)emit (dlp,BPF_STORE_IMM (BPF_DW ,BPF_REG_0 ,DMST_SPECSIZE ,0 ));emite (dlp,BPF_STORE_IMM (BPF_W ,BPF_REG_0 ,DMST_EPID ,-1 ), epid);emite (dlp,BPF_STORE_IMM (BPF_W ,BPF_REG_0 ,DMST_CLID ,-1 ), clid); -emite (dlp,BPF_STORE_IMM (BPF_W ,BPF_REG_9 ,DBUF_EPID ,-1 ), epid); + +/* +* Zero out the leading 4 bytes of the buffer. +* *((uint32_t *)&buf[DBUF_PAD]) = 0; +* // stw [%r9 + DBUF_PAD], 0 +*/ +emit (dlp,BPF_STORE_IMM (BPF_W ,BPF_REG_9 ,DBUF_PAD ,0 ));/* * Set the speculation ID field to zero to indicate no active @@ -1113,6 +1111,18 @@ dt_cg_prologue(dt_pcb_t *pcb, dt_node_t *pred)*/ emit (dlp,BPF_STORE_IMM (BPF_W ,BPF_REG_9 ,DBUF_SPECID ,0 )); +/* +* *((uint64_t *)&buf[DBUF_EPID]) = (dctx->mst->prid << 32) | EPID; +* // ld %r1, [%r0 + DMST_PRID] +* // lsh %r1, 32 +* // or %r1, epid +* // stdw [%r9 + DBUF_EPID], %r1 +*/ +emit (dlp,BPF_LOAD (BPF_W ,BPF_REG_1 ,BPF_REG_0 ,DMST_PRID )); +emit (dlp,BPF_ALU64_IMM (BPF_LSH ,BPF_REG_1 ,32 )); +emite (dlp,BPF_ALU64_IMM (BPF_OR ,BPF_REG_1 ,-1 ), epid); +emit (dlp,BPF_STORE (BPF_DW ,BPF_REG_9 ,DBUF_EPID ,BPF_REG_1 )); +/* * If there is a predicate: * @@ -1131,10 +1141,9 @@ dt_cg_prologue(dt_pcb_t *pcb, dt_node_t *pred)TRACE_REGSET ("Prologue: End " );/* -* Account for 32-bit EPID (at offset 0) and 32-bit speculation ID (at -* offset 4). +* Set the offset for the beginning of trace data. */ - pcb->pcb_bufoff +=2 *sizeof (uint32_t ); + pcb->pcb_bufoff =DBUF_DATA ; }/* @@ -1169,15 +1178,15 @@ dt_cg_epilogue(dt_pcb_t *pcb)/* * rc = bpf_perf_event_output(dctx->ctx, &buffers, * BPF_F_CURRENT_CPU, -* buf - 4, bufoff + 4); +* buf + 4, bufoff - 4); * // lddw %r1, [%fp + DT_STK_DCTX] * // lddw %r1, [%r1 + DCTX_CTX] * // lddw %r2, &buffers * // lddw %r3, BPF_F_CURRENT_CPU * // mov %r4, %r9 -* // add %r4, -4 +* // add %r4, 4 * // mov %r5, pcb->pcb_bufoff -* // add %r5, 4 +* // add %r5, -4 * // call bpf_perf_event_output */ emit (dlp,BPF_LOAD (BPF_DW ,BPF_REG_1 ,BPF_REG_FP ,DT_STK_DCTX ));@@ -1185,9 +1194,9 @@ dt_cg_epilogue(dt_pcb_t *pcb)dt_cg_xsetx (dlp, buffers,DT_LBL_NONE ,BPF_REG_2 , buffers->di_id);dt_cg_xsetx (dlp,NULL ,DT_LBL_NONE ,BPF_REG_3 ,BPF_F_CURRENT_CPU );emit (dlp,BPF_MOV_REG (BPF_REG_4 ,BPF_REG_9 )); -emit (dlp,BPF_ALU64_IMM (BPF_ADD ,BPF_REG_4 ,-4 )); +emit (dlp,BPF_ALU64_IMM (BPF_ADD ,BPF_REG_4 ,4 ));emit (dlp,BPF_MOV_IMM (BPF_REG_5 , pcb->pcb_bufoff)); -emit (dlp,BPF_ALU64_IMM (BPF_ADD ,BPF_REG_5 ,4 )); +emit (dlp,BPF_ALU64_IMM (BPF_ADD ,BPF_REG_5 ,-4 ));emit (dlp,BPF_CALL_HELPER (BPF_FUNC_perf_event_output));/* libdtrace/dt_consume.c +19
-9@@ -14,9 +14,11 @@#include <ctype.h> #include <alloca.h> #include <dt_impl.h> +#include <dt_dctx.h> #include <dt_module.h> #include <dt_pcap.h> #include <dt_peb.h> +#include <dt_probe.h> #include <dt_state.h> #include <dt_string.h> #include <libproc.h> @@ -478,7 +480,7 @@ dt_flowindent(dtrace_hdl_t *dtp, dtrace_probedata_t *data, dtrace_epid_t last)*/ if (flow ==DTRACEFLOW_ENTRY ) {if (last !=DTRACE_EPIDNONE && id != last && - pd->id == dtp->dt_pdesc[last]->id) + pd->id == dtp->dt_probes[last >>32 ]->desc->id) flow =DTRACEFLOW_NONE ; }@@ -2202,19 +2204,23 @@ dt_consume_one_probe(dtrace_hdl_t *dtp, FILE *fp, char *data, uint32_t size, int peekflags, dtrace_epid_t *last, int committing, void *arg) { + int specid;dtrace_epid_t epid; +uint32_t prid;dtrace_datadesc_t *epd;dt_spec_buf_t tmpl;dt_spec_buf_t *dtsb; -int specid;int i;int rval;dtrace_workstatus_t ret;int commit_discard_seen, only_commit_discards;int data_recording =1 ; - epid = ((uint32_t *)data)[0 ]; - specid = ((uint32_t *)data)[1 ]; + specid = *((uint32_t *)(data +DBUF_SPECID )); + epid = *((uint64_t *)(data +DBUF_EPID )); + prid = epid >>32 ; +if (prid > dtp->dt_probe_id) +return dt_set_errno (dtp,EDT_BADEPID );/* * Fill in the epid and address of the epid in the buffer. We need to @@ -2227,6 +2233,7 @@ dt_consume_one_probe(dtrace_hdl_t *dtp, FILE *fp, char *data, uint32_t size, &pdat->dtpda_pdesc);if (rval !=0 )return dt_set_errno (dtp,EDT_BADEPID ); + pdat->dtpda_pdesc = (dtrace_probedesc_t *)dtp->dt_probes[prid]->desc; epd = pdat->dtpda_ddesc;if (epd->dtdd_uarg !=DT_ECB_DEFAULT ) {@@ -2661,9 +2668,8 @@ dt_consume_one(dtrace_hdl_t *dtp, FILE *fp, char *buf,* struct { * struct perf_event_header header; * uint32_t size; -* uint32_t pad; -* uint32_t epid; * uint32_t specid; +* dtrace_epid_t epid; * uint64_t data[n]; * } * and 'data' points to the 'size' member at this point. @@ -2673,13 +2679,17 @@ dt_consume_one(dtrace_hdl_t *dtp, FILE *fp, char *buf,return dt_set_errno (dtp,EDT_DSIZE ); size = *(uint32_t *)data; - data +=sizeof (size); ptr +=sizeof (size) + size;if (ptr != buf + hdr->size)return dt_set_errno (dtp,EDT_DSIZE ); - data +=sizeof (uint32_t );/* skip padding */ - size -=sizeof (uint32_t ); +/* +* The "size" measures from specid to the end. But our buffer +* offsets are relative to &size itself, to preserve 8-byte +* alignment. So, we leave data pointing at size, and we increase +* size by 4 bytes. +*/ + size +=4 ; return dt_consume_one_probe(dtp, fp, data, size, pdat, efunc, rfunc, flow, quiet, peekflags,libdtrace/dt_dctx.h +8
-4@@ -82,16 +82,20 @@ typedef struct dt_dctx {* The dctx->buf pointer references a block of memory that contains: * * +----------------+ -* 0 -> | EPID | +* 0 -> | pad | * +----------------+ -* 4 -> | Speculation ID | +* 4 -> | Speculation ID | * +----------------+ -* | Trace Data | +* 8 -> | EPID | +* +----------------+ +* 16 -> | Trace Data | * | ... | * +----------------+ */ -#define DBUF_EPID 0 +#define DBUF_PAD 0#define DBUF_SPECID 4 +#define DBUF_EPID 8 +#define DBUF_DATA 16/* * The dctx->mem pointer references a block of memory that contains: libdtrace/dt_handle.c +5
-4@@ -14,6 +14,7 @@#include <alloca.h> #include <dt_impl.h> +#include <dt_probe.h> #include <dt_program.h> static const char _dt_errprog[] =@@ -147,11 +148,11 @@ dt_handle_err(dtrace_hdl_t *dtp, dtrace_probedata_t *data)* This is an error. We have the following items here: EPID, * faulting action, BPF pc, fault code and faulting address. */ - epid = (uint32_t )DT_REC (uint64_t,0 ); + epid =DT_REC (uint64_t,0 );if (dt_epid_lookup (dtp, epid, &errdd, &errpd) !=0 )return dt_set_errno (dtp,EDT_BADERROR ); - + errpd = (dtrace_probedesc_t *)dtp->dt_probes[epid>>32 ]->desc; err.dteda_ddesc = errdd; err.dteda_pdesc = errpd; err.dteda_cpu = data->dtpda_cpu;@@ -195,7 +196,7 @@ no_addr: details[0 ] =0 ; } - snprintf(str, len, "error on enabled probe ID %u (ID %u: %s:%s:%s:%s): " + snprintf(str, len, "error on enabled probe ID %lu (ID %u: %s:%s:%s:%s): " "%s%s in %s%s", epid, errpd->id, errpd->prv, errpd->mod, errpd->fun, errpd->prb, dtrace_faultstr(dtp, err.dteda_fault), details,@@ -256,7 +257,7 @@ dt_handle_liberr(dtrace_hdl_t *dtp, const dtrace_probedata_t *data, str =alloca (len);snprintf (str, len, -"error on enabled probe ID %u (ID %u: %s:%s:%s:%s): %s" , +"error on enabled probe ID %lu (ID %u: %s:%s:%s:%s): %s" , data->dtpda_epid, errpd->id, errpd->prv, errpd->mod, errpd->fun, errpd->prb, faultstr);libdtrace/dt_map.c +3
-0@@ -137,6 +137,9 @@ int dt_epid_lookup(dtrace_hdl_t *dtp, dtrace_epid_t epid, dtrace_datadesc_t **ddp, dtrace_probedesc_t **pdp) { +/* Remove the PRID portion of the EPID. */ + epid &=0xffffffff ; +if (epid >= dtp->dt_maxprobe || dtp->dt_ddesc[epid] ==NULL || dtp->dt_pdesc[epid] ==NULL )return -1 ;libdtrace/dt_open.c +1
-1@@ -169,7 +169,7 @@ static const dt_ident_t _dtrace_globals[] = { {"discard" ,DT_IDENT_ACTFUNC ,0 ,DT_ACT_DISCARD ,DT_ATTR_STABCMN ,DT_VERS_1_0 , &dt_idops_func, "void(int)" }, { "epid", DT_IDENT_SCALAR, 0, DIF_VAR_EPID, DT_ATTR_STABCMN, DT_VERS_1_0, - &dt_idops_type, "uint_t" }, + &dt_idops_type, "uint64_t" }, { "errno", DT_IDENT_SCALAR, 0, DIF_VAR_ERRNO, DT_ATTR_STABCMN, DT_VERS_1_0, &dt_idops_type, "int" }, { "execname", DT_IDENT_SCALAR, 0, DIF_VAR_EXECNAME,test/demo/dtrace/error.r +1
-1@@ -3,4 +3,4 @@ -- @@stderr -- dtrace: script 'test/demo/dtrace/error.d' matched 2 probes -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/stress/buffering/tst.resize3-manual.r +1
-1@@ -1,5 +1,5 @@ FUNCTION:NAME - :BEGIN 3 + :BEGIN 4294967299 :BEGIN -- @@stderr --test/stress/buffering/tst.resize3.r +1
-1@@ -1,5 +1,5 @@ FUNCTION:NAME - :BEGIN 3 + :BEGIN 4294967299 :BEGIN -- @@stderr --test/unittest/actions/setopt/tst.badopt.r +7
-7@@ -1,16 +1,16 @@ -- @@stderr -- -dtrace: error on enabled probe ID 2 (ID 1: dtrace:::BEGIN): couldn't set option "Nixon" to "1": Invalid option name +dtrace: error on enabled probe ID 4294967298 (ID 1: dtrace:::BEGIN): couldn't set option "Nixon" to "1": Invalid option name -dtrace: error on enabled probe ID 2 (ID 1: dtrace:::BEGIN): couldn't set option "Harding" to "1": Invalid option name +dtrace: error on enabled probe ID 4294967298 (ID 1: dtrace:::BEGIN): couldn't set option "Harding" to "1": Invalid option name -dtrace: error on enabled probe ID 2 (ID 1: dtrace:::BEGIN): couldn't set option "Hoover" to "1": Invalid option name +dtrace: error on enabled probe ID 4294967298 (ID 1: dtrace:::BEGIN): couldn't set option "Hoover" to "1": Invalid option name -dtrace: error on enabled probe ID 2 (ID 1: dtrace:::BEGIN): couldn't set option "Bush" to "1": Invalid option name +dtrace: error on enabled probe ID 4294967298 (ID 1: dtrace:::BEGIN): couldn't set option "Bush" to "1": Invalid option name -dtrace: error on enabled probe ID 2 (ID 1: dtrace:::BEGIN): couldn't set option "quiet" to "um, no": Invalid value for specified option +dtrace: error on enabled probe ID 4294967298 (ID 1: dtrace:::BEGIN): couldn't set option "quiet" to "um, no": Invalid value for specified option -dtrace: error on enabled probe ID 2 (ID 1: dtrace:::BEGIN): couldn't set option "aggrate" to "0.5hz": Invalid value for specified option +dtrace: error on enabled probe ID 4294967298 (ID 1: dtrace:::BEGIN): couldn't set option "aggrate" to "0.5hz": Invalid value for specified option -dtrace: error on enabled probe ID 2 (ID 1: dtrace:::BEGIN): couldn't set option "bufsize" to "1m": Operation illegal when tracing is active +dtrace: error on enabled probe ID 4294967298 (ID 1: dtrace:::BEGIN): couldn't set option "bufsize" to "1m": Operation illegal when tracing is activetest/unittest/arrays/tst.declared-bounds.runtime_out.r +1
-1@@ -1,3 +1,3 @@ expected run-time error -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): index out of bounds (8) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): index out of bounds (8) in action #1 at BPF pc NNNtest/unittest/codegen/err.deref_0.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address (0) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address (0) in action #1 at BPF pc NNNtest/unittest/codegen/err.deref_1.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address (1) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address (1) in action #1 at BPF pc NNNtest/unittest/codegen/err.deref_i0.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address (0) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address (0) in action #1 at BPF pc NNNtest/unittest/codegen/err.deref_i1.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address (1) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address (1) in action #1 at BPF pc NNNtest/unittest/codegen/err.deref_string-assoc.r +1
-1@@ -1,3 +1,3 @@ 66 -- @@stderr -- -dtrace: error on enabled probe ID 4 (ID 1: dtrace:::BEGIN): invalid address (1) in action #2 at BPF pc NNN +dtrace: error on enabled probe ID 4294967300 (ID 1: dtrace:::BEGIN): invalid address (1) in action #2 at BPF pc NNNtest/unittest/codegen/err.deref_string-gvar.r +1
-1@@ -1,3 +1,3 @@ 66 -- @@stderr -- -dtrace: error on enabled probe ID 4 (ID 1: dtrace:::BEGIN): invalid address (1) in action #2 at BPF pc NNN +dtrace: error on enabled probe ID 4294967300 (ID 1: dtrace:::BEGIN): invalid address (1) in action #2 at BPF pc NNNtest/unittest/codegen/err.deref_string-lvar.r +1
-1@@ -1,3 +1,3 @@ 66 -- @@stderr -- -dtrace: error on enabled probe ID 4 (ID 1: dtrace:::BEGIN): invalid address (1) in action #2 at BPF pc NNN +dtrace: error on enabled probe ID 4294967300 (ID 1: dtrace:::BEGIN): invalid address (1) in action #2 at BPF pc NNNtest/unittest/codegen/err.deref_string-tvar.r +1
-1@@ -1,3 +1,3 @@ 66 -- @@stderr -- -dtrace: error on enabled probe ID 4 (ID 1: dtrace:::BEGIN): invalid address (1) in action #2 at BPF pc NNN +dtrace: error on enabled probe ID 4294967300 (ID 1: dtrace:::BEGIN): invalid address (1) in action #2 at BPF pc NNNtest/unittest/codegen/err.str_NULL_plus_offset-assoc.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/codegen/err.str_NULL_plus_offset-lvar.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/codegen/err.str_NULL_plus_offset-tvar.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/codegen/err.str_NULL_plus_offset.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/disasm/tst.vartab-bvar.r +1
-1@@ -4,7 +4,7 @@ curthread scl glb r D type (pointer) (size 8) timestamp scl glb r D type (integer) (size 8) vtimestamp scl glb r D type (integer) (size 8) ipl scl glb r D type (integer) (size 4) -epid scl glb r D type (integer) (size 4) +epid scl glb r D type (integer) (size 8) id scl glb r D type (integer) (size 4) arg0 scl glb r D type (integer) (size 8) arg1 scl glb r D type (integer) (size 8)test/unittest/error/tst.DTRACEFLT_BADADDR.null_ptr_field.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/error/tst.DTRACEFLT_BADADDR.r +2
-2@@ -1,6 +1,6 @@ -The arguments are 3 1 1 0 +The arguments are 4294967299 1 1 0 The value of arg4 should be 1 The value of arg5 should be 0 -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/error/tst.DTRACEFLT_DIVZERO.div.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): divide-by-zero in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): divide-by-zero in action #1 at BPF pc NNNtest/unittest/error/tst.DTRACEFLT_DIVZERO.mod.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): divide-by-zero in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): divide-by-zero in action #1 at BPF pc NNNtest/unittest/error/tst.DTRACEFLT_UNKNOWN.r +2
-2@@ -1,5 +1,5 @@ -The arguments are 3 1 PC 1 64 +The arguments are 4294967299 1 PC 1 64 The value of arg4 = 0 -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/error/tst.clause_scope-begin-ended.r +1
-1@@ -2,4 +2,4 @@ Error fired Clause executed -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/error/tst.clause_scope-begin.r +1
-1@@ -2,4 +2,4 @@ Error fired Clause executed -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/error/tst.clause_scope-regular.r.p +10
-2@@ -1,3 +1,11 @@ -#!/bin/sed -f +#!/usr/bin/awk -f + # This report has a variable probe ID in it. -s/ID [0-9][0-9]*: profile/ID nnn: profile/ +/^dtrace: error on enabled probe ID / { + $7 = and($7, 0xffffffff); # mask out the high 32 bits (variable prid) +} + +{ + sub("ID [0-9][0-9]*: profile", "ID nnn: profile"); + print; +}test/unittest/error/tst.error.r +1
-1@@ -1,4 +1,4 @@ Error fired -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/error/tst.errorend.r +1
-1@@ -2,4 +2,4 @@ Error fired End fired after exit -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/alloca/err.alloca-bcopy-before-beyond.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/alloca/err.alloca-bcopy-before-bottom.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/alloca/err.alloca-bcopy-beyond-top.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/alloca/err.alloca-bcopy-crossing-bottom.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/alloca/err.alloca-bcopy-crossing-top.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid size ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid size ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/alloca/err.alloca-crossing-clauses.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 4 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #2 at BPF pc NNN +dtrace: error on enabled probe ID 4294967300 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #2 at BPF pc NNNtest/unittest/funcs/alloca/err.alloca-load-before-bottom.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/alloca/err.alloca-load-beyond-top.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/alloca/err.alloca-load-crossing-bottom.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/alloca/err.alloca-null-deref-lvalue.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/alloca/err.alloca-null-deref.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/alloca/err.alloca-scratch-exceeding-bcopy.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid size ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid size ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/alloca/err.alloca-store-before-bottom.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/alloca/err.alloca-store-beyond-top.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/alloca/err.alloca-store-crossing-bottom.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/bcopy/err.badbcopy1.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/bcopy/err.badbcopy4.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/bcopy/err.badbcopy5.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/bcopy/err.badbcopy6.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid size ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid size ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/bcopy/err.badbcopy7.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid size ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid size ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/bcopy/err.badbcopy8.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid size ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid size ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/copyin/err.badaddr.r +1
-1@@ -3,4 +3,4 @@ -- @@stderr -- dtrace: script 'test/unittest/funcs/copyin/err.badaddr.d' matched 2 probes -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/copyin/err.null_arg1.r +1
-1@@ -3,4 +3,4 @@ -- @@stderr -- dtrace: script 'test/unittest/funcs/copyin/err.null_arg1.d' matched 2 probes -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/copyinstr/err.badaddr.r +1
-1@@ -3,4 +3,4 @@ -- @@stderr -- dtrace: script 'test/unittest/funcs/copyinstr/err.badaddr.d' matched 2 probes -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/copyinstr/err.null_arg1.r +1
-1@@ -3,4 +3,4 @@ -- @@stderr -- dtrace: script 'test/unittest/funcs/copyinstr/err.null_arg1.d' matched 2 probes -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/copyinto/err.badaddr.r +1
-1@@ -3,4 +3,4 @@ -- @@stderr -- dtrace: script 'test/unittest/funcs/copyinto/err.badaddr.d' matched 2 probes -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/copyinto/err.badsize.r +1
-1@@ -3,4 +3,4 @@ -- @@stderr -- dtrace: script 'test/unittest/funcs/copyinto/err.badsize.d' matched 2 probes -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid size ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid size ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/copyinto/err.null_arg1.r +1
-1@@ -3,4 +3,4 @@ -- @@stderr -- dtrace: script 'test/unittest/funcs/copyinto/err.null_arg1.d' matched 2 probes -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/err.badalloca.r.p +10
-2@@ -1,3 +1,11 @@ -#!/bin/sed -f +#!/usr/bin/awk -f -s/(ID [0-9]*/(ID NNN/g +# This report has a variable probe ID in it. +/^dtrace: error on enabled probe ID / { + $7 = and($7, 0xffffffff); # mask out the high 32 bits (variable prid) +} + +{ + sub("ID [0-9]*: profile", "ID NNN: profile"); + print; +}test/unittest/funcs/err.link_ntopbadaddr.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/err.link_ntopbadarg.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): illegal operation in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): illegal operation in action #1 at BPF pc NNNtest/unittest/funcs/inet_ntoa6/err.inet_ntoa6.arg1_null.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/inet_ntoa6/err.inet_ntoa6.arg1_null_const.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/strlen/tst.null.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/strtok/tst.strtok_null.r +1
-1@@ -3,4 +3,4 @@ -- @@stderr -- dtrace: script 'test/unittest/funcs/strtok/tst.strtok_null.d' matched 2 probes -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/strtok/tst.strtok_nulldel.r +1
-1@@ -3,4 +3,4 @@ -- @@stderr -- dtrace: script 'test/unittest/funcs/strtok/tst.strtok_nulldel.d' matched 2 probes -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/strtok/tst.strtok_nullstr.r +1
-1@@ -3,4 +3,4 @@ -- @@stderr -- dtrace: script 'test/unittest/funcs/strtok/tst.strtok_nullstr.d' matched 2 probes -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/funcs/strtok/tst.strtok_nullstr2.r +1
-1@@ -4,4 +4,4 @@ -- @@stderr -- dtrace: script 'test/unittest/funcs/strtok/tst.strtok_nullstr2.d' matched 4 probes -dtrace: error on enabled probe ID 4 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #2 at BPF pc NNN +dtrace: error on enabled probe ID 4294967300 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #2 at BPF pc NNNtest/unittest/funcs/substr/err.substr_null_arg1.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/pointers/err.AllocaOverrun.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/pointers/err.BadAlign.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/pointers/err.InvalidAddress2.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/pointers/err.InvalidAddress4.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 3 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967299 (ID 1: dtrace:::BEGIN): invalid address ({ptr}) in action #1 at BPF pc NNNtest/unittest/speculation/err.CommitWithInvalid.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 4 (ID 1: dtrace:::BEGIN): illegal operation in action #2 at BPF pc NNN +dtrace: error on enabled probe ID 4294967300 (ID 1: dtrace:::BEGIN): illegal operation in action #2 at BPF pc NNNtest/unittest/speculation/err.DiscardWithInvalid.r +1
-1@@ -1,3 +1,3 @@ -- @@stderr -- -dtrace: error on enabled probe ID 4 (ID 1: dtrace:::BEGIN): illegal operation in action #2 at BPF pc NNN +dtrace: error on enabled probe ID 4294967300 (ID 1: dtrace:::BEGIN): illegal operation in action #2 at BPF pc NNNtest/unittest/speculation/tst.SpecSizeVariations.r +0
-22@@ -11,26 +11,6 @@ Speculative buffer ID: 1 123456706 counts: 1 1 -Speculative buffer ID: 1 -123456700 -123456701 -123456702 -123456703 -123456704 -123456705 -123456706 -counts: 1 1 - -Speculative buffer ID: 1 -123456700 -123456701 -123456702 -123456703 -123456704 -123456705 -123456706 -counts: 2 1 - Speculative buffer ID: 1 123456700 123456701@@ -64,5 +44,3 @@ counts: 2 1 dtrace: 2 speculative drops dtrace: 1 speculative drop dtrace: 1 speculative drop -dtrace: 1 speculative drop -dtrace: 1 speculative droptest/unittest/speculation/tst.SpecSizeVariations.sh +1
-1@@ -9,7 +9,7 @@ dtrace=$1 -for x in 63 64 79 80 143 144; do +for x in 71 72 159 160; do $dtrace $dt_flags -xspecsize=$x -qn ' BEGIN {test/unittest/speculation/tst.negcommit.r +1
-1@@ -3,4 +3,4 @@ -- @@stderr -- dtrace: script 'test/unittest/speculation/tst.negcommit.d' matched 2 probes -dtrace: error on enabled probe ID 2 (ID 1: dtrace:::BEGIN): illegal operation in action #1 at BPF pc NNN +dtrace: error on enabled probe ID 4294967298 (ID 1: dtrace:::BEGIN): illegal operation in action #1 at BPF pc NNNSignature · 7 lines
2.43.5 _______________________________________________ DTrace-devel mailing list [email protected] https://oss.oracle.com/mailman/listinfo/dtrace-devel