Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Linux: Kernel

[PATCH] tracing: separate raw syscall from syscall tracer

 

 

Linux kernel RSS feed   Index | Next | Previous | View Threaded


laijs at cn

Nov 2, 2009, 9:45 PM

Post #1 of 4 (164 views)
Permalink
[PATCH] tracing: separate raw syscall from syscall tracer

current syscall tracer mixes raw syscalls and real syscalls.

echo 1 > events/syscalls/enable
And we get these from the output:

(XXXX insteads " grep-20914 [001] 588211.446347" .. etc)

XXXX: sys_read(fd: 3, buf: 80609a8, count: 7000)
XXXX: sys_enter: NR 3 (3, 80609a8, 7000, a, 1000, bfce8ef8)
XXXX: sys_read -> 0x138
XXXX: sys_exit: NR 3 = 312
XXXX: sys_read(fd: 3, buf: 8060ae0, count: 7000)
XXXX: sys_enter: NR 3 (3, 8060ae0, 7000, a, 1000, bfce8ef8)
XXXX: sys_read -> 0x138
XXXX: sys_exit: NR 3 = 312

There are 2 drawbacks here.
A) two almost identical records are saved in ringbuffer
when a syscall enters or exits. (4 records for every syscall)
it wastes too much.
B) the lines include "sys_enter/sys_exit" makes
we hardly get the useful information for the output.

The user can use this method to prevent these drawbacks:
echo 1 > events/syscalls/enable
echo 0 > events/syscalls/sys_enter/enable
echo 0 > events/syscalls/sys_exit/enable

But it's not friendly for users. So we separate raw syscall
from syscall tracer.

After this fix applied:
syscall tracer's output (echo 1 > events/syscalls/enable):

XXXX: sys_read(fd: 3, buf: bfe87d88, count: 200)
XXXX: sys_read -> 0x200
XXXX: sys_fstat64(fd: 3, statbuf: bfe87c98)
XXXX: sys_fstat64 -> 0x0
XXXX: sys_close(fd: 3)

raw syscall tracer's output (echo 1 > events/raw_syscalls/enable):

XXXX: sys_enter: NR 175 (0, bf92bf18, bf92bf98, 8, b748cff4, bf92bef8)
XXXX: sys_exit: NR 175 = 0
XXXX: sys_enter: NR 175 (2, bf92bf98, 0, 8, b748cff4, bf92bef8)
XXXX: sys_exit: NR 175 = 0
XXXX: sys_enter: NR 3 (9, bf927f9c, 4000, b77e2518, b77dce60, bf92bff8)

Signed-off-by: Lai Jiangshan <laijs [at] cn>
---
diff --git a/include/trace/events/syscalls.h b/include/trace/events/syscalls.h
index 397dff2..fb726ac 100644
--- a/include/trace/events/syscalls.h
+++ b/include/trace/events/syscalls.h
@@ -1,5 +1,6 @@
#undef TRACE_SYSTEM
-#define TRACE_SYSTEM syscalls
+#define TRACE_SYSTEM raw_syscalls
+#define TRACE_INCLUDE_FILE syscalls

#if !defined(_TRACE_EVENTS_SYSCALLS_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_EVENTS_SYSCALLS_H


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


fweisbec at gmail

Nov 3, 2009, 12:23 AM

Post #2 of 4 (151 views)
Permalink
Re: [PATCH] tracing: separate raw syscall from syscall tracer [In reply to]

On Tue, Nov 03, 2009 at 01:45:32PM +0800, Lai Jiangshan wrote:
>
> current syscall tracer mixes raw syscalls and real syscalls.
>
> echo 1 > events/syscalls/enable
> And we get these from the output:
>
> (XXXX insteads " grep-20914 [001] 588211.446347" .. etc)
>
> XXXX: sys_read(fd: 3, buf: 80609a8, count: 7000)
> XXXX: sys_enter: NR 3 (3, 80609a8, 7000, a, 1000, bfce8ef8)
> XXXX: sys_read -> 0x138
> XXXX: sys_exit: NR 3 = 312
> XXXX: sys_read(fd: 3, buf: 8060ae0, count: 7000)
> XXXX: sys_enter: NR 3 (3, 8060ae0, 7000, a, 1000, bfce8ef8)
> XXXX: sys_read -> 0x138
> XXXX: sys_exit: NR 3 = 312
>
> There are 2 drawbacks here.
> A) two almost identical records are saved in ringbuffer
> when a syscall enters or exits. (4 records for every syscall)
> it wastes too much.
> B) the lines include "sys_enter/sys_exit" makes
> we hardly get the useful information for the output.
>
> The user can use this method to prevent these drawbacks:
> echo 1 > events/syscalls/enable
> echo 0 > events/syscalls/sys_enter/enable
> echo 0 > events/syscalls/sys_exit/enable
>
> But it's not friendly for users. So we separate raw syscall
> from syscall tracer.
>
> After this fix applied:
> syscall tracer's output (echo 1 > events/syscalls/enable):
>
> XXXX: sys_read(fd: 3, buf: bfe87d88, count: 200)
> XXXX: sys_read -> 0x200
> XXXX: sys_fstat64(fd: 3, statbuf: bfe87c98)
> XXXX: sys_fstat64 -> 0x0
> XXXX: sys_close(fd: 3)
>
> raw syscall tracer's output (echo 1 > events/raw_syscalls/enable):
>
> XXXX: sys_enter: NR 175 (0, bf92bf18, bf92bf98, 8, b748cff4, bf92bef8)
> XXXX: sys_exit: NR 175 = 0
> XXXX: sys_enter: NR 175 (2, bf92bf98, 0, 8, b748cff4, bf92bef8)
> XXXX: sys_exit: NR 175 = 0
> XXXX: sys_enter: NR 3 (9, bf927f9c, 4000, b77e2518, b77dce60, bf92bff8)
>
> Signed-off-by: Lai Jiangshan <laijs [at] cn>
> ---


Agreed, that's indeed not convenient.

Acked-by: Frederic Weisbecker <fweisbec [at] gmail>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


laijs at cn

Nov 24, 2009, 6:08 PM

Post #3 of 4 (127 views)
Permalink
Re: [PATCH] tracing: separate raw syscall from syscall tracer [In reply to]

Frederic Weisbecker wrote:
> On Tue, Nov 03, 2009 at 01:45:32PM +0800, Lai Jiangshan wrote:
>> current syscall tracer mixes raw syscalls and real syscalls.
>>
>> echo 1 > events/syscalls/enable
>> And we get these from the output:
>>
>> (XXXX insteads " grep-20914 [001] 588211.446347" .. etc)
>>
>> XXXX: sys_read(fd: 3, buf: 80609a8, count: 7000)
>> XXXX: sys_enter: NR 3 (3, 80609a8, 7000, a, 1000, bfce8ef8)
>> XXXX: sys_read -> 0x138
>> XXXX: sys_exit: NR 3 = 312
>> XXXX: sys_read(fd: 3, buf: 8060ae0, count: 7000)
>> XXXX: sys_enter: NR 3 (3, 8060ae0, 7000, a, 1000, bfce8ef8)
>> XXXX: sys_read -> 0x138
>> XXXX: sys_exit: NR 3 = 312
>>
>> There are 2 drawbacks here.
>> A) two almost identical records are saved in ringbuffer
>> when a syscall enters or exits. (4 records for every syscall)
>> it wastes too much.
>> B) the lines include "sys_enter/sys_exit" makes
>> we hardly get the useful information for the output.
>>
>> The user can use this method to prevent these drawbacks:
>> echo 1 > events/syscalls/enable
>> echo 0 > events/syscalls/sys_enter/enable
>> echo 0 > events/syscalls/sys_exit/enable
>>
>> But it's not friendly for users. So we separate raw syscall
>> from syscall tracer.
>>
>> After this fix applied:
>> syscall tracer's output (echo 1 > events/syscalls/enable):
>>
>> XXXX: sys_read(fd: 3, buf: bfe87d88, count: 200)
>> XXXX: sys_read -> 0x200
>> XXXX: sys_fstat64(fd: 3, statbuf: bfe87c98)
>> XXXX: sys_fstat64 -> 0x0
>> XXXX: sys_close(fd: 3)
>>
>> raw syscall tracer's output (echo 1 > events/raw_syscalls/enable):
>>
>> XXXX: sys_enter: NR 175 (0, bf92bf18, bf92bf98, 8, b748cff4, bf92bef8)
>> XXXX: sys_exit: NR 175 = 0
>> XXXX: sys_enter: NR 175 (2, bf92bf98, 0, 8, b748cff4, bf92bef8)
>> XXXX: sys_exit: NR 175 = 0
>> XXXX: sys_enter: NR 3 (9, bf927f9c, 4000, b77e2518, b77dce60, bf92bff8)
>>
>> Signed-off-by: Lai Jiangshan <laijs [at] cn>
>> ---
>
>
> Agreed, that's indeed not convenient.
>
> Acked-by: Frederic Weisbecker <fweisbec [at] gmail>
>
>
>

Hi, Steven

Could you accept this patch?

Lai
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


rostedt at goodmis

Nov 24, 2009, 7:41 PM

Post #4 of 4 (132 views)
Permalink
Re: [PATCH] tracing: separate raw syscall from syscall tracer [In reply to]

On Wed, 2009-11-25 at 10:08 +0800, Lai Jiangshan wrote:
> Frederic Weisbecker wrote:
> > On Tue, Nov 03, 2009 at 01:45:32PM +0800, Lai Jiangshan wrote:

> >
> > Agreed, that's indeed not convenient.
> >
> > Acked-by: Frederic Weisbecker <fweisbec [at] gmail>
> >
> >
> >
>
> Hi, Steven
>
> Could you accept this patch?
>

Will do,

Thanks,

-- Steve


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Linux kernel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.