David Bustos
2008-Dec-01 22:20 UTC
[dtrace-discuss] lint and statically defined tracing for user applications
I added some static probes to my daemon, but lint complains: warning: name used but not defined: __dtrace_configd___import__request__bad in file_object.c(2134) (E_NAME_USED_NOT_DEF2) Is there a standard way to fix this? David
Jonathan Adams
2008-Dec-02 00:01 UTC
[dtrace-discuss] lint and statically defined tracing for user applications
On Mon, Dec 01, 2008 at 02:20:45PM -0800, David Bustos wrote:> I added some static probes to my daemon, but lint complains: > > warning: name used but not defined: __dtrace_configd___import__request__bad in file_object.c(2134) (E_NAME_USED_NOT_DEF2) > > Is there a standard way to fix this?Did you run dtrace over your objects before linking? Thanks, - jonathan
David Bustos
2008-Dec-02 00:18 UTC
[dtrace-discuss] lint and statically defined tracing for user applications
Quoth Jonathan Adams on Mon, Dec 01, 2008 at 04:01:39PM -0800:> On Mon, Dec 01, 2008 at 02:20:45PM -0800, David Bustos wrote: > > I added some static probes to my daemon, but lint complains: > > > > warning: name used but not defined: __dtrace_configd___import__request__bad in file_object.c(2134) (E_NAME_USED_NOT_DEF2) > > > > Is there a standard way to fix this? > > Did you run dtrace over your objects before linking?No. I just run lint with the .c files. As far as I can tell, lint won''t accept object files. Can dtrace process .ln files? David
David Bustos
2008-Dec-05 18:49 UTC
[dtrace-discuss] lint and statically defined tracing for user applications
Quoth David Bustos on Mon, Dec 01, 2008 at 02:20:45PM -0800:> I added some static probes to my daemon, but lint complains: > > warning: name used but not defined: __dtrace_configd___import__request__bad in file_object.c(2134) (E_NAME_USED_NOT_DEF2) > > Is there a standard way to fix this?Apparently not. Let me propose one. I changed my provider definition file from -- configd_sdt.d ---------------------------------------------------- provider configd { probe import__request__bad(string); }; --------------------------------------------------------------------- to -- configd_sdt.c ---------------------------------------------------- #ifndef lint provider configd { probe import__request__bad(string); }; #else /* ARGSUSED */ void __dtrace_configd___import__request__bad(unsigned long a) { } #endif --------------------------------------------------------------------- In the Makefile, I added -C to the dtrace -G options and configd_sdt.c to the lint arguments. Note that lint requires the ".c" extension rather than the ".d" extension. David
Adam Leventhal
2008-Dec-06 01:32 UTC
[dtrace-discuss] lint and statically defined tracing for user applications
Hey David, Nice trick. Sounds like a good RFE for dtrace -G would be to generate some lint-friendly output. Adam On Fri, Dec 05, 2008 at 10:49:40AM -0800, David Bustos wrote:> Quoth David Bustos on Mon, Dec 01, 2008 at 02:20:45PM -0800: > > I added some static probes to my daemon, but lint complains: > > > > warning: name used but not defined: __dtrace_configd___import__request__bad in file_object.c(2134) (E_NAME_USED_NOT_DEF2) > > > > Is there a standard way to fix this? > > Apparently not. Let me propose one. > > I changed my provider definition file from > > -- configd_sdt.d ---------------------------------------------------- > provider configd { > probe import__request__bad(string); > }; > --------------------------------------------------------------------- > > to > > -- configd_sdt.c ---------------------------------------------------- > #ifndef lint > > provider configd { > probe import__request__bad(string); > }; > > #else > > /* ARGSUSED */ > void > __dtrace_configd___import__request__bad(unsigned long a) > { > } > > #endif > --------------------------------------------------------------------- > > In the Makefile, I added -C to the dtrace -G options and configd_sdt.c > to the lint arguments. Note that lint requires the ".c" extension > rather than the ".d" extension. > > > David > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org-- Adam Leventhal, Fishworks http://blogs.sun.com/ahl
David Bustos
2008-Dec-08 19:14 UTC
[dtrace-discuss] lint and statically defined tracing for user applications
Quoth Adam Leventhal on Fri, Dec 05, 2008 at 05:32:12PM -0800:> Nice trick. Sounds like a good RFE for dtrace -G would be to generate some > lint-friendly output.I filed 6782307 lint complains about user SDT probes I came up with a better workaround, though: I added #ifdef lint /* LINTED */ #define DTRACE_PROBE1(provider, name, arg0) #endif to the top of the files defining the probe points. I suspect this technique could be used in sdt.h itself. David