Questions tagged [tracing]

35 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
7
votes
3 answers

How to debug/trace bash function?

I have a bash script myscript.sh, which has a bunch of functions inside. To run one function, I would write source myscript.sh; myfunction How debug such a function?
Dims
  • 3,181
  • 9
  • 49
  • 107
7
votes
1 answer

How to capture the xtrace output (only) in a file?

I know that I can redirect the xtrace output to some_file with something like this: exec 2 >> some_file set +x ...but this sends to some_file not only the xtrace output, but also any other content originally sent to fd 2, which includes most error…
kjo
  • 14,779
  • 25
  • 69
  • 109
5
votes
1 answer

How to trace DMA?

I am working on software that communicates with a PCI card through direct memory access (DMA) transactions. My programs use a suit of drivers and a library that handles the DMA. Everything runs on a Red Hat Linux. To test and measure the performance…
xealits
  • 2,093
  • 3
  • 19
  • 27
5
votes
3 answers

Define bash function which does not show up in xtrace (set -x)

In a bash script I have a log() function that is used in several places, as well as a logs() function that diverts lots of line to log(). When I run parts of the script with set -x, obviously all commands within logs() and log() are traced too. I…
Harald
  • 826
  • 1
  • 9
  • 21
3
votes
0 answers

What is causing this 3s delay in gvim startup?

The gvim program is stuck for 3 seconds before opening any file. This issue is isolated to gvim, vim opens just fine. Therefore, the cause must be somewhere in X or some related service and not vim. I have tried disabling all my vim plugins and the…
3
votes
1 answer

Can getauxval be used to determine whether or not you're being traced?

Coming off of this question, I patched my kernel in a quest to get SQL Server 2017 on Linux to start up. Now I'm getting further but I'm being shut down, strstr("TracerPid:\t0\n", "TracerPid:") …
Evan Carroll
  • 28,578
  • 45
  • 164
  • 290
2
votes
1 answer

How to convert an int to a string in DTrace?

I'd like to be able to concatenate a string and an int using strjoin(), e.g., strjoin("ada", args[1]->unit_number); but in order to do that I have to make sure that the int is first converted to a string. I'm running DTrace on FreeBSD…
Mateusz Piotrowski
  • 4,623
  • 5
  • 36
  • 70
2
votes
1 answer

How can I profile virtual memory accesses made in user mode and kernel mode?

I would like to generate a log of all virtual memory accesses performed in user mode and kernel mode as a result of running some program. Besides collecting memory access locations, I also want to capture other state information (e.g., instruction…
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

Record filesystem activity

I would like to record all filesystem activity so that I can later replay it at will (for benchmarking purposes). What's the best way of doing that? I considered strace, but rejected that because it doesn't tell me when an mmaped file is being read…
Nikratio
  • 121
  • 3
2
votes
2 answers

What is this `gmain` process with these unknown PIDs in my trace file?

Reading up on an answer to find out which process registered inotify watchers, I executed the following commands echo 1 | sudo tee /sys/kernel/debug/tracing/events/syscalls/sys_exit_inotify_add_watch/enable sudo cat /sys/kernel/debug/tracing/trace…
oligofren
  • 1,090
  • 9
  • 15
2
votes
1 answer

How can I diagnose a process which has no executable file name associated with it?

There is a process taking up 100% CPU on a KVM based server I am running. This is the output of htop. PID USER PRI NI VIRT RES SHR S CPU% MEM% TIME+ Command 22230 adminx 20 0 185M 3468 1600 S 100. 0.5…
vfclists
  • 7,215
  • 14
  • 51
  • 79
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

How to measure changes to the filesystem done by a certain application?

I am using a command line application which creates a great amount of intermediate artifacts to the file system and then at some point deletes them. On environments where storage space is constrained this can pose a problem. I'd like to know if…
carlossless
  • 243
  • 1
  • 2
  • 6
1
2 3