In all fairness, you can't compare a printf() (literally) with strace ☺
99% of strace code is about syscall understanding and proper display of
parameters, so that you spend more CPU time (cheap) in strace, and less
developer time (expensive) in trying to decode the hex print of a parameter
(and you even can't, in case of strings).
So you get:

open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
mmap(0x7f2ffb132000, 17464, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f2ffb132000

Instead of:

open(0x40f1239d, 0x17) = 3
mmap(0x7f2ffb132000, 0x4438, 0x3, 0x6e, 0xffffffff, 0x0) = 0x7f2ffb132000

One could think to write a post-processor script, which would basically do
what strace does. Understanding each syscall, and demangling its parameters.
That leaves the issue with strings, which could be solved with a mapping
from syscall number, to u8 bitmap telling which parameters are strings, so
that they could be emitted correctly.



On Mon, Jan 25, 2016 at 5:42 PM, ron minnich <[email protected]> wrote:

> how do you spell strace on akaros?
>
> cat
>
> The way we were doing tracing, via the monitor command, was just plain
> inconvenient. This one is easy. Cat /proc/pid/strace. That's it.
>
> Or more or dd, or whatever.
>
> I think this can let us shrink the other bits of the kernel that are there
> for process trace.
>
> TODO: manage inheritance.
>
> This is, also, far lower overhead than strace, even better than my last
> time out at this problem as seen in
> http://5e.iwp9.org/slides/ratracetalk.pdf
>
> which was about 100x fewer system calls than strace on linux.
>
> 2016/01/25 17:34:06 Pull is The following changes since commit
> 915eac00a7e0f578f9e921af2b205b6efa3739b5:
>
>   Slices: A growable list of pointers. (2016-01-25 11:02:20 -0500)
>
> are available in the git repository at:
>
>   [email protected]:rminnich/akaros strace
>
> for you to fetch changes up to d906babf12501f03f1b1fc64a22b872ce55b1e69:
>
>   New and easy strace framework. (2016-01-25 17:28:48 -0800)
>
> ----------------------------------------------------------------
> Ronald G. Minnich (1):
>       New and easy strace framework.
>
>  kern/drivers/dev/proc.c |  25 +++++++++++
>  kern/include/env.h      |   5 +++
>  kern/src/process.c      |   5 +++
>  kern/src/syscall.c      | 112
> ++++++++++++++++++++++++++++++++++++++++--------
>
>  5 files changed, 129 insertions(+), 20 deletions(-)
>
> https://github.com/rminnich/akaros/compare/rminnich:master...strace
>
> --
> You received this message because you are subscribed to the Google Groups
> "Akaros" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Akaros" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to