Bug 25851 - Fail to resolve file argument from kernel dwarf on Fedora 30 x86_64
Summary: Fail to resolve file argument from kernel dwarf on Fedora 30 x86_64
Status: UNCONFIRMED
Alias: None
Product: systemtap
Classification: Unclassified
Component: tapsets (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-18 19:28 UTC by agentzh
Modified: 2020-04-18 19:28 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 agentzh 2020-04-18 19:28:54 UTC
I've noted that vfs.write no longer works on Fedora 30 x86_64. It works well on Fedora 28 though. Below is the oneliner I used to reproduce the issue:

```
$ /opt/stap/bin/stap -v -e 'probe vfs.write { println("hit!", file) }'
Pass 1: parsed user script and 486 library scripts using 378936virt/154140res/7972shr/146392data kb, in 1150usr/50sys/1211real ms.
WARNING: Potential type mismatch in reassignment: identifier 'root_dentry' at /opt/stap/share/systemtap/tapset/linux/dentry.stp:246:3
 source:                root_dentry = @cast(task, "task_struct")->fs->root->dentry
                        ^
WARNING: Potential type mismatch in reassignment: identifier 'root_dentry' at :242:3
 source:                root_dentry = & @cast(task, "task_struct")->fs->root
                        ^
semantic error: unresolved type : identifier 'file' at /opt/stap/share/systemtap/tapset/linux/vfs.stp:1050:2
        source:         file = $file
                        ^

semantic error: failed to retrieve location attribute for 'file' [man error::dwarf]: identifier '$file' at :1050:9
        dieoffset: 0x39f89ab from /usr/lib/debug/lib/modules/5.4.19-100.fc30.x86_64/vmlinux
        function: file_start_write at ./include/linux/fs.h:2887:7 inlined by vfs_write at fs/read_write.c:557:3 inlined by vfs_write at fs/read_write.c:542:9
        source:         file = $file
                               ^

Pass 2: analyzed script: 2 probes, 1 function, 5 embeds, 0 globals using 619828virt/397116res/10168shr/387284data kb, in 2480usr/190sys/2691real ms.
Pass 2: analysis failed.  [man error::pass2]
```

I'm using the latest git master of stap:

```
$ /opt/stap/bin/stap -V
Systemtap translator/driver (version 4.3/0.177, commit release-4.2-65-g6de9136a2794)
Copyright (C) 2005-2019 Red Hat, Inc. and others
This is free software; see the source for copying conditions.
tested kernel versions: 2.6.32 ... 5.4-rc6
enabled features: BPF PYTHON3 LIBSQLITE3 NLS READLINE
```

I'm using the 5.4.19 kernel shipped by Fedora 30 itself:

```
$ uname -r
5.4.19-100.fc30.x86_64
```

Seems like the `$file` function argument cannot be resolved from the kernel DWARF?