I've noticed different behaviors on x86 and sun4v when walking an
aggregation, specifically with the data type used to cast the memory
position at which agg data resides. For instance, the following snippet
from a walker works correctly on x86 but not on sun4v:
dtrace_aggdesc_t *aggdesc = data->dtada_desc;
dtrace_recdesc_t *rec;
int32_t state;
rec = &aggdesc->dtagd_rec[1];
state = *((int32_t *)(data->dtada_data + rec->dtrd_offset));
Using a 64bit data type instead of an int32_t solves the problem. So my
question is what's the data type used for the indexes and their
respective values in DTrace aggregations (for both 32 and 64bit)? I
looked at the source code for consumers and they seem to point at
uint64_t, is that correct?
The type of the 'state' variable above it not really relevant (as long
as it's valid in that context), since the attribution will implicitly
cast the value to its declared type after dereferencing it. But not all
consumers seem to agree; intrstat.c line 200, for instance.
Thanks,
Rafael
_______________________________________________
dtrace-discuss mailing list
dtrace-discuss@opensolaris.org