summaryrefslogtreecommitdiff
path: root/systemtap/src/ioriot.stp
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-03-19 13:20:25 +0200
committerPaul Buetow <paul@buetow.org>2026-03-19 13:20:25 +0200
commitb328b5ab1bfa8f4346cbdda30af731ed244268cb (patch)
tree4fbe7cbed3a6775c33e5833c54d6f45448cc91e5 /systemtap/src/ioriot.stp
parenta169b912b7fdaf78bbc4e68c7739b054918472bf (diff)
fix: replay symlinks within the test root
Diffstat (limited to 'systemtap/src/ioriot.stp')
-rw-r--r--systemtap/src/ioriot.stp22
1 files changed, 17 insertions, 5 deletions
diff --git a/systemtap/src/ioriot.stp b/systemtap/src/ioriot.stp
index 9103a25..d4ad63e 100644
--- a/systemtap/src/ioriot.stp
+++ b/systemtap/src/ioriot.stp
@@ -99,7 +99,7 @@ probe timer.s(3600) {
}
probe begin {
- printf("#|capture_version=%d|\n", 3);
+ printf("#|capture_version=%d|\n", 4);
}
# --- open ---
@@ -470,48 +470,60 @@ probe syscall.readdir.return {
}
# --- readlink ---
-# Tapset entry vars: path_unquoted
+# Tapset entry vars: path_unquoted, buf_uaddr
probe syscall.readlink {
if (execname() != "stapio") {
PROBE_ENTRY_TIMES[tid(),name] = gettimeofday_ns()
ENTRY_PATH[tid(),name] = path_unquoted
+ ENTRY_ADDR[tid(),name] = buf_uaddr
}
}
probe syscall.readlink.return {
if(execname() != "stapio") {
ns = gettimeofday_ns()
- printf("t=%ld;:,D=%ld;:,i=%d:%d;:,o=%s;:,p=%s;:,s=%d;:,\n",
+ target = ""
+ if (retval > 0)
+ target = user_string_n(ENTRY_ADDR[tid(),name], retval)
+ printf("t=%ld;:,D=%ld;:,i=%d:%d;:,o=%s;:,p=%s;:,P=%s;:,s=%d;:,\n",
ns, ns-PROBE_ENTRY_TIMES[tid(),name],
pid(), tid(), name,
absolute_path(ENTRY_PATH[tid(),name]),
+ target,
retval);
delete PROBE_ENTRY_TIMES[tid(),name]
delete ENTRY_PATH[tid(),name]
+ delete ENTRY_ADDR[tid(),name]
}
}
# --- readlinkat ---
-# Tapset entry vars: dfd, path_unquoted
+# Tapset entry vars: dfd, path_unquoted, buf_uaddr
probe syscall.readlinkat {
if (execname() != "stapio") {
PROBE_ENTRY_TIMES[tid(),name] = gettimeofday_ns()
ENTRY_FD[tid(),name] = dfd
ENTRY_PATH[tid(),name] = path_unquoted
+ ENTRY_ADDR[tid(),name] = buf_uaddr
}
}
probe syscall.readlinkat.return {
if(execname() != "stapio") {
ns = gettimeofday_ns()
- printf("t=%ld;:,D=%ld;:,i=%d:%d;:,o=%s;:,p=%s;:,s=%d;:,\n",
+ target = ""
+ if (retval > 0)
+ target = user_string_n(ENTRY_ADDR[tid(),name], retval)
+ printf("t=%ld;:,D=%ld;:,i=%d:%d;:,o=%s;:,p=%s;:,P=%s;:,s=%d;:,\n",
ns, ns-PROBE_ENTRY_TIMES[tid(),name],
pid(), tid(), name,
absolute_path_at(ENTRY_PATH[tid(),name], ENTRY_FD[tid(),name]),
+ target,
retval);
delete PROBE_ENTRY_TIMES[tid(),name]
delete ENTRY_FD[tid(),name]
delete ENTRY_PATH[tid(),name]
+ delete ENTRY_ADDR[tid(),name]
}
}