Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I don't know about DTrace, but perf is a sampling profiler, not an accurate call tracer.


Perf is much more than a sampling profiler: https://perf.wiki.kernel.org/index.php/Main_Page. It can use uprobes and kprobes.

There are many ways to do dynamic tracing in Linux, apart from perf. Ftrace, raw kprobes/uprobes, eBPF, bcc compiler for eBPF, etc.


After perusing the perf man page, the only way I could figure out how to make it accurately count userspace function calls was using hardware breakpoints, e.g.: "perf stat -e mem:0xADDRESS:x"

Obviously that's not a very good approach, because you're limited to the number of breakpoints that your CPU can handle simultaneously (4 on my machine) and there's a lot of overhead. If you know of a better way to accomplish the same thing with perf, I'd be happy to hear it.



Ah, cool. I just tested it out and it seems to work as documented. Unfortunately it requires root access, and incurs about 1 microsecond of overhead per function call on my machine.


Reading the X-Ray abstract, unless I'm missing it, it doesn't go into detail about the time overhead. I do see mention of CPU and RAM usage, though.

I'm not sure that we have any evidence that X-Ray offers less overhead here, though it's certainly cool if it does.


Can you give an example where perf works with 10 million+ probe points?

:)

(and where this does not have an antagonist effect on the other things on the machine?)



And for those poor people who haven't seen bcc, do yourself a favor and look into it: http://iovisor.github.io/bcc/

Besides, with a unicorn for the logo, whats not to like?




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: