Linux-Process Tracking

Source: Internet
Author: User
Tags valgrind

Linux-Process Tracking

Linux-Process Tracking

Strace method:
Strace XXX-o ttt --- trace the system calls of XXX execution process calls and save the results to the ttt File

Strace-c XXX --- tracking the duration of every system call of XXX

Strace-f XXX --- trace all processes of XXX, including system calls of sub-Processes

Strace-e trace = open, write XXX --- tracking open and write system calls of XXX execution process calls

Strace-e trace = network-p 24567 --- all network-related system calls of the 24567 Process

Ltrace method:
Ltrace-s XXX --- trace system calls and library function calls

Ltrace-e strcpy, strlen XXX --- trace the strcpy and strlen library functions called by the Process

Ltrace-l/lib64/librt. so.1 XXX --- trace the library functions in the specified dynamic library called by XXX

Valgrind method:
The tool is not installed by default and must be manually installed.

Valgrind -- tool = memcheck -- trace-children = yes XXX

--- Use valgrind's memcheck tool to perform memory detection on XXX commands.

Memcheck

Detects memory errors. It helps you tune your programs to behave correctly.

Cachegrind

Profiles cache prediction. It helps you tune your programs to run faster.

Callgrind

Works in a similar way to cachegrind but also gathers additional cache-profiling information.

Exp-drd

Detects thread errors. It helps you tune your multi-threaded programs to behave correctly.

Helgrind

Another thread error detector. Similar to exp-drd but uses different techniques for problem analysis.

Massif

A heap profiler. Heap is an area of memory used for dynamic memory allocation. This tool helps you tune your program to use less memory.

Lackey

An example tool showing instrumentation basics

This article permanently updates the link address:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.