Bug 11370 - multi-header @cast
Summary: multi-header @cast
Status: RESOLVED FIXED
Alias: None
Product: systemtap
Classification: Unclassified
Component: translator (show other bugs)
Version: unspecified
: P2 enhancement
Target Milestone: ---
Assignee: Unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-10 23:36 UTC by Josh Stone
Modified: 2010-03-12 21:05 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Josh Stone 2010-03-10 23:36:12 UTC
Sometimes a header may not #include everything that it needs to stand alone, and
so @cast will fail to build a module around it:

$ stap -ue 'probe begin {
println(&@cast(0, "fs_struct", "kernel<linux/fs_struct.h>")->root)
}' --vp 04
Running make -C '/lib/modules/2.6.32.9-67.fc12.x86_64/build'
M='/tmp/staprfow66/typequery_kmod_1' modules ARCH="x86_64" V=1
[...]
include/linux/fs_struct.h:8: error: expected specifier-qualifier-list before
‘rwlock_t’
include/linux/fs_struct.h:16: warning: ‘struct task_struct’ declared inside
parameter list
include/linux/fs_struct.h:16: warning: its scope is only this definition or
declaration, which is probably not what you want
[...]
semantic error: type definition 'fs_struct' not found: identifier '@cast' at
<input>:2:10
        source: println(&@cast(0, "fs_struct", "kernel<linux/fs_struct.h>")->root)
                         ^

We could work around this by allowing @cast to specify multiple headers which
should be compiled together.  Frank suggested listing them like this:

  @cast(x, "foo", "kernel<foo.h><bar.h>")->...
Comment 1 Josh Stone 2010-03-12 21:05:46 UTC
commit da9e11bd5cd3cbedbf794a0e8a83956bd178ba60