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

Logging the kernel Ftrace point selectively for particular arguments

I want to measure performance of some kernel functions using Ftrace but I want to measure it selectively for particular value of argument. This is because the same/other programs calling the same function (but with different argument) pollute my…
shivank
  • 67
  • 1
  • 10
0
votes
1 answer

How to use ftrace for tcp probe?

I am trying to do an assignment (from another univ's coursepage) which has a line in the starter code (Python with mininet) as os.system("rmmod tcp_probe; modprobe tcp_probe full=1") Popen("cat /proc/net/tcpprobe > %s" % (outfile), shell=True) which…
Test Zero
  • 35
  • 1
  • 4
0
votes
0 answers

ftrace: output through GPIO

I am doing some research and need to collect all the kernel function calls within a certain time span, e.g. 60 seconds. I am using Raspberry Pi 4B. I've tried to use the function tracer ftrace and read the trace_pipe via echo function >…
0
votes
1 answer

How to capture all generated events with ftrace without any loss

I'm currently doing some experiments, and I need to record all the events that are generated during the execution of normal stress-ng execution cyle like this /usr/bin/stress-ng -c 80 -t 30 --times --exec 50 --exec-ops 50, specifically the ones…
0
votes
0 answers

I can't dump a stacktrace when i use linux trace event triggers

The kernel document 'tracing: trace event triggers' said i can use stacktrace cmd to dump a stacktrace to the trace buffer whenever the trigger event is hit. But all i got is a simple string "stacktrace". Here is my configure: cd…
jasonbone
  • 1
  • 1
0
votes
1 answer

splice(2) returns "Invalid argument" when reading from ftrace raw files

I wanted to try splice syscall, which trace-cmd uses to zero copy raw files of off ftrace. Here is the partial list of ftrace raw files splice fails to…
p3t3
  • 95
  • 8
0
votes
0 answers

I try to ftrace open system call but trace record is all about SyS_read

I tried to trace the open() system call using this code. #include #include int main() { char *path = "/home/[my account]/text.txt"; int fd; fd = open(path, O_RDWR); return 0; } And I compiled it with gcc -o…
H.Potter
  • 137
  • 2
  • 9
0
votes
1 answer

function_graph plugin fails to log function_entry records when tracing_threshold is non zero

function_graph plugin fails to log function_entry records when tracing_thresh is set to non-zero value, i am using ubuntu with 4.15 kernel. Looks like, i have stumbled on a bug discussed at https://lore.kernel.org/patchwork/patch/188477/ . Please…
Ravikumar Tulugu
  • 1,702
  • 2
  • 18
  • 40
0
votes
1 answer

How to print full trace file of trace_printk in ftrace?

I am using trace_printk() to print some numbers (they are around a million number). However when I check /sys/kernel/debug/tracing/trace ... only a part of the full range is printed. Can anyone suggest me how to increase the buffer size or any way…
0
votes
1 answer

Using ftrace on simple program, Inline Assembly __asm__("leave") resulting in seg fault

I am reading through this book on learning Linux Binary Analysis. In the book the author presents ftrace, which he has on his github and demonstrates how to use it. He provides a small bit of code with which to test the ftrace. When running the…
Camilo
  • 85
  • 8
0
votes
2 answers

perf ftrace falis to start

When try to start perf ftrace I get following error write '' to tracing/tracing_cpumask failed: Invalid argument failed to reset ftrace However my kernel configured ftrace enabled and trace-cmd ftrace frontend also works as well. For some reason…
SPYFF
  • 133
  • 1
  • 6
0
votes
1 answer

Linux function profiler output

I would like to profile a code flow in kernel in order to understand where is the bottleneck. I found that function profiler does just that for me: https://lwn.net/Articles/370423/ Unfortunately the output I see doesn't make sense to me. From the…
0
votes
1 answer

Why there is no irqsoff option in the ftrace

I am using the ubuntu 16.04 with Linux 4.10.0-041000-generic. When I tried to output the available_tracers content, there was no irqsoff option available. I want to use this option to review an experiment in a paper. How can I get the irqsoff…
Luba A
  • 81
  • 9
0
votes
1 answer

How to use trace marker in ftrace?

How to use trace marker in ftrace in order to record user events? I use the following, but the compiler cannot define WR_ONLY: static int trace_fd = -1; void trace_write(const char *fmt, ...) { va_list ap; char…
0
votes
1 answer

Kernel traces returning Truncated message

"File possibly truncated. Need atleast %ld size but size is %ld". Can anyone help me out how this message is invoked? I am seeing this message when I am trying to collect the kernel-trace. Can anyone explain why this scenario occurs when I am trying…
rahul
  • 1
1 2 3
8 9