Priya Krishnan
2009-Apr-22 14:12 UTC
[dtrace-discuss] error message - translator does not define conversion for member
I am using multiple translators for a given D data structure, i.e. use two different C structs to completely translate a D struct #pragma D binding "1.5" translator translator iscsiinfo_t < idm_conn_t *P > { ii_target = P->ic_target_name; ii_initiator = P->ic_initiator_name; }; #pragma D binding "1.5" translator translator iscsiinfo_t < iscsi_login_hdr_t *P > { ii_lun = 0; ii_itt = P->itt; ii_ttt = 0xffffffff; ii_cmdsn = P->cmdsn; ii_statsn = 0; /* expstatsn? */ ii_datasn = 0; ii_datalen = P->dlength[0] << 16 || P->dlength[1] << 8 || P->dlength[2]; ii_flags = P->flags; }; I see this error "translator does not define conversion for member ii_itt" when I try to display the arguments in a script. I think I may be incorrectly defining the sdt_attr { "iscsi", "login-command", 0, 0, "idm_conn_t *", "conninfo_t *" }, { "iscsi", "login-command", 1, 0, "idm_conn_t *", "iscsiinfo_t *" }, { "iscsi", "login-command", 1, 1, "iscsi_login_hdr_t *", "iscsiinfo_t *" }, the DTrace probe is DTRACE_ISCSI_2(login__command, idm_conn_t *, ic, iscsi_login_hdr_t *, (iscsi_login_hdr_t *)pdu->isp_hdr); Although I have seen the use of multiple translators using the same C struct e.g. io.d { "io", "start", 0, 0, "buf_t *", "bufinfo_t *" }, { "io", "start", 1, 0, "buf_t *", "devinfo_t *" }, { "io", "start", 2, 0, "buf_t *", "fileinfo_t *" }, and a single D struct (used in different providers) being translated using different C structs, e.g. { "io", "start", 2, 0, "buf_t *", "fileinfo_t *" }, { "fsinfo", NULL, 0, 0, "vnode_t *", "fileinfo_t *" }, I haven''t seen examples where in for the same provider, multiple C structs are used to derive a single D struct. Any idea on what I might be doing wrong.. thanks Priya
Adam Leventhal
2009-Apr-25 01:37 UTC
[dtrace-discuss] error message - translator does not define conversion for member
Priya, Ah, what you''re trying to do would be a clever interface, but DTrace doesn''t allow you to easily map two arguments to a single translated output structure. Adam On Wed, Apr 22, 2009 at 10:12:36AM -0400, Priya Krishnan wrote:> I am using multiple translators for a given D data structure, i.e. use two different C structs to completely translate a D struct > #pragma D binding "1.5" translator > translator iscsiinfo_t < idm_conn_t *P > { > > ii_target = P->ic_target_name; > ii_initiator = P->ic_initiator_name; > }; > > #pragma D binding "1.5" translator > translator iscsiinfo_t < iscsi_login_hdr_t *P > { > > ii_lun = 0; > ii_itt = P->itt; > ii_ttt = 0xffffffff; > ii_cmdsn = P->cmdsn; > ii_statsn = 0; /* expstatsn? */ > ii_datasn = 0; > ii_datalen = P->dlength[0] << 16 || P->dlength[1] << 8 || P->dlength[2]; > ii_flags = P->flags; > }; > > I see this error "translator does not define conversion for member ii_itt" when I try to display the arguments in a script. I think I may be incorrectly defining the sdt_attr > { "iscsi", "login-command", 0, 0, "idm_conn_t *", "conninfo_t *" }, > { "iscsi", "login-command", 1, 0, "idm_conn_t *", "iscsiinfo_t *" }, > { "iscsi", "login-command", 1, 1, "iscsi_login_hdr_t *", "iscsiinfo_t *" }, > > the DTrace probe is DTRACE_ISCSI_2(login__command, idm_conn_t *, ic, iscsi_login_hdr_t *, (iscsi_login_hdr_t *)pdu->isp_hdr); > > Although I have seen the use of multiple translators using the same C > struct e.g. io.d { "io", "start", 0, 0, "buf_t *", "bufinfo_t *" }, > { "io", "start", 1, 0, "buf_t *", "devinfo_t *" }, > { "io", "start", 2, 0, "buf_t *", "fileinfo_t *" }, > > and a single D struct (used in different providers) being translated using > different C structs, e.g. { "io", "start", 2, 0, "buf_t *", "fileinfo_t *" > }, > > { "fsinfo", NULL, 0, 0, "vnode_t *", "fileinfo_t *" }, > > I haven''t seen examples where in for the same provider, multiple C structs are used to derive a single D struct. Any idea on what I might be doing wrong.. > > thanks > Priya > > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org-- Adam Leventhal, Fishworks http://blogs.sun.com/ahl