After playing around with translators and getting args[0]->??? to work in my test provider I have a question that is nagging me. If conninfo_t is to be a common typedef to be used by any provider shouldn''t it be contained in a common .d file instead of something like iscsi.d or mpi.d?>From experiementation it doesn''t look like both files can have the typedef/struct exist otherwise you get and error similar to the following when running a dtrace script:dtrace -c main -n ''mpi__test$target::: { printf("%d",args[0]->bar);}'' dtrace: invalid probe specifier mpi__test$target::: { printf("%d",args[0]->bar);}: "/usr/lib/dtrace/bar.d", line 1: type redeclared: struct outfoo Or is the idea that the first provider that needs a common typedef gets to define it? I don''t think this completely works because some providers are conditionally installed (like the mpi provider). There also seems to be even a more greater name clashing situation that I wonder how to handle. That is how do I assure myself that the typedefs private to mpi.d like the ones used for the mpi translators will not clash with someone elses? Is there a naming convention or registry I should be adhering too? --td -- This message posted from opensolaris.org
Hi Terry,>After playing around with translators and getting args[0]->??? to work in my test provider I have a question that is nagging me. If conninfo_t is to be a common typedef to be used by any provider shouldn''t it be contained in a common .d file instead of something like iscsi.d or mpi.d? >Indeed it should. Currently we have no way of specifying dependencies between library files as you would need to do here; we just compile them in the order in which we find them. However, I''ve just about finished implementing a library dependency mechanism which will allow you to do this and I hope to get that back in the next few weeks.>There also seems to be even a more greater name clashing situation that I wonder how to handle. That is how do I assure myself that the typedefs private to mpi.d like the ones used for the mpi translators will not clash with someone elses? Is there a naming convention or registry I should be adhering too? >Others may want to comment here but I think it sensible that you prefix names with the provider name or some common pattern that makes sense within that provider. Jon.
On Sat, Sep 08, 2007 at 07:34:13AM -0700, Terry Dontje wrote:> After playing around with translators and getting args[0]->??? to > work in my test provider I have a question that is nagging me. If > conninfo_t is to be a common typedef to be used by any provider > shouldn''t it be contained in a common .d file instead of something like > iscsi.d or mpi.d?Indeed it should. I realized this after doing the iSCSI target provider work, and Jon Haslam is currently working to add a control directive that will allow a D library file to depend on other D library files. Once Jon''s work has been integrated, we''ll move conninfo_t into a common file so that other D library files may depend on it. 6600430 library dependencies for DTrace Adam -- Adam Leventhal, FishWorks http://blogs.sun.com/ahl