On Tue, Sep 16, 2008 at 02:48:42PM -0400, Dale Ghent wrote:
>
> ...regarding kernel-land FBT tracing and teasing info from pointers
> passed as an argument to a function.
>
> Long story short, I'm trying to get to the bottom of an issue I'm
> having with the nxge driver and have keyed in on the following function:
>
> http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/uts/common/io/nxge/nxge_mac.c#nxge_mdio_read
>
> I'd like to tease out, somehow, the contents of the last arg of that
> function, the pointer to "value". This is new territory for me, so I'm
> a bit in need of a sanity check. Am I trying to attain the
> unattainable or am I just doing it wrong?
Your problem is here:
> ENTRY_PROBE
> {
> self->nxge = (struct _nxge_t *)arg0;
> self->reg = (uint16_t)arg3;
> self->value = (uint16_t)arg4;
Here, you cast a (uint16_t *) value to a uint16_t, which does not work.
In general, I would avoid using the "argn" variables for FBT probes. Instead,
you should use the args[] array:
# dtrace -lvn fbt:nxge:nxge_mdio_read:entry
ID PROVIDER MODULE FUNCTION NAME
85290 fbt nxge nxge_mdio_read entry
Probe Description Attributes
Identifier Names: Private
Data Semantics: Private
Dependency Class: Unknown
Argument Attributes
Identifier Names: Private
Data Semantics: Private
Dependency Class: ISA
Argument Types
args[0]: p_nxge_t
args[1]: uint8_t
args[2]: uint8_t
args[3]: uint16_t
args[4]: uint16_t *
You are also using `self->' variables for data which does not need to
last between probe firings; you should use 'this->' variables, which
are valid until the end of the probe firing.
So something like:
ENTRY_PROBE
{
this->nxge = args[0];;
this->reg = args[3];
this->value = *args[4];
}
Then, change all of the "self->" references to "this->". Now, the
D compiler will do the type checking.
Cheers,
- jonathan
_______________________________________________
dtrace-discuss mailing list
[email protected]