From ac04388fc5abb5239519a4588359b36860c73080 Mon Sep 17 00:00:00 2001 From: Francis Giraldeau Date: Wed, 18 May 2011 16:25:15 -0400 Subject: [PATCH] Add dup probe to lttng module 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 Signed-off-by: Mathieu Desnoyers --- probes/fs-trace.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/probes/fs-trace.c b/probes/fs-trace.c index ccfc2820..4635c881 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"); -- 2.34.1