eric wang
2006-Nov-28 09:01 UTC
[dtrace-discuss] Fire!! How to resolve this problem for the statically difined tracing??
When I do so, there is always error!!!
CC -c sampleMain.cc
dtrace -G -32 -s world.d sampleMain.o
Note!!! Error coming: dtrace: failed to compile script world.d: line 7: unused
#pragma attributes
What is this problem and how to solve it??
sampleMain.cc
===============================================================#include
<stdio.h>
#include <unistd.h>
#include <sys/sdt.h>
int main (int ac, char **av)
{
int i;
for (i = 0; i < 10; i++)
{
DTRACE_PROBE1(world, loop, i);
printf("Hello World\n");
sleep(2);
}
}
============================================================world.d
=======================================#!/usr/sbin/dtrace -G -32 -s
#pragma D attributes Evolving/Evolving/Common provider world provider
#pragma D attributes Private/Private/Unknown provider world module
#pragma D attributes Private/Private/Unknown provider world function
#pragma D attributes Evolving/Evolving/Common provider world name
#pragma D attributes Evolving/Evolving/Common provider world args
provider world
{
probe loop(int);
};
=====================================
This message posted from opensolaris.org
Trond Norbye
2006-Nov-28 11:10 UTC
[dtrace-discuss] Re: Fire!! How to resolve this problem for the statically difined tracing??
Try moving the pragma statements below your provider definition. Trond This message posted from opensolaris.org
Andreas.Haas at Sun.COM
2006-Nov-28 11:22 UTC
[dtrace-discuss] Re: Fire!! How to resolve this problem for the statically difined tracing??
Yep. I was able to trace into static functions with #pragma no_inline(<function_name>) but, note where this #pragma is to be used http://docs.sun.com/source/819-0494/sun.specific.html Regards, Andreas On Tue, 28 Nov 2006, Trond Norbye wrote:> Try moving the pragma statements below your provider definition. > > Trond > > > This message posted from opensolaris.org > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org >
eric wang
2006-Nov-29 09:33 UTC
[dtrace-discuss] Re: Fire!! How to resolve this problem for the statically difined tracing??
Thanks! trond. But the problem is still there after I did according to your advice. This message posted from opensolaris.org
eric wang
2006-Nov-29 09:34 UTC
[dtrace-discuss] Re: Re: Fire!! How to resolve this problem for the statically difined tracing??
You mean add this into the sampleMain.cc?? But this problem is still there. :-) This message posted from opensolaris.org
Trond Norbye
2006-Nov-29 09:51 UTC
[dtrace-discuss] Re: Fire!! How to resolve this problem for the statically difined tracing??
Hmm.. strange.. I just tested it ok here:
trond at muffin> cat world.d
#!/usr/sbin/dtrace -G -32 -s
provider world
{
probe loop(int);
};
#pragma D attributes Evolving/Evolving/Common provider world provider
#pragma D attributes Private/Private/Unknown provider world module
#pragma D attributes Private/Private/Unknown provider world function
#pragma D attributes Evolving/Evolving/Common provider world name
#pragma D attributes Evolving/Evolving/Common provider world args
trond at muffin> dtrace -G -32 -s world.d sampleMain.o
trond at muffin>
What are the problem you see now?
Trond
This message posted from opensolaris.org