I found wildcards at the tail of the dwarf probes were expanded incorrectly. For example, --- probe kernel.function("sys_read").* {} --- This script was expanded as below (output of 'stap -p2'); --- # probes kernel.function("sys_read@fs/read_write.c:358") /* pc=0x807ff */ /* <- kernel.function("sys_read").* */ kernel.function("sys_read@fs/read_write.c:358") /* pc=0x807ff */ /* <- kernel.function("sys_read").* */ kernel.function("sys_read@fs/read_write.c:358") /* pc=0x807ff */ /* <- kernel.function("sys_read").* */ --- I expected that it should be expanded as below; --- # probes kernel.function("sys_read@fs/read_write.c:358").call /* pc=0x807ff */ /* <- kernel.function("sys_read").* */ kernel.function("sys_read@fs/read_write.c:358").return /* pc=0x807ff */ /* <- kernel.function("sys_read").* */ --- And also, --- probe kernel.function("sys_read").ret* {} --- This was expanded as below; --- # probes kernel.function("sys_read@fs/read_write.c:358") /* pc=0x807ff */ /* <- kernel.function("sys_read").ret* */ --- But it should be expanded as below; --- # probes kernel.function("sys_read@fs/read_write.c:358").return /* pc=0x807ff */ /* <- kernel.function("sys_read").ret* */ --- Thanks,
This appears to be a bug in the wildcard logic. The current logic seems to work correctly, unless the wildcard is in the last token (which is the case you've found). This doesn't just apply to dwarf probes, it applies to all probes. For instance: # stap -p2 -e 'probe be* {}' # probes be* /* <- be* */ Should look like: # stap -p2 -e 'probe be* {}' # probes begin /* <- be* */
Here's another example of where the current wildcard logic has problems: # stap -v -p3 -e 'probe procf*("xyz").write {}' If you look through the C output, the code is going to create a procfs entry called "command" (which is the default), instead of one called "xyz". This is happening because of the following code in tapsets.cxx: bool has_procfs = get_param(parameters, "procfs", path); Since 'procfs' != 'procf*', we don't find the correct path.
Patch committed to fix the problem.