Hi, Lassi:
The unwind cost is a major problem that bothers me now. I explain in detail about my system.
I write a profiling service in a cloud system. This system will sampling the all CPUs in a machine, and the cloud system will have thousands machines. The sampling frequency is 10 Hz. All OS are rhel5u7, the x86_64 version. The libunwind is the latest version (I got it use git).
All programs are wrote by C/C++, compiler is GCC/G++, the version is 4.1.2.
I got the sampling information like perf. The stack, registers are saved in kernel, then use the external walking to unwind the stack. The APIs I used is like:
unw_create_addr_space()
unw_init_remote()
static unw_accessors_t accessors = {
.find_proc_info = find_proc_info,
.put_unwind_info = put_unwind_info,
.get_dyn_info_list_addr = get_dyn_info_list_addr,
.access_mem = access_mem,
.access_reg = access_reg,
.access_fpreg = access_fpreg,
.resume = resume,
.get_proc_name = get_proc_name,
};
It must be a slow method.
Regards Chenggang
3x
At 2014-11-22 21:16:11, "Lassi Tuura" <address@hidden> wrote:
That doesn't sound normal to me, but how exactly are you doing the walking? What operating system are you using, is it 32- or 64-bit, which library version, how did you build it, are you using external (ptrace) or in-process (UNW_LOCAL_ONLY) walking, what exact API are you calling to walk, what language and compiler did you use for your program, etc.?
Here are some reference numbers from another profiling tool (igprof) using libunwind a few years back:
The time in clock cycles to walk on average 30-ish stack frames, for very frequent walks (3M/sec) was in the ballpark of 2500, and 70000 for less frequent setitimer interrupts at 200/sec (~5 ms interrupt).