ptrace - Linux

This is a discussion on ptrace - Linux ; hello,
I'm trying to write some sort of tracing app. the idea is to walk with
the program through every systemcall and print/time along the way.
(never mind strace i know about it i just wanna do something by hand).
...

ptrace

hello,
I'm trying to write some sort of tracing app. the idea is to walk with
the program through every systemcall and print/time along the way.
(never mind strace i know about it i just wanna do something by hand).

the problem is i'm not catching the syscalls. also is there another
way to test the usage of syscalls?

Thank you

Re: ptrace

On Mar 9, 6:55 pm, "itendtoinfin...@gmail.com" wrote:
> I'm trying to write some sort of tracing app. the idea is to walk with
> the program through every systemcall and print/time along the way.
> (never mind strace i know about it i just wanna do something by hand).

Since you're trying to precisely replicate 'strace's functionality,
you can look at its source code to learn how to do it.

DS

Re: ptrace

On Sun, 9 Mar 2008 22:56:13 -0700 (PDT) David Schwartz wrote:
| On Mar 9, 6:55 pm, "itendtoinfin...@gmail.com"
| wrote:
|
|> I'm trying to write some sort of tracing app. the idea is to walk with
|> the program through every systemcall and print/time along the way.
|> (never mind strace i know about it i just wanna do something by hand).
|
| Since you're trying to precisely replicate 'strace's functionality,
| you can look at its source code to learn how to do it.

Is there something simpler than strace for use as an example? Or is it
the case that usage of ptrace() implies the need to do things as complex
as strace does them? IMHO, strace is not a good example of how to call
ptrace(). Instead, it is a good example of how to elaboratly portray
what is going on with those ptrace() calls. For someone wanting to do
the former, which I understand describes the OP, something simpler would
serve better.

Re: ptrace

On Mar 11, 6:47 pm, phil-news-nos...@ipal.net wrote:
> On Sun, 9 Mar 2008 22:56:13 -0700 (PDT) David Schwartz wrote:
> | On Mar 9, 6:55 pm, "itendtoinfin...@gmail.com"| wrote:
>
> |
> |> I'm trying to write some sort of tracing app. the idea is to walk with
> |> the program through every systemcall and print/time along the way.
> |> (never mind strace i know about it i just wanna do something by hand).
> |
> | Since you're trying to precisely replicate 'strace's functionality,
> | you can look at its source code to learn how to do it.
>
> Is there something simpler than strace for use as an example?

Not if you want to do what 'strace' does.
> Or is it
> the case that usage of ptrace() implies the need to do things as complex
> as strace does them? IMHO, strace is not a good example of how to call
> ptrace(). Instead, it is a good example of how to elaboratly portray
> what is going on with those ptrace() calls. For someone wanting to do
> the former, which I understand describes the OP, something simpler would
> serve better.

I think the OP wants to do exactly what 'strace' does. "the idea is to
walk with the program through every systemcall and print/time along
the way". I suppose it depends what he means by "walk with the
program".

In any event, looking at 'strace' is the obvious thing to do, and if
it failed the OP in some way, he needs to explain how. Otherwise,
he'll get the obvious answer.