Messages in this thread |  | | | From | Roland McGrath <> | | Subject | Re: [PATCH] tracehook: add some self tests | | Date | Mon, 15 Feb 2010 12:28:00 -0800 (PST) |
| |
This is something of a misnomer, since asm/syscall.h is the only thing you are testing.
As Oleg pointed out, not all arch definitions can be used without a proper task_struct argument. Only ia64 actually needs the task as part of the actual register access. But several others (including x86) look at the task to decide whether to use the 32-bit or 64-bit interpretation of the register values.
I'd make the more general point that this sort of "synthetic" test does not seem very useful. At best, it can test the asm/syscall.h code for being internally consistent--but that doesn't test whether it's really correct. IMHO this is not worth having unless it's an "empirical" test. What I mean by that is one that really uses the asm/syscall.h calls as specified, and in the context specified. So, you'd have to fork a user process and use ptrace on it to get it stopped at a syscall entry. Then you can fetch the arguments, modify them, and look at the arguments it actually passes in to the syscall.
Thanks, Roland
|  |