Accessing structure fields

Mike Mason mmlnx@us.ibm.com
Wed Sep 26 20:34:00 GMT 2007


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






More information about the Systemtap mailing list