Re: Capturing User-Level Function Calls/Returns

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


Hi Steven and Mathieu,
Firstly, many thanks! This method seems to be the most efficient method. But, IIUC, what you suggest requires source code compilation. I need an efficient dynamic method that, given the function address, captures its occurrence and stores some information from the execution context. Is there anything better than Uprobes perhaps with no trap into the kernel? Why do we need traps?

On 2020-07-15 23:15, Mathieu Desnoyers wrote:

----- On Jul 15, 2020, at 2:28 PM, rostedt rostedt@xxxxxxxxxxx wrote:

On Wed, 15 Jul 2020 20:37:16 +0430
ahmadkhorrami <ahmadkhorrami@xxxxxxxx> wrote:

What is the most efficient way to capture occurrence of a function
call/return of a binary program in userspace?
It seems the answer is Uprobes. 1) Am I right?
But Uprobes use "int" instruction which leads to a switch into kernel
mode. 2) Wouldn't it be better to avoid this transition?
I'm looking forward to your reply and will be happy to read your

Hi, I believe LTTng has utilities that can help you trace user space

Indeed, it is documented here:

If your program is generating function entry/exit at a very
high rate (which goes beyond your available I/O throughput and
lasts longer than the memory you have available for ring buffers),
you will also probably want to use the "blocking-timeout" option
documented at:



I think there's also a users ftrace like utility that Namhyung was
working on. But I don't know where in the development that is.

-- Steve

[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux