[ltt-dev] [PATCH] Add dup probe to lttng module
Francis Giraldeau
francis.giraldeau at usherbrooke.ca
Wed May 18 12:15:58 EDT 2011
This patch provides instrumentation for dup system call. It records the oldfd
and newfd if the operation succeed. This is required to recover in the trace
tre fd that newfd reference to.
Signed-off-by: Francis Giraldeau <francis.giraldeau at usherbrooke.ca>
---
probes/fs-trace.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/probes/fs-trace.c b/probes/fs-trace.c
index ccfc282..4635c88 100644
--- a/probes/fs-trace.c
+++ b/probes/fs-trace.c
@@ -153,6 +153,12 @@ void probe_fs_poll(void *_data, int fd)
"fd %d", fd);
}
+void probe_fs_dup(void *_data, unsigned int oldfd, unsigned int newfd)
+{
+ trace_mark_tp(fs, dup, fs_dup, probe_fs_dup,
+ "oldfd %d newfd %d", oldfd, newfd);
+}
+
MODULE_LICENSE("GPL and additional rights");
MODULE_AUTHOR("Mathieu Desnoyers");
MODULE_DESCRIPTION("FS Tracepoint Probes");
--
1.7.1
More information about the lttng-dev
mailing list