This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]