Hello everyone!

    I am currently working on a project for school that records and replays
a process in linux and I am using utrace to achieve this (I am using the
2.6.29.1 kernel with the utrace patch from 18 April). There will be two main
parts: the recording part and the replaying part. One of the recording parts
consists in capturing all the system calls that the process that needs to be
"replayed" does. This works ok (I am attaching a tracing engine to the
thread, make it sensible to the sys_call_entry and sys_call_exit events,
register the two handler functions and log all the data that I am interested
in). When I do the replaying, I don't want to execute some of the system
calls, I will give to the process the values that I have stored while doing
the recording.
     The problem is that I don't really know how to do this using utrace.The
scenario that I want to implement is like this:
the traced process makes a syscall -> the syscall_entry callback is hit ->
read the syscall_nr -> while in syscall_entry callback decide if I want to
run or abort this syscall (how can I abort while in this callback the
syscall? is it possible? can UTRACE_SYSCALL_ABORT be used in order to
achieve this? if yes, what's the right way of doing it?)-> if aborted, then
go to syscall_exit -> read the value from the log -> set the return value of
that syscall.
     I am now stuck here and any help would be appreciated because this is
the only place where I can ask for help regarding utrace. A wiki page (as
Roland suggested) with more documentation and some more examples would be
great to have.

Have a nice day everyone!
Best regards, Lucian.

Reply via email to