This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: duplicate body remover


David Smith wrote:

This actually already exists, it just happens at a later stage. If you look at the generated C code, you'll see something like this:


=================
static void probe_1480 (struct context * __restrict__ c) {
... normal systemtap initialization plus code to do 'log("here")' ...
}

...

static void probe_1481 (struct context * __restrict__ c) {
  probe_1480 (c);
}
=================


I noticed this. But what I mean is to step further to optimize enter_probe_*. e.g:


stap -e 'probe kernel.function("sys_*"),kernel.function("compat_sys_*") { log("here") }' -p3 > a.c

stap -e 'probe syscall.* { log("here") }' -p3 > b.c

on my x86_64, the size of a.c and b.c is:
[root@ltc-x326m-1 ~]# ll a.c b.c
-rw-r--r-- 1 root root  49503 Oct 20 08:39 a.c
-rw-r--r-- 1 root root 684419 Oct 20 08:39 b.c

a.c has 2 appearances of register_kprobe/enter_probe_* and b.c has 296 of that. this is a big difference. Although it's not common to have the same body for different probe points, it will cause the generated c file really large in case someone use it.

- Guanglei


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]