2007-12-06 02:47:49

by Mathieu Desnoyers

[permalink] [raw]
Subject: [patch-RFC 00/26] LTTng Kernel Trace Thread Flag

Hi,

This is an RFC for addition of a new thread flag, TIF_KERNEL_TRACE, to each
architecture to activate system-wide system call tracing.

This is needed by LTTng architecture dependent instrumentation.

It applies on 2.6.24-rc4-git3.

Mathieu

--
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68


2007-12-06 21:31:59

by Frank Ch. Eigler

[permalink] [raw]
Subject: Re: [patch-RFC 00/26] LTTng Kernel Trace Thread Flag

Mathieu Desnoyers <[email protected]> writes:

> This is an RFC for addition of a new thread flag, TIF_KERNEL_TRACE, to each
> architecture to activate system-wide system call tracing.
> [...]

Instead of creating a new flag, could you overload TIF_SYSCALL_TRACE,
putting the marker into syscall_trace(), and letting !PT_TRACED cause
a skip over the ptrace notification logic?

- FChE

2007-12-07 13:44:37

by Mathieu Desnoyers

[permalink] [raw]
Subject: Re: [patch-RFC 00/26] LTTng Kernel Trace Thread Flag

* Frank Ch. Eigler ([email protected]) wrote:
> Mathieu Desnoyers <[email protected]> writes:
>
> > This is an RFC for addition of a new thread flag, TIF_KERNEL_TRACE, to each
> > architecture to activate system-wide system call tracing.
> > [...]
>
> Instead of creating a new flag, could you overload TIF_SYSCALL_TRACE,
> putting the marker into syscall_trace(), and letting !PT_TRACED cause
> a skip over the ptrace notification logic?
>
> - FChE

I don't see any PT_TRACED flag in current kernel HEAD ?

Hrm, let's see. If we share TIF_SYSCALL_TRACE with ptrace, we would then
have to figure out how to get this working :

- kernel tracing activated
- ptracing some random processes
- kernel tracing deactivated
- stop ptracing those processes

It means that we would have to keep some state information about the
ptrace status of each process. This is currently kept by
TIF_SYSCALL_TRACE, but since we would be overloading it, it would be
lost when we deactivate kernel tracing. Adding a supplementary field to
the thread_info structure is out of question here : we have to keep it
as small as possible. So where do you propose to keep this information
other than... another thread flag ?

Mathieu


--
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68