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

(Linux Kernel) Adding new functions in available_filter_functions

Hardware - Raspberry pi 4 Model B 8GB OS - Raspberry pi OS Buster(10)(2020-05-27-raspios-buster-full-armhf.img)(linux kerenl 4.19.y) I added rpi_get_interrupt_info() and modified show_interrupts() in proc.c Full code for rpi_get_interrupt_info() and…
Minsoo Choo
  • 161
  • 3
  • 9
1
vote
0 answers

Using ftrace in linux to understand nvme linux driver

I am new to linux. I am trying to use ftrace to understand linux nvme driver code flow. Based on articles in net, once my nvme device is mounted, I am issuing following commands to get the trace cd /sys/kernel/debug/tracing cat /dev/nvme0n1 > …
NRI
  • 11
  • 3
1
vote
1 answer

Why the idle task of linux(Swapper) running with preempt disabled?

Two evidence reveal that the linux swapper task(idle) running with the premeditation disabled: 1: the preempt count object initialized with INIT_PREEMPT_COUNT, which value is "1",means disable the preempt. #define INIT_THREAD_INFO(tsk) …
1
vote
1 answer

How to get the process ID of the program that called a system function

I am writing a small kernel driver that has the job to act as a honeypot and monitor actions taken on a specific file on the system. To start things off, I used the code in this repository, which I then slightly modified for simplicity reasons so…
John Smith
  • 13
  • 3
1
vote
2 answers

Ftrace "function" enabling fails with resource busy

I am trying to enable "function" tracer in ftrace after going…
user1457958
  • 180
  • 1
  • 8
1
vote
1 answer

How to get function name after ' } ' in ftrace/ trace-cmd

I have recently started working with ftrace. I able to get function graph trace using trace-cmd record -p function_graph -F trace-cmd report With the above commands I can see time taken by function to finish before ' } ' But I want…
1
vote
0 answers

why can not write 1 in tracing_on file system

I tried to use dynamic ftrace in android kernel (shamu which it is for nexous 6). According to source.android.com when enabled configs and rebuilt kernel. I couldn't write 1 on tracing_on. shamu:/d/tracing # echo 1>tracing_on; 1|shamu:/d/tracing…
Maede
  • 174
  • 12
1
vote
1 answer

Modifying Android systrace for capturing CPU Frequency even where is no change

I am currently running systrace with the category "freq" to capture cpu frequency with my device and I noticed that it only outputs something during a change in the freq. So if there was no change during the capture, the html output that systrace…
rominoushana
  • 451
  • 2
  • 4
  • 17
1
vote
0 answers

Missing available ftrace tracer types on my device

I am developing a user-land tracer wrapper for some research and I am needing to look specifically into context switches in my kernel. Going from this LWN article (section under "sched_switch" about a third of the way down) I have noticed some…
Alex Hoffmann
  • 355
  • 4
  • 20
1
vote
3 answers

Convert an ftrace trace.dat file to CTF format to use with TraceCompass

I can generate ftrace data either manually (and then trace-cmd extract it) or via the convenient trace-cmd(1) front-end utility. With trace-cmd, the output file is trace.dat by default; I know I can visually view it via kernelshark but would much…
kaiwan
  • 2,114
  • 1
  • 18
  • 23
1
vote
0 answers

Is there a way to access the most recent user instruction pointer from the kernel?

I am attempting to modify the Linux kernel's user_exit event tracepoint to give information about the code in user space that triggered it. Unfortunately, the state of the user program is not passed into the function context_tracking_user_enter in…
merlin2011
  • 71,677
  • 44
  • 195
  • 329
1
vote
0 answers

Is it possible to decode filenames from event tracing?

I am currently debugging performance using Linux ftrace and I noticed a few events of the following form appearing in the trace. sys_open(filename: 42130b, flags: 441, mode: 1b6) Is it possible to decode this filename into a hierarchical name in…
merlin2011
  • 71,677
  • 44
  • 195
  • 329
1
vote
0 answers

How to write functions so that they are available to ftrace?

System: Ubuntu 14.04 Kernel 4.10.12 So I'm in the process of trying to understand how to use ftrace, but something I noticed is derailing me a bit: available_filter_functions can be used to filter what's being traced to certain functions. But the…
MangoOfFury
  • 97
  • 3
  • 11
1
vote
1 answer

restoring task pt_regs when returning to original function from ftrace handler

With a kernel module (LKM), the linux kernel ftrace functions allow you to set the FTRACE_OPS_FL_SAVE_REGS and FTRACE_OPS_FL_IPMODIFY flags, essentially allowing you to completely redirect any kernel function you can find the symbol address for,…
Corey Henderson
  • 7,239
  • 1
  • 39
  • 43
1
vote
0 answers

Using early clock to print the time along with function name in x86

I want to print the timestamp for each function in x86. I am able to print the function name during early boot but I want to print the timestamp also similar to ftrace: TASK-PID CPU# TIMESTAMP FUNCTION | | | | | …
arceus
  • 327
  • 4
  • 15
1 2 3
8 9