Re: [PATCH] tracehook: add some self tests

From: Roland McGrath
Date: Mon Feb 15 2010 - 15:28:12 EST


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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/