Uprobes:userspace Probes >= Linux 3.5

Source: Internet
Author: User
Tags systemtap

https://lwn.net/Articles/499190/

Https://github.com/andreoli/fulltrace

prominent features in Linux 3.51.1. EXT4 Metadata checksums

Modern filesystems such as ZFS and Btrfs has proved that ensuring the integrity of the filesystem using checksums is a VA Luable feature. EXT4 has added the ability to store checksums of various metadata fields. Every time a metadata field is read, the checksum of the read data was compared with the stored checksums, if they is diff Erent it means that the medata is corrupted (note so feature doesn ' t cover data, only the internal metadata structu Res, and it doesn ' t have "self-healing" capabilities). The amount of code added to implement this feature is:1659 insertions (+), 162 deletions (-).

Any EXT4 filesystem can is upgraded to use checksums using the "tune2fs-o metadata_csum" command, or "Mkfs-o Metadata_cs Um "at creation time. Once This feature are enabled in a filesystem, older kernels with no checksum support would only be able to mount it in read -only mode.

As far as performance impact goes, it shouldn ' t is noticeable for common desktop and server workloads. A Mail server FFSB simulation show nearly no change. On a test doing only file creation and deletion and extent tree modifications, a performance drop of about $ percent was Measured. However, it's a workload very heavily oriented towards metadata, in most real-world workloads metadata is usually a small Fraction of total IO, so unless your workload are metadata-oriented, the cost of enabling this feature should be negligible .

Recommended LWN article: "Improving ext4:bigalloc, inline data, and metadata checksums"

Implementation DETAILS:EXT4 Metadata checksums

Code: (Commit 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24

1.2. Uprobes:userspace Probes

Uprobes, the user-space counterpart of Kprobes, enables to place performance probes in any memory address of a user applic ation, and collect debugging and performance information non-disruptively, which can used to find performance problems. These probes can be placed dynamically in a running process, there are no need to restart the program or modify the Binari Es. The probes is usually managed with a instrumentation application, such as perf probe, Systemtap or LTTng.

A sample usage of Uprobes with Perf could is to profile libc ' malloc () calls:

    • $ perf Probe-x/lib64/libc.so.6 malloc-Added new Event:probe_libc:malloc (on 0X7EAC0)

A probe has been created. Now, let's record the global usage of malloc across all the system during 1 second:

    • $ perf record-e Probe_libc:malloc-agr sleep 1

Now you can watch the results with the TUI interface doing "$ perf report", or watch a plain text output without the call Graph info in the stdio output with "$ perf report-g flat--stdio"

If you don ' t know which function want to probe, you can get a list of probe-able funcions in libraries and executables Using the-f parameter, for example: "$ perf probe-f-x/lib64/libc.so.6" or "$ perf probe-f-x/bin/zsh". You can use the multiple probes as well and mix them with kprobes and regular PMU events or kernel tracepoints.

The Uprobes code is one of the longest standing out-of-the-tree patches. It originates from SystemTap and have been included for years in Fedora and RHEL kernels.

Recommended LWN Article:uprobes in 3.5

Code: (Commit 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)

Uprobes:userspace Probes >= Linux 3.5

Related Article

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.