* System call trace
@ 2012-02-15 14:38 Swapnil Gaikwad
2012-02-15 14:47 ` Alexandru Juncu
2012-02-15 14:56 ` Mulyadi Santosa
0 siblings, 2 replies; 4+ messages in thread
From: Swapnil Gaikwad @ 2012-02-15 14:38 UTC (permalink / raw)
To: kernelnewbies
Can we see trace of how the system call works?
What are the functions are called in kernel space?
For example we want to trace cp command. Then what are the functions
is get called by that in kernel space? like how the inode allocation
take place for new destination file etc.
Is any tool for that?
--
Regards,
Swapnil Gaikwad.
^ permalink raw reply [flat|nested] 4+ messages in thread
* System call trace
2012-02-15 14:38 System call trace Swapnil Gaikwad
@ 2012-02-15 14:47 ` Alexandru Juncu
2012-02-15 15:34 ` Ravishankar
2012-02-15 14:56 ` Mulyadi Santosa
1 sibling, 1 reply; 4+ messages in thread
From: Alexandru Juncu @ 2012-02-15 14:47 UTC (permalink / raw)
To: kernelnewbies
On Wed, Feb 15, 2012 at 4:38 PM, Swapnil Gaikwad
<swapnilgaik72@gmail.com> wrote:
> Can we see trace of how the system call works?
> What are the functions are called in kernel space?
> For example we want to trace cp command. Then what are the functions
> is get called by that in kernel space? like how the inode allocation
> take place for new destination file etc.
> Is any tool for that?
I think strace [0][1] is what you are looking for. "strace executable"
will list all the system calls made by the executable during runtime
(you can filter what calls you want traced).
A syscall is by definition a "function" that is ran in kernel space,
called by the userspace.
If you want to see what function is called when there's a certain
syscall, you should take a look at the syscall descriptor table. It's
an array for function pointers. You can talke a look at the kernel'
source code to see the implementation of the syscall.
Now, to track what the kernel is doing, while in a syscall, I can't
remember a tool that would do that... maybe somebody else can help.
[0] http://linux.die.net/man/1/strace
[1] http://en.wikipedia.org/wiki/Strace
--
Alexandru Juncu
ROSEdu
^ permalink raw reply [flat|nested] 4+ messages in thread
* System call trace
2012-02-15 14:38 System call trace Swapnil Gaikwad
2012-02-15 14:47 ` Alexandru Juncu
@ 2012-02-15 14:56 ` Mulyadi Santosa
1 sibling, 0 replies; 4+ messages in thread
From: Mulyadi Santosa @ 2012-02-15 14:56 UTC (permalink / raw)
To: kernelnewbies
Hi :)
On Wed, Feb 15, 2012 at 21:38, Swapnil Gaikwad <swapnilgaik72@gmail.com> wrote:
> Can we see trace of how the system call works?
> What are the functions are called in kernel space?
> For example we want to trace cp command. Then what are the functions
> is get called by that in kernel space? like how the inode allocation
> take place for new destination file etc.
> Is any tool for that?
Besides using strace, you might find User Mode Linux useful in this
case. Just attach gdb to the UML kernel, put breakpoint into system
call entry, and then do "step" to follow how it goes.
Note that UML might not precisely mimic real kernel, but at least it
will give you idea.
Other than that, cscope and/or websites like lxr.linux.no are your
best friend for such code exploration :)
--
regards,
Mulyadi Santosa
Freelance Linux trainer and consultant
blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* System call trace
2012-02-15 14:47 ` Alexandru Juncu
@ 2012-02-15 15:34 ` Ravishankar
0 siblings, 0 replies; 4+ messages in thread
From: Ravishankar @ 2012-02-15 15:34 UTC (permalink / raw)
To: kernelnewbies
On Wed, Feb 15, 2012 at 8:17 PM, Alexandru Juncu <alex.juncu@rosedu.org>wrote:
>
> Now, to track what the kernel is doing, while in a syscall, I can't
> remember a tool that would do that... maybe somebody else can help.
>
> <Kernelnewbies@kernelnewbies.org>
>
Ftrace is a tool which does just that :)
Some links:
http://lwn.net/Articles/322666/
http://lxr.linux.no/#linux+v3.2.6/Documentation/trace/ftrace.txt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20120215/31e3b3ba/attachment-0001.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-02-15 15:34 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-15 14:38 System call trace Swapnil Gaikwad
2012-02-15 14:47 ` Alexandru Juncu
2012-02-15 15:34 ` Ravishankar
2012-02-15 14:56 ` Mulyadi Santosa
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).