This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Accessing structure fields
- From: Mike Mason <mmlnx at us dot ibm dot com>
- To: systemTAP <systemtap at sources dot redhat dot com>
- Date: Wed, 26 Sep 2007 11:18:03 -0700
- Subject: Accessing structure fields
I'm trying to understand why some recent changes in nfs_proc.stp were necessary. There are numerous changes like the following:
- count = $rdata->args.count
- offset = $rdata->args.offset
+ count = $rdata->args->count
+ offset = $rdata->args->offset
rdata is a pointer to a nfs_read_data structure and args is a nfs_readargs structure within nfs_read_data. args is not a pointer, thus the '.' syntax seems correct. However, $rdata->args->count builds fine, while $rdata->args.count fails with the following error:
semantic error: struct/union 'args' is being accessed instead of a member of the struct/union: identifier '$data' at /usr/local/share/systemtap/tapset/nfs_proc.stp:640:17
semantic error: probe_1113 uses invalid operator: operator '.' at /usr/local/share/systemtap/tapset/nfs_proc.stp:640:28
Is '.' supported when accessing structure fields?
Interestingly, the following also builds fine:
uid = $data->inode->i_uid
In this case, inode *is* a pointer.
Mike