Notes on Linux blktrace

Source: Internet
Author: User

0 Usage

 Blktrace:device configuration, and event extraction utility.

-store events in Long term Storge

-or, pipe to blkparse utility for live tracing

Blkparse:event Formatting utility

-supports textual or binary dump output

 $blktrace-d <device> [-R Debug_path] [-o output] [-K] [-W time]

$blkparse-I <input> []

As noted previously, Blktrace does not analyze the data, it's responsible for storing and formatting Events.

--------------------------------------------------------------------------------------------------------------- ---------------------------

1.1 Blktrace User Guide

The blktrace utility extracts event traces from the kernel (via the relaying through the debug file system).

  • Blktrace receives data from the kernel on buffers passed up through the debug file system (relay). Each device being traced have a file created in the mounted directory for the DEBUGFS, which defaults to /sys/kernel/ Debug -This can is overridden with the- r command line argument.
  • Blktrace defaults to collecting all events the can be traced. To limit the events being captured, you can specify one or more filter masks via the -a option.

    Alternatively, one may specify the entire mask utilizing a hexadecimal value of is version-specific. (Requires understanding of the internal representation of the filter mask).

  • As noted above, the events is passed up via a series of buffers stored into DEBUGFS files. The size and number of buffers can be specified via the- b and- n arguments respectively.
  • Blktrace stores the extracted data into files stored in the local directory. The format of the file names is (by default) device. Blktrace.  CPU, where device is the base device name (e.g, if we are TRACING/DEV/SDA, the base device name would Be SDA); and CPU identifies a CPU for the event stream.

    The device portion of the event file name can be changed via the- o option.

  • Blktrace may also is run concurrently simultaneous with Blkparse to produce live output-to does this specify- o - for Blktrace.
  • The default behaviour for Blktrace are to run forever until explicitly killed by the user (via a control-c, or kill Utility invocation Call ). There is ways to modify this:
      1. Utilize the Blktrace utility itself to kill a running trace-via the- k option.
      2. You can specify a run-time duration for Blktrace via the- w option -then Blktrace would run for the spec ified number of seconds, and then Halt.

1.2 Command Line Arguments

-D Use specified devices

-R Path to mounted Debugfs, defaults to/sys/kernel/debug

-O File (s) to send output to

-K Kill Running trace

-W Stop after defined time, in seconds.

-B Sub buffer size in KiB

-N Number of sub buffers

-A Add mask to the current filter. Available Actions are:read, WRITE, BARRIER, SYNC, QUEUE, Requeue, ISSUE, complete, FS, PC.

-A Set filter mask to Hex-mask

  

--------------------------------------------------------------------------------------------------------------- ---------------------------

2.1 Blkparse User Guide

The blkparse utility would attempt to combine streams of events for various devices on various CPUs, and produce a Formatted output of the event information. As with Blktrace, some details concerning blkparse would help on understanding the command line options presented below.

  • by default, Blkparse expects to run in a post-processing mode -one where the trace events has been saved by a Previous run of Blktrace, and Blkparse is combining event streams and dumping formatted data.

    Blkparse May is run in a live manner concurrently with blktrace by specifying -i- to Blkparse, and combining it with the live option for Blktrace. An example would is:

      % blktrace-d/dev/sda-o-| Blkparse-i-
  • can set how many Blkparse batches batch event reads via the- b option, the default is to handle events in batches of 512.
  • If you have saved event traces in Blktrace with different output names (via the- o option to blktrace), you must Specify the same input name via the -i option.
  • The format of the output data can be controlled via the- F or- f options.

    by default, the Blkparse sends formatted data to standard output. This could be changed via the- o option, or text output can disabled via the- o option. A merged binary stream can be produced using the- d option.

2.2 Command Line Arguments

2.3 Trace Actions (Events)

  

2.4 Output Description and formatting

--------------------------------------------------------------------------------------------------------------- ---------------------------

Appendix

Notes on Linux blktrace

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.