Questions tagged [profiling]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
716 votes
20 answers
997k views

How to get execution time of a script effectively?

I would like to display the completion time of a script. What I currently do is - #!/bin/bash date ## echo the date at start # the script contents date ## echo the date at end This just show's ...
0 votes
1 answer
68 views

Which tools for micro-benchmarking?

I'm not sure which tool to use for micro-benchmarking a C program. I would like to measure both: Memory usage, RSS ( Resident Set Size ) CPU cycles I did use perf record -g and perf script piped ...
0 votes
1 answer
82 views

How to measure mmap I/O latency?

I have an application which appears to be slowing/blocking at the same time there's a lot of disk I/O going on, so I suspect it's I/O operations within the application which are blocking. I can't ...
51 votes
5 answers
60k views

Determining Specific File Responsible for High I/O

This is a simple problem but the first time I've ever had to actually fix it: finding which specific files/inodes are the targets of the most I/O. I'd like to be able to get a general system overview, ...
0 votes
0 answers
18 views

Child process flamegraphs

Are there any tools that will give me a flamegraph of child process execution. For example if I run make I would see all of the gcc invokations in a nice tree with their start and end times. The ...
0 votes
0 answers
20 views

Are there any Linux libraries/package that allow to profile a java application with using profiling tools like visualvm etc?

I have to find the time spent in a method or the current method being executed in java program with out connecting to profiling tools like visualvm or jconsole. Are there any such libraries in Linux ...
0 votes
1 answer
425 views

thread profiling and monitoring

how can I get lock time values specifically of the threads of any process? in linux.. I was using the command /proc/pid/stat but I am unable to determine which values are of lock time.
20 votes
6 answers
15k views

How can I profile a shell script?

I have several programs that I'm executing in a shell script: ./myprogram1 ./myprogram2 ... I know that I can profile each individual program by editing the source code, but I wanted to know if ...
3 votes
4 answers
2k views

How to profile wall-clock time?

In my program, real time duration is sometimes as much as 3 times that of cpu time. This is a single thread application that does a lot of memory allocation and NFS base read/write. So my doubt is ...
1 vote
0 answers
156 views

How do I report the max RSS of a cgroup?

I would like to monitor the peak RSS a cgroup has used since it was created. By "peak RSS" I mean: the sum of all processes' RSS at the point in time where that sum is the greatest. I ...
2 votes
1 answer
210 views

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 ...
13 votes
1 answer
10k views

Security implications of changing “perf_event_paranoid”

I'd like to use the perf utility to gather measurements for my program. It runs on a shared cluster machine with Debian 9 where by default the /proc/sys/kernel/perf_event_paranoid is set to 3, ...
2 votes
1 answer
242 views

How do I profile a real world application?

I run Debian 10 and since two weeks or so the PDF reader Atril (a fork of Evince) takes 25 seconds to start. Previously it started almost instantly. Now I'm trying to find out what causes the delay. I ...
3 votes
1 answer
1k views

Strace shows that the time spent in syscalls is much longer than the total time elapsed. Why?

I am running an AI inference program based on Tensorflow-gpu. By running /usr/bin/strace -c -f /usr/bin/time ./program, I got the following output: <my program's output> 367.91user 1032.14system ...
4 votes
0 answers
342 views

What are profiling tools available for bash/shell script

I have a project which is entirely written in shell scripts. I find some of the modules in my code takes a lot of time, I need to reduce it functionality wise. What are profiling tools available for ...
1 vote
0 answers
352 views

How can I measure time spent in child processes?

I have a command which invokes another command (synchronously) a couple of times. Is there a way to get the total time spent in the subcommand? In other words, is there a command similar to time but ...
1 vote
0 answers
383 views

How to take stack samples using `perf` based on wall-clock time

I am trying to use Linux's perf_events framework to investigate an issue with an application on one of our servers. Based on my reading about the perf tool, collecting stacks is relatively ...
0 votes
0 answers
569 views

High-frequency performance counter sampling using perf record/report

I want to retrieve performance counter counts at a high frequency (i.e. 100-200Hz) using the perf tool (similar in functionality to https://github.com/RRZE-HPC/likwid/wiki/likwid-perfctr#the-timeline-...
1 vote
2 answers
668 views

profiling a linux command to get metrics

I am trying to unzip a huge .gz file. I would like to know if there is a way we could profile this command to get the CPU utilization while the command is executing I am looking for something like ...
7 votes
1 answer
1k views

How to get the GPU execution time of a script in the shell?

I would like to display the completion time of a script, in terms of GPU time (not CPU). For the CPU, I can simply use time: francky@gimmek80s:~$ time ls -l total 8 drwxrwxr-x 3 francky francky 4096 ...
3 votes
2 answers
2k views

Measuring last-level cache misses through PAPI on AMD machine running Ubuntu Linux

It looks like by default PAPI (Performance Application Programming Interface) is not supporting to measure last-level cache misses (L3) on my AMD machine running Ubuntu Linux. However, I can measure ...
8 votes
3 answers
6k views

What are some good profiling tools for Linux?

I'm looking for some good profiling tools for Linux like OProfile. What I would like to see is how the operating system manages the interrupts, cache, read/writes, etc (lots of other intricate ...
1 vote
1 answer
120 views

Profiling a Linux box to find causes of slowness

I use a (Fedora) Linux box for daily work, and generally I boot it every morning, so we are not talking about long running processes and short uptimes. Lately I noticed that the system got slow, but ...
1 vote
0 answers
499 views

Perf tool, used for profiling, crashes on heavy load

When I am using "perf record -F 99 -g -p -- sleep 300" during average load, I am getting the perf.data file without any problem. But when the load is high, it is crashing. The only way to get an ok ...
1 vote
0 answers
62 views

python web application with very different cpu load on two identical virtual machines (Linux)

I have two virtual machines, call them A and B. Both images have Ubuntu 18.04 with kernel 4.15.0-66-generic #75-Ubuntu SMP, x64 arch, 1 core Intel(R) Xeon(R) CPU E5-2660 v2 @ 2.20GHz; A has 2 GB ...
3 votes
1 answer
649 views

Tracing and timing every step of the initialization of the shell

The following command gives me the full trace of steps zsh -i -c -x exit > trace 2>&1 I'd love for it to also capture, next to each exact step (e.g. as a first column), how long that step ...
1 vote
1 answer
26 views

Code Profiling with frequent restarts

I'm looking for a code profiler which is somewhat tolerant of the fact that our application starts and stops rather frequently. In other words, suppose my application is: int main() { ...
0 votes
2 answers
58 views

Is it possible to list everything a specific process is trying to do? [duplicate]

I have a web app in a jboss application server that gives a not understandable error. I’m 100% sure it is because it is trying to access a forbidden file system location. Is it possible to profile ...
0 votes
1 answer
190 views

functions folder in trace_stat folder of ftrace

I am learning ftrace, I read from the following link that I can enable function profiling using the 'function_profile_enabled' file. mount -t tracefs nodev /sys/kernel/tracing cd /sys/kernel/tracing ...
6 votes
6 answers
6k views

Run program at lower CPU speed?

It would be very useful for me to run specific programs in a Linux environment with a fixed (lower) CPU clock speed (say, runat 400mhz ./my-program --argument-of="my program" for getting that clock ...
3 votes
1 answer
72 views

program executing for 2 days

I have a java program which implements the Hungarian algorithm. I made changes to the existing code in such a way that the input is read from file. I have a pretty huge input around 32,000 rows for ...
0 votes
2 answers
2k views

buildroot/busybox: launch bootchartd on startup

I built a custom linux image using buildroot and busybox. To speed up the boot process I'd like to use bootchartd (built-in version of busybox) to profile the process. However bootchartd is not ...
1 vote
0 answers
23 views

Timestamp retrived with `date -r file` does not fit the time order of commands [duplicate]

I was playing around with the command date to create timestamps and profile the execution of a script. I decided to set four of them, named t1 through t4. For t2 I created an empty file whose last ...
1 vote
2 answers
1k views

What is the Linux equivalent of Mac OS X's "Sample Process"?

On Mac OS X, you can "sample" a process, which takes a backtrace of every thread in a specified process a specified number of times and then displays what methods are running (Apple man page, example ...
0 votes
2 answers
879 views

Is there a way to predict or count the number of page faults?

I am working on hardware performance counter (HPCs) and I seek to use these counters to measure some events accurately. I have found that the non-determinism in hardware performance counter (...
8 votes
3 answers
6k views

Detailed Per-Process Profiling

I am looking for a way to profile a single process including time spent for CPU, I/O, memory usage over time and optionally system calls. I already know callgrind offering some basic profiling ...
3 votes
0 answers
759 views

Perf Tool monitoring by PID

I'm using linux perf tool to monitor the performance of some processes. The documentation tells that you can flag it to collect profiles on per-thread, per-process and per-cpu basis. I get that the ...
3 votes
0 answers
320 views

How can I pause/suspend a running valgrind (with callgrind) instance?

I have some rather chunky piece of software being profiled via valgrind --tool=callgrind MySoftware (bash at Ubuntu 16.04 if it makes any difference). It was running overnight, but still hasn't ...
2 votes
0 answers
424 views

How can I find the deepest and most stack-hungry call chains in a program?

I have a program written in OCaml that tends to stack-overflow on platforms with small stacks. Rather than ulimiting the program to find and solve stack overflows one by one, I'd like to get a sorted ...
3 votes
1 answer
3k views

Understanding Perf tool output

I recently installed Perf tool On my platform and wanted to use it for profiling my platform. I started profiling a standalone application. Below is the command I used: perf start ./helloworld ...
3 votes
0 answers
315 views

How can I tell if my GPU is a bottleneck?

I already know of utilities like htop that can be used to (roughly) tell if a process is primarily bottlenecking at disk read/write speeds, network IO, not being parallel, or being parallel but ...
4 votes
1 answer
3k views

Faster startup of zsh [closed]

I love tmux, but whenever I need to create a split with a new pane or a new window it has to run my zsh init scrips and .profile, etc. And they take about a few seconds to run. Initializing stuff like ...
1 vote
1 answer
438 views

Trying to decode mp3 file on NVIDIA Tesla K20c GPU on RHEL 6.6

I am trying to use mpg123 to play a mp3 file but am struggling to do it on a GPU. Upon doing a lot of research, the closest command I found for my requirement was: mplayer -vo vdpau and -vc ...
6 votes
1 answer
2k views

Record time of every process or thread context switch

I'm trying to get the nearest to real-time processing I can with a Raspbian distribution on a Raspberry Pi for manipulating its GPIO pins. I want to get a "feel" for the kind of performance I can ...
2 votes
1 answer
563 views

performance comparison of multiple commands excutions

I've got three different programs written in three different languages, and I'm trying to compare their performance in terms of runtime, and memory consumption. What I'm looking for is some command ...
1 vote
0 answers
105 views

Performance problem Fedora 23 32-bit @ Dell D630 4GB/Nvidia

I have installed Fedora 23 32-bit at Dell D630 4GB with NVidia Quattro NVS 135M (nvidia.ko, not nouveau.ko). And I have permanent performance problem as X-Windows (Gnome) are very slow and laggy. I ...
12 votes
3 answers
3k views

Detect if an ELF binary was built with gprof instrumentation?

Is it possible to check if given program was compiled with GNU gprof instrumentation, i.e. with '-pg' flag passed to both compiler and linker, without running it to check if it would generate a gmon....
2 votes
0 answers
230 views

Benchmarking under SELinux Sandbox with Phoronix Test Suite

I would like to run the Phoronix Test Suite 6.2.2 under the SELinux sandbox on Fedora 23, but I can't execute it using $ sandbox ./phoronix-test-suite. I probably don't have the correct SELinux type. ...
1 vote
0 answers
229 views

CPU usage according to ps and operf

I've acquired some data seemingly in conflict from two sources one would assume are reliable. In all likelihood, I'm misreading one of the sources. The server environment is: Ubuntu 14.04.2 LTS, 3.13....
-4 votes
1 answer
4k views

How to determine the CPU time of the execute of Makefile in linux or Unix? [closed]

below is my Makefile using to execute my numerical code.I would like to know the time taken by the CPU to execute these C programmes. #Makefile LDFLAGS = -DN_DIM=3 #LDFLAGS = -DN_DIM=3 -...