Questions tagged [ftrace]

Ftrace is an internal tracing utility built directly into the Linux kernel. It can be used for debugging or analyzing latencies and performance issues that take place outside of user-space.

Ftrace is an internal tracer designed to help out developers and designers of systems to find what is going on inside the Linux kernel. Ftrace was derived from two preceding tools: the "latency tracer" by Ingo Molnar and the "logdev" utility by Steven Rostedt. It can be used for debugging or analyzing latencies and performance issues that take place outside of user-space.

Ftrace also includes a plugin infrastructure that allows for other types of tracing. Tracers available in ftrace through plugins allow tracing such events as:

  • context switches
  • the time it takes for a high priority task to run after it was woken up
  • the amount of time for which interrupts are disabled

123 questions
1
vote
1 answer

How does ftrace track interrupt service routines?

ftrace is used for function tracing of kernel. Now how does it work for interrupts. Can it track kernel functions in interrupt mode. If so can you explain how it works. I am trying to write a function that tracks function calls and it works fine in…
1
vote
2 answers

How to Enable or configure ftrace module

i'd like to use the advanced features of ftrace but i dit not figure out how. debugfs is mounted but there is no "tracing"-folder in /sys/kernel/debug. i am running a ARM-Target @ Angstrom distro build via yocto, please see : Image: uname -a &…
larsDD
  • 41
  • 1
  • 2
  • 8
1
vote
0 answers

ftrace leads to linux blocking and no response

I am working on GPON ONT (Broadcom 68380(MIPS32), 256MB memory) Linux kernel 3.4.11rt, after type in echo function > current_tracer, the console no response. ONT3@: cd /sys/kernel/debug/tracing ONT3@: # echo 'rdpa*' > set_ftrace_filter ONT3@: # echo…
Marty Cao
  • 11
  • 3
1
vote
1 answer

How can I measure scheduling latency in linux kernel?

I want to compare scheduling latency between two linux kernel versions. Here is what I have tried so far: Configured Ftrace on both the kernels Turned on the sched events in tracing. Enabled the wakeup tracer. However, wakeup shows results of only…
bornfree
  • 2,308
  • 1
  • 23
  • 33
1
vote
1 answer

Reading ftrace pipes with Boost::asio posix stream_descriptor

I'm trying to build an application that reads from the ftrace pipes at the debug fs. It seems that when trying to read asynchronously from trace_pipe or trace_pipe_raw using boost::asio API, the events waiting in pipe are being processed and printed…
galk
  • 61
  • 8
1
vote
1 answer

How do I use async_start and async_stop in systrace/atrace for Android

I want to capture Systrace report on my Android phone while doing automated testing. It is unknown how long the testing will take, so I can't specify the --time period for the Systrace. Digging deeper in to the systrace.py, I found out that…
Zythyr
  • 1,142
  • 4
  • 20
  • 33
1
vote
1 answer

Android systrace or atrace python parser to parse the results

any one know how to parse the systrace or atrace files like following and get the timestaps of any process using python or any other language? # / _----=> need-resched # | / _---=>…
Lava Sangeetham
  • 2,943
  • 4
  • 38
  • 54
1
vote
1 answer

Linux kernel's ftrace output format

I'm using ftrace on Android on a couple of different devices, but I noticed that the output format differs between them. In some cases, the TGID of the current process is included, while in others, it is not. The TGID is very useful in the current…
Shookit
  • 1,162
  • 2
  • 13
  • 29
1
vote
1 answer

Does FTRACE invalidate the CPU instruction cache after it has modify the code instructions in memory?

As is well known, the kernel uses "mcount" as a placeholder to redirect CPU instruction execution during FTRACE operation. Eg: c1003000 : c1003000: 55 push %ebp c1003001: 89 e5 …
Peter Teoh
  • 6,337
  • 4
  • 42
  • 58
1
vote
0 answers

Using FTRACE to debug software hang

How do you use FTRACE to debug software hang issue? I assume we can't even type anything on the busybox shell after software hangs. Is there any way it can save the traces into sdcard or something? Thanks
user1804788
  • 187
  • 1
  • 3
  • 12
1
vote
1 answer

finding longest interrupt in linux

I have a system where I have an interrupt which is taking a long time (several ms), and is causing some real-time issues. The problem is that I don't know which interrupt it is. I'm using ftrace, with the irqsoff, and it's reporting that the…
John
  • 3,400
  • 3
  • 31
  • 47
1
vote
1 answer

Is is possible to use ftrace without debugfs?

I was going through a Linux KERNEL configuration file wherein function_trace is enabled but debugfs is disabled. If i load this kernel onto the target is there any way, I can make use of the function_tracer ? if debugfs is disabled is it that the…
lxusr
  • 987
  • 3
  • 16
  • 28
0
votes
1 answer

Multi program use ftrace to hook same kernel function in same machine

I read this article and learn how to hook a linux kernel function by using ftrace. int fh_install_hook(struct ftrace_hook *hook) { err = ftrace_set_filter_ip(&hook->ops, hook->address, 0, 0); if (err) { …
TienThanh
  • 34
  • 1
  • 13
0
votes
0 answers

trace-cmd & ftrace: print only trace_printk output

I am recording a KVM session by trace-cmd using: trace-cmd record -p nop trace-cmd report trace.dat The output of the report is something like this: trace-cmd report Is it possible to remove all the extra informations (CPU#, TASK, PID, Timestamp)…
0
votes
1 answer

Systrace: When I open the systrace, I found that the information of SurfaceFlinger is not full,I just see a few information shown

Android Version:10(Q) The error systrace: enter image description here The normal systrace enter image description here I have check the ftrace config in the code,the CONFIG_TRACING=y is already on my config I can see ATRACE_CALL() on function…
1 2 3
8 9