Re: about syscall again~

Mathieu Desnoyers <[email protected]>
Newsgroups gmane.linux.kernel.tracing
Message-ID <20070713031543.GA19236@Krystal>
* yuanbor ([email protected]) wrote:
> 
>    I execute getegid syscall twice, and the trace list below.
> 
>    What I wanna get is the elapsed time between the time enter the kernel
>    mode and the time return to user mode. According to the trace, I get
>    this time:
> 
> 
> 
>    [1]the second syscall_entry time - the first syscall_entry
>    time:3265.985720957-3265.985719068=1889
> 
>    [2]syscall_exit - syscall_entry : 3265.985720157 - 3265.985719068=1089
> 
> 
> 
>    my question is that whether the syscall_exit time is the time exec
>    flow return from kernel mode to user mode or the time the kernel
>    starts to handle the exit code?
> 
> 

Please have a look at the kernel source for this. The marker is in
syscall_trace(). This is called within the kernel a bit before returning
to user space.

Mathieu

> 
> 
> 
> 
> 
> 
> 
>    kernel_arch.syscall_entry: 3265.985719068
>    (/home/yuanbor/trace/syscall/1184337598/cpu_0), 2710, 2710,
>    ./syscall_gettimeofday, UNBRANDED, 2664, 0x0, SYSCALL { getegid32,
>    -7152 }
> 
>    locking.hardirqs_off: 3265.985719566
>    (/home/yuanbor/trace/syscall/1184337598/cpu_0), 2710, 2710,
>    ./syscall_gettimeofday, UNBRANDED, 2664, 0x0, SYSCALL { 3222293953 }
> 
>    locking.hardirqs_on: 3265.985719853
>    (/home/yuanbor/trace/syscall/1184337598/cpu_0), 2710, 2710,
>    ./syscall_gettimeofday, UNBRANDED, 2664, 0x0, SYSCALL { 3222294237 }
> 
>    kernel_arch.syscall_exit: 3265.985720157
>    (/home/yuanbor/trace/syscall/1184337598/cpu_0), 2710, 2710,
>    ./syscall_gettimeofday, UNBRANDED, 2664, 0x0, USER_MODE
> 
>    locking.hardirqs_on: 3265.985720401
>    (/home/yuanbor/trace/syscall/1184337598/cpu_0), 2710, 2710,
>    ./syscall_gettimeofday, UNBRANDED, 2664, 0x0, USER_MODE { 3222294012 }
> 
>    kernel_arch.syscall_entry: 3265.985720957
>    (/home/yuanbor/trace/syscall/1184337598/cpu_0), 2710, 2710,
>    ./syscall_gettimeofday, UNBRANDED, 2664, 0x0, SYSCALL { getegid32,
>    -7152 }
> 
>    locking.hardirqs_off: 3265.985721336
>    (/home/yuanbor/trace/syscall/1184337598/cpu_0), 2710, 2710,
>    ./syscall_gettimeofday, UNBRANDED, 2664, 0x0, SYSCALL { 3222293953 }
> 
>    locking.hardirqs_on: 3265.985721609
>    (/home/yuanbor/trace/syscall/1184337598/cpu_0), 2710, 2710,
>    ./syscall_gettimeofday, UNBRANDED, 2664, 0x0, SYSCALL { 3222294237 }
> 
>    kernel_arch.syscall_exit: 3265.985721905
>    (/home/yuanbor/trace/syscall/1184337598/cpu_0), 2710, 2710,
>    ./syscall_gettimeofday, UNBRANDED, 2664, 0x0, USER_MODE
> 
>    locking.hardirqs_on: 3265.985722148
>    (/home/yuanbor/trace/syscall/1184337598/cpu_0), 2710, 2710,
>    ./syscall_gettimeofday, UNBRANDED, 2664, 0x0, USER_MODE { 3222294012 }

> _______________________________________________
> Ltt-dev mailing list
> [email protected]
> http://listserv.shafik.org/mailman/listinfo/ltt-dev


-- 
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.