Peter Harvey
2007-Jun-27 09:06 UTC
[dtrace-discuss] Speculated data recording actions work in commit() clauses
Speculated data recording actions appear to work within a clause containing a speculation commit() function. This is despite the manual page stating: Committing a Speculation You commit speculations using the commit() function. [deletia] Finally, a clause containing a commit() cannot contain a data recording action, but a clause may contain multiple commit() calls to commit disjoint buffers. I checked various forums, mail archives and documentation but couldn''t see any reference to it. Checking DTrace bugs/RFEs I don''t see any mention of this being fixed. Checking the source I see: usr/src/lib/libdtrace/common/dt_cc.c static void dt_stmt_append(dtrace_stmtdesc_t *sdp, const dt_node_t *dnp) { dtrace_ecbdesc_t *edp = sdp->dtsd_ecbdesc; dtrace_actdesc_t *ap, *tap; int commit = 0; int speculate = 0; int datarec = 0; ... for (ap = edp->dted_action; ap != NULL; ap = ap->dtad_next) { if (ap->dtad_kind == DTRACEACT_COMMIT) { if (commit) { dnerror(dnp, D_COMM_COMM, "commit( ) may " "not follow commit( )\n"); } if (datarec) { >>> dnerror(dnp, D_COMM_DREC, "commit( ) may " >>> "not follow data-recording action(s)\n"); ... /* * Exclude all non data-recording actions. */ if (dt_action_destructive(ap) || ap->dtad_kind == DTRACEACT_DISCARD) continue; if (ap->dtad_kind == DTRACEACT_DIFEXPR && ap->dtad_difo->dtdo_rtype.dtdt_kind == DIF_TYPE_CTF && ap->dtad_difo->dtdo_rtype.dtdt_size == 0) continue; if (commit) { dnerror(dnp, D_DREC_COMM, "data-recording actions " "may not follow commit( )\n"); } >>> if (!speculate) >>> datarec = 1; } So it appears that speculated data recording actions are allowed by the compiler. Is this is correct behaviour? If so I can log a documentation bug. -- Peter -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 2856 bytes Desc: S/MIME Cryptographic Signature URL: <http://mail.opensolaris.org/pipermail/dtrace-discuss/attachments/20070627/8f75fff5/attachment.bin>
Peter Harvey
2007-Jun-27 09:07 UTC
[dtrace-discuss] Speculated data recording actions work in commit() clauses
Speculated data recording actions appear to work within a clause containing a speculation commit() function. This is despite the manual page stating: Committing a Speculation You commit speculations using the commit() function. [deletia] Finally, a clause containing a commit() cannot contain a data recording action, but a clause may contain multiple commit() calls to commit disjoint buffers. I checked various forums, mail archives and documentation but couldn''t see any reference to it. Checking DTrace bugs/RFEs I don''t see any mention of this being fixed. Checking the source I see: usr/src/lib/libdtrace/common/dt_cc.c static void dt_stmt_append(dtrace_stmtdesc_t *sdp, const dt_node_t *dnp) { dtrace_ecbdesc_t *edp = sdp->dtsd_ecbdesc; dtrace_actdesc_t *ap, *tap; int commit = 0; int speculate = 0; int datarec = 0; ... for (ap = edp->dted_action; ap != NULL; ap = ap->dtad_next) { if (ap->dtad_kind == DTRACEACT_COMMIT) { if (commit) { dnerror(dnp, D_COMM_COMM, "commit( ) may " "not follow commit( )\n"); } if (datarec) { >>> dnerror(dnp, D_COMM_DREC, "commit( ) may " >>> "not follow data-recording action(s)\n"); ... /* * Exclude all non data-recording actions. */ if (dt_action_destructive(ap) || ap->dtad_kind == DTRACEACT_DISCARD) continue; if (ap->dtad_kind == DTRACEACT_DIFEXPR && ap->dtad_difo->dtdo_rtype.dtdt_kind == DIF_TYPE_CTF && ap->dtad_difo->dtdo_rtype.dtdt_size == 0) continue; if (commit) { dnerror(dnp, D_DREC_COMM, "data-recording actions " "may not follow commit( )\n"); } >>> if (!speculate) >>> datarec = 1; } So it appears that speculated data recording actions are allowed by the compiler. Is this is correct behaviour? If so I can log a documentation bug. -- Peter
Brian Utterback
2007-Jun-27 13:22 UTC
[dtrace-discuss] Speculated data recording actions work in commit() clauses
It does appear that speculated data recording actions are allowed by the compiler before a commit, although not after. So to say that it may not contain a data recording action might be a simplification. However, the compiler out and out rejects having two commits in the same clause, despite the fact that the docs say that this is allowed. Peter Harvey wrote:> Speculated data recording actions appear to work within a clause > containing a speculation commit() function. This is despite the manual > page stating: > > Committing a Speculation > > You commit speculations using the commit() function. [deletia] > Finally, a clause containing a commit() cannot contain a data > recording action, but a clause may contain multiple commit() > calls to commit disjoint buffers. > > I checked various forums, mail archives and documentation but couldn''t > see any reference to it. Checking DTrace bugs/RFEs I don''t see any > mention of this being fixed. > > Checking the source I see: > > usr/src/lib/libdtrace/common/dt_cc.c > > static void > dt_stmt_append(dtrace_stmtdesc_t *sdp, const dt_node_t *dnp) > { > dtrace_ecbdesc_t *edp = sdp->dtsd_ecbdesc; > dtrace_actdesc_t *ap, *tap; > int commit = 0; > int speculate = 0; > int datarec = 0; > > ... > > for (ap = edp->dted_action; ap != NULL; ap = ap->dtad_next) { > if (ap->dtad_kind == DTRACEACT_COMMIT) { > if (commit) { > dnerror(dnp, D_COMM_COMM, "commit( ) may " > "not follow commit( )\n"); > } > > if (datarec) { > >>> dnerror(dnp, D_COMM_DREC, "commit( ) may " > >>> "not follow data-recording action(s)\n"); > > ... > > /* > * Exclude all non data-recording actions. > */ > if (dt_action_destructive(ap) || > ap->dtad_kind == DTRACEACT_DISCARD) > continue; > > if (ap->dtad_kind == DTRACEACT_DIFEXPR && > ap->dtad_difo->dtdo_rtype.dtdt_kind == DIF_TYPE_CTF && > ap->dtad_difo->dtdo_rtype.dtdt_size == 0) > continue; > > if (commit) { > dnerror(dnp, D_DREC_COMM, "data-recording actions " > "may not follow commit( )\n"); > } > > >>> if (!speculate) > >>> datarec = 1; > } > > So it appears that speculated data recording actions are allowed by > the compiler. > > Is this is correct behaviour? If so I can log a documentation bug. > > -- Peter > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org-- blu If global warming is about climate change, isn''t trying to prevent it actually anti-climatic? ---------------------------------------------------------------------- Brian Utterback - Solaris RPE, Sun Microsystems, Inc. Ph:877-259-7345, Em:brian.utterback-at-ess-you-enn-dot-kom