Re: [PATCH] tracehook: add some self tests

From: Mike Frysinger
Date: Mon Feb 15 2010 - 15:28:54 EST


On Mon, Feb 15, 2010 at 14:39, Oleg Nesterov wrote:
> On 02/15, Mike Frysinger wrote:
>> +static int __init syscall_test(void)
>> +{
>> + Â Â struct pt_regs _regs, *regs = &_regs;
>> + Â Â long _args[8];
>> + Â Â long *args = _args + 1;
>> + Â Â long *sys_args[6], *sa;
>> + Â Â unsigned int i, n, s;
>> +
>> + Â Â /*
>> + Â Â Â* First find each system register in pt_regs. ÂWe have to assume
>> + Â Â Â* syscall_set_arguments() works with very basic arguments.
>> + Â Â Â*/
>> + Â Â pr_info("TEST: asm/syscall.h: arg offsets: { ");
>> +
>> + Â Â for (s = 0; s < 6; ++s)
>> + Â Â Â Â Â Â args[s] = s;
>> + Â Â memset(regs, 0xad, sizeof(*regs));
>> + Â Â syscall_set_arguments(NULL, regs, 0, 6, args);
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â^^^^
>
> I am not sure ia64 can tolerate task == NULL. Hmm, even x86 checks
> task_thread_info(task)->status.

is there some task available while the kernel is initializing ? i.e.
the test is compiled in ?

if current is valid, i'll just [ab]use that ...
-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/