Hi,

I hope this is something simple, but I've looked at the docs and I just can't 
find anything that tells me what I'm doing wrong.

I have a USDT provider in memcached which is defined as either a positive value 
returned or -1 if there is no result.  From my DTrace script, the value 
returned seems to be 4294967295 when I'm expecting a -1 so it seems to be 
treating it as unsigned.  The value is defined as an int in the USDT probe and 
the program, and isainfo -b returns 64, though I am working with a 32-bit 
binary.

I tried a couple of things to fix this.  First, I tried adding to the probe 
definition "signed" in front of the int in the probe definition (in 
memcached_dtrace.d as included in the source included from memcached.org):
-   probe command__get(int connid, const char *key, int keylen, int size, 
int64_t casid);
+   probe command__get(int connid, const char *key, int keylen, signed int 
size, int64_t casid);

This had no effect.

If I add a cast to the script, I get the expected behavior when the probe fires:

memcached*::command-*
{
  printf("key is %s, length is %d\n", copyinstr(arg1), (signed int) arg3);
}

Why should this be necessary in this case?

Thanks in advance,

- Matt

p.s.: I did check with Trond (the author) already on this, and the only thing 
he could think of is that the macro defining this in the source is confusing 
the dtrace compiler.
-- 
This message posted from opensolaris.org
_______________________________________________
dtrace-discuss mailing list
[email protected]

Reply via email to