Sebastian Tomac
2006-Nov-18 07:51 UTC
[dtrace-discuss] incompatible with conversion: %lld prototype: long long argument: int64_t
I am working on dtracing a user process. The probe is defined as;
provider saxess { saxess probe P_ProcessRequest__send(int64_t, int64_t); }
The trace script as
saxess$1:::P_ProcessRequest-send {
printf("%s:%s P_ProcessRequest-send = %lld %lld\n", probemod,
probefunc,arg0,arg1);
}
When I trace the process, i get the following error
dtrace: failed to compile script ./dtrace.d: line 4: printf( ) argument #4 is
incompatible with conversion #3 prototype:
conversion: %lld
prototype: long long
argument: int64_t
It works with printf %d, however then arg1 gets incorrect.
/S
This message posted from opensolaris.org
Adam Leventhal
2006-Nov-18 08:19 UTC
[dtrace-discuss] incompatible with conversion: %lld prototype: long long argument: int64_t
Hi Sebastian, There are two issues here: 1) you don''t need the ''l'' printf() modifiers with DTrace ever 2) you should be using args[0] and args[1] rather than arg0 and arg1 Adam On Fri, Nov 17, 2006 at 11:51:38PM -0800, Sebastian Tomac wrote:> I am working on dtracing a user process. The probe is defined as; > provider saxess { saxess probe P_ProcessRequest__send(int64_t, int64_t); } > The trace script as > saxess$1:::P_ProcessRequest-send { > printf("%s:%s P_ProcessRequest-send = %lld %lld\n", probemod, probefunc,arg0,arg1); > } > When I trace the process, i get the following error > dtrace: failed to compile script ./dtrace.d: line 4: printf( ) argument #4 is incompatible with conversion #3 prototype: > conversion: %lld > prototype: long long > argument: int64_t > It works with printf %d, however then arg1 gets incorrect. > > /S > > > This message posted from opensolaris.org > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org-- Adam Leventhal, Solaris Kernel Development http://blogs.sun.com/ahl
Sebastian Tomac
2006-Nov-18 11:18 UTC
[dtrace-discuss] Re: incompatible with conversion: %lld prototype: long long argument: int64_t
Thanks Adam, I changed the args and removed the %l.. /Sebastian This message posted from opensolaris.org
Chip Bennett
2006-Nov-19 02:54 UTC
[dtrace-discuss] incompatible with conversion: %lld prototype: long long argument: int64_t
But it''s OK to use arg0, arg1, ..., as long as you cast it, long long
int, in this case:
printf("%s:%s P_ProcessRequest-send = %lld %lld\n", probemod,
probefunc,
(long long int)arg0,(long long int)arg1);
Even though you don''t need to use the "l" modifier in
D''s printf, I can see doing it anyway, so that the casual observer can
immediately see that your types match up.
However, I agree, args[] is better.
Chip
Adam Leventhal wrote:> Hi Sebastian,
>
> There are two issues here:
> 1) you don''t need the ''l'' printf() modifiers
with DTrace ever
> 2) you should be using args[0] and args[1] rather than arg0 and arg1
>
> Adam
>
> On Fri, Nov 17, 2006 at 11:51:38PM -0800, Sebastian Tomac wrote:
>
>> I am working on dtracing a user process. The probe is defined as;
>> provider saxess { saxess probe P_ProcessRequest__send(int64_t,
int64_t); }
>> The trace script as
>> saxess$1:::P_ProcessRequest-send {
>> printf("%s:%s P_ProcessRequest-send = %lld %lld\n",
probemod, probefunc,arg0,arg1);
>> }
>> When I trace the process, i get the following error
>> dtrace: failed to compile script ./dtrace.d: line 4: printf( ) argument
#4 is incompatible with conversion #3 prototype:
>> conversion: %lld
>> prototype: long long
>> argument: int64_t
>> It works with printf %d, however then arg1 gets incorrect.
>>
>> /S
>>
>>
>> This message posted from opensolaris.org
>> _______________________________________________
>> dtrace-discuss mailing list
>> dtrace-discuss at opensolaris.org
>>
>
>