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
4
votes
1 answer

Printing CPU number similar to ftrace

I want to print CPU number on which the current process or function is executing similar to ftrace like this: TASK-PID CPU# TIMESTAMP FUNCTION | | | | | -0 [002] 23636.756054:…
Ivid
  • 203
  • 3
  • 10
4
votes
1 answer

/sys/kernel/debug/tracing/trace_marker Bad file descriptor error

Im trying to do echo "FINN" > /sys/kernel/debug/tracing/trace_marker inside the shell (ubuntu 14) as root and im getting the next error bash: echo: write error: Bad file descriptor I dont know what is wrong, I read how to do it here and here…
nadavgam
  • 2,014
  • 5
  • 20
  • 48
4
votes
2 answers

How to get the full call graph starting from a specific function with in ftrace in Linux?

I want to trace specific function with ftrace, but with all further calls from that function. I've managed to start ftrace with filter on my desired function, but now it only shows me this one specific function called. So my question is: How to…
mhl
  • 705
  • 1
  • 8
  • 19
3
votes
1 answer

LTTng/Perf: Difference between events used for exiting (sched_process_exit) and freeing (sched_process_free) a process

Currently, I'm getting into the topic of kernel tracing with LTTng and Perf. I'm especially interested to trace the different states a process is in. I stumbled over the event sched_process_free and sched_process_exit. I'm wondering if my current…
juergen_p
  • 58
  • 5
3
votes
2 answers

How to trace a fix process’s wakeup latency?

I want to use ftrace to trace a fix process’s wakeup latency. But, ftrace will only record the max latency. And, set_ftrace_pid is useless. Does anybody know how to do that? Thank you very much.
Jams.Liu
  • 493
  • 1
  • 4
  • 13
3
votes
0 answers

How to trace all function calls in linux kernel during boot-up

I am new to Linux kernel debugging. I have came across the tools like ftrace and gdb. I want to see all the relevant function calls made when a module is loaded by the kernel when it loads such as the function calls made by the graphics driver (drm,…
anupamD
  • 862
  • 1
  • 8
  • 21
3
votes
1 answer

Unable to trace syscall via ftrace

I'm using ftrace to get trace for sys_read call in kernel. With function or graph tracers, setting set_ftrace_filter to sys_write fails # echo sys_read > tracing/set_ftrace_filter …
3uphoric
  • 33
  • 7
3
votes
2 answers

ftrace: Only print output of trace_printk()

Is it possible to dump only trace_printk() outputs in trace file? I mean filter out all functions in function tracer (or any other tracer).
Ravi
  • 1,574
  • 2
  • 16
  • 28
3
votes
0 answers

Android scheduler analysis - process wakes self up?

I'm currently using ftrace (via atrace on Android, specifically) to help me understand the scheduler's thread wakeup flow. The line below is confusing to me, however. It suggests that the current task (ls-4787) is waking up itself (comm=ls…
Shookit
  • 1,162
  • 2
  • 13
  • 29
3
votes
1 answer

How to make a linux kernel function available to ftrace?

I want to trace 2 functions in some kernel module that are called during suspend/resume. These functions do appear in "available_filter_functions". This is how I am configuring ftrace: echo nop > current_tracer echo fun_suspend >…
user690936
  • 985
  • 5
  • 13
  • 23
3
votes
1 answer

How to trace all events for a shell command using ftrace?

How can I trace the the command like cp file1 file2 using the ftrace tool? I want to see all the functions that been called when I used cp file1 file2 but I don't know how to do it. Can anyone help me and write down the exact command in the terminal…
Ygandelsman
  • 453
  • 7
  • 16
3
votes
1 answer

Ftrace on android freeze when turn on function trace, somebody help me :(

I have installed Ftrace on android AVD and try to use Ftrace's functionality, but it does not work. Below is a list of what I did: Install ubuntu 10.04 LTS Install essential tools such as android sdk, toolchain, libs, etc Download goldfish…
combabo
  • 57
  • 2
  • 7
3
votes
2 answers

Extract function names and their comments from C code with python (to understand the Linux kernel)

Backrground Information I've just started to learn stuff about drivers and the linux kernel. I want to understand how a user write() and read() works. So I started using ftrace to hopefully see the path the functions go. But a trace from a single…
samuirai
  • 762
  • 1
  • 9
  • 25
2
votes
1 answer

How can I use ftrace filtering to see the call stack above a function?

It's well-documented how to use ftrace to find the function graph starting from a certain function, e.g. # echo nop > current_tracer # echo 100 > max_graph_depth # echo ksys_dup3 > set_graph_function # echo function_graph > current_tracer # cat…
Daniel Kleinstein
  • 5,262
  • 1
  • 22
  • 39
2
votes
0 answers

Visualize the call graph output of trace-cmd

I am interested to learn about KVM. I started trace-cmd as follows: trace-cmd record -p function_graph -g kvm_vcpu_ioctl -o nofuncgraph-irqs qemu-system-x86_64 *** I analyzed the output file using Kernelshark. It is my first time using it, so I…
silentnights
  • 813
  • 3
  • 11
  • 21
1
2
3
8 9