Questions tagged [ftrace]

20 questions
8
votes
1 answer

filter out certain processes and/or pids in ftrace?

I'm not sure if I'm thinking about this the right way (and please correct me if I'm wrong), but the following is my understanding of ftrace. In /sys/kernel/debug/tracing, there are the following files: set_ftrace_filter which will only trace the…
LeapDayWilliam
  • 131
  • 1
  • 6
5
votes
2 answers

Change format of syscall event trace output to ftrace

I enabled ftrace event tracing for sys_enter_openat syscall. The respective output format given at events/syscalls/sys_enter_openat/format is print fmt: "dfd: 0x%08lx, filename: 0x%08lx, flags: 0x%08lx, mode: 0x%08lx", ((unsigned long)(REC->dfd)),…
Madhur Rawat
  • 151
  • 3
2
votes
0 answers

What's the difference between ftrace and blktrace tracepoints?

For instance, we have /sys/kernel/debug/tracing/events/block/block_bio_complete and block_rq_complete which is basically IO completion trace points for ftrace, I believe. Using sudo blktrace -d /dev/sdb1 -o - | blkparse -i - we might see a line like…
Ken Y-N
  • 253
  • 2
  • 10
2
votes
1 answer

Multiple Tracing Events Readers

Question Does the tracing pipes in Linux, for tracing events, accepts simultaneous readers? Context I am trying to get traces from the RAS subsystem while running some benchmarks. This subsystem reports hardware error events using trace events. The…
2
votes
0 answers

Linux task state different in /proc/pid/stat compared to Ftrace output of sched events

I'm trying to trace the flow of a piece of code just to understand the points where the tasks go into D/S/R states (uninterruptible/interruptible/running). I do understand the meaning of each state, however doing an exercise shows confusing results…
mdaniel
  • 41
  • 1
2
votes
1 answer

How can I send dmesg printout to ftrace subsystem?

How can I send dmesg printout to ftrace subsystem? I like correlate the dmesg msg with the functions call graph in ftrace. Thanks
2
votes
0 answers

Tool for displaying timeline view of kernel/userspace execution trace

I've used the ftrace tool trace-cmd for recording scheduling tracepoints and syscall tracepoints. I can inspect them visually using the kernelshark GUI program. It dislays per-core timelines and per-task timelines as seen in the screenshot below. I…
Daniel Näslund
  • 1,822
  • 1
  • 17
  • 18
2
votes
1 answer

ftrace not working? Probably a simple mistake

I am trying to monitor the function pci_bus_write_config_byte. I have a kernel module that I know for certain calls that function. echo "pci_bus_write_config_byte" > set_ftrace_filter Then I did cat trace_pipe and loaded the module, but nothing is…
Farhan Yusufzai
  • 211
  • 4
  • 7
1
vote
0 answers

How to get the cpu number of a trace event in a custom probe function?

I am registering a probe function for trace events using a Kernel module. For eg the probe function for the trace event sched_kthread_stop would be: void handle_kthread_stop(void *data, struct task_struct *t) And register this using…
1
vote
1 answer

How writing in debugfs controls ftrace?

Ftrace is controlled by manipulating the debug fs files. But how is it possible ? How kernel be aware of writing in this files and start its required actions?for exmple if 1 is written to tracing_on , kernel turns on tracing . Is it something…
fjahan
  • 11
  • 5
1
vote
0 answers

how to use ftrace to function_trace a kernel modules interrupt?

I have a Banana Pi Arm device with 2 cores (1.2 GHz) running a Debian kernel which I enabled ftrace kernel debug options. I want to determine the amount of time spent in a kernel module function. The function is of the form static irq_handler_t…
channon
  • 193
  • 3
  • 9
1
vote
0 answers

PMU and tracepoints

I am searching for information about the mechanism of creation of tracepoints. From this topic What are Kernel PMU event-s in perf_events list? and this blog brendangregg I've got that tracepoints are some macros inside the kernel code which are…
1
vote
0 answers

Function profiling on multi-core platform for specific PID using ftrace

I'm trying to use ftrace for function profiling based on function_profile_enabled as described here. I would like to capture function calls only for a certain PID using set_ftrace_pid as described in the same link. However, when I set PID and do…
Dimon
  • 131
  • 3
1
vote
1 answer

Ftrace time duration

I echoed 1 to tracing_on in /sys/kernel/debug/tracing directory and echoed 0 again after a second. However, the timestamp of the first entry is 216.852 and that of the last entry is 234.136 giving me a total time span of the run of about 18 seconds.…
0
votes
0 answers

Does ftrace have a function similar to trace_printk() which can print out the current function's call stack?

TLDR; Does ftrace have a function similar to trace_printk() which can print out the current function's call stack? I know how to print out the function or function graph trace using ftrace, but sometimes I want to check one place's function call…
tristone
  • 21
  • 4
1
2