Re: [PATCH] tracehook: add some self tests

From: Mike Frysinger
Date: Mon Feb 15 2010 - 16:11:26 EST


On Mon, Feb 15, 2010 at 15:28, Roland McGrath wrote:
> This is something of a misnomer, since asm/syscall.h is the only thing you
> are testing.

it's meant as a starting point, not the end point. so overtime people
can easily extend it.

> 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.

i wrote it because i needed it when trying to make sure the various
i/n values worked correctly. writing a bit of static code based on
just "n" is trivial, but avoiding a nest of code with i/n is a lot
harder. and as i noted earlier, there is on code in the kernel that
ever calls with i being non-zero.

> 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.

that would indeed be useful as a next point
-mike
--
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/