SystemTap Beginners Guide

Easter79
• 阅读 437

SystemTap 3.0

SystemTap Beginners Guide

Introduction to SystemTap

Edition 3.0

Red Hat, Inc.

Don Domingo

Engineering Services and Operations Content Services

[ddomingo@redhat.com](https://www.oschina.net/action/GoToLink?url=mailto%3Addomingo%40redhat.com)

William Cohen

Engineering Services and Operations Performance Tools

[wcohen@redhat.com](https://www.oschina.net/action/GoToLink?url=mailto%3Awcohen%40redhat.com)

Copyright © 2013 Red Hat, Inc

Legal Notice

This documentation is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

For more details see the file COPYING in the source distribution of Linux.

Abstract

This guide provides basic instructions on how to use SystemTap to monitor different subsystems of a Linux system in finer detail.

Preface

1. Document Conventions

1.1. Typographic Conventions

1.2. Pull-quote Conventions

1.3. Notes and Warnings

2. We Need Feedback!

1. Introduction

1.1. Documentation Goals

1.2. SystemTap Capabilities

1.3. Limitations of SystemTap

2. Using SystemTap

2.1. Installation and Setup

2.1.1. Installing SystemTap

2.1.2. Installing Required Kernel Information Packages Manually

2.1.3. Initial Testing

2.2. Generating Instrumentation for Other Computers

2.3. Running SystemTap Scripts

2.3.1. SystemTap Flight Recorder Mode

3. Understanding How SystemTap Works

3.1. Architecture

3.2. SystemTap Scripts

3.2.1. Event

3.2.2. SystemTap Handler/Body

3.3. Basic SystemTap Handler Constructs

3.3.1. Variables

3.3.2. Target Variables

3.3.3. Conditional Statements

3.3.4. Command-Line Arguments

3.4. Associative Arrays

3.5. Array Operations in SystemTap

3.5.1. Assigning an Associated Value

3.5.2. Reading Values From Arrays

3.5.3. Incrementing Associated Values

3.5.4. Processing Multiple Elements in an Array

3.5.5. Clearing/Deleting Arrays and Array Elements

3.5.6. Using Arrays in Conditional Statements

3.5.7. Computing for Statistical Aggregates

3.6. Tapsets

4. User-space Probing

4.1. User-Space Events

4.2. Accessing User-Space Target Variables

4.3. User-Space Stack Backtraces

5. Useful SystemTap Scripts

5.1. Network

5.1.1. Network Profiling

5.1.2. Tracing Functions Called in Network Socket Code

5.1.3. Monitoring Incoming TCP Connections

5.1.4. Monitoring TCP Packets

5.1.5. Monitoring Network Packets Drops in Kernel

5.2. Disk

5.2.1. Summarizing Disk Read/Write Traffic

5.2.2. Tracking I/O Time For Each File Read or Write

5.2.3. Track Cumulative IO

5.2.4. I/O Monitoring (By Device)

5.2.5. Monitoring Reads and Writes to a File

5.2.6. Monitoring Changes to File Attributes

5.2.7. Periodically Print I/O Block Time

5.3. Profiling

5.3.1. Counting Function Calls Made

5.3.2. Call Graph Tracing

5.3.3. Determining Time Spent in Kernel and User Space

5.3.4. Monitoring Polling Applications

5.3.5. Tracking Most Frequently Used System Calls

5.3.6. Tracking System Call Volume Per Process

5.4. Identifying Contended User-Space Locks

6. Understanding SystemTap Errors

6.1. Parse and Semantic Errors

6.2. Runtime Errors and Warnings

7. References

A. Revision History

Index

点赞
收藏
评论区
推荐文章
blmius blmius
2年前
MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1
文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s
Wesley13 Wesley13
2年前
java将前端的json数组字符串转换为列表
记录下在前端通过ajax提交了一个json数组的字符串,在后端如何转换为列表。前端数据转化与请求varcontracts{id:'1',name:'yanggb合同1'},{id:'2',name:'yanggb合同2'},{id:'3',name:'yang
Easter79 Easter79
2年前
systemtap使用:获取ssh登录的用户密码
一、Systemtap概述:        SystemTap是一个诊断Linux系统性能或功能问题的开源软件,对用户级和内核级代码提供了静态和动态跟踪的功能。Systemtap采用其他的内核框架做源:静态探针用tracepoints、动态探针用kprobes、用户级别的探针用uprobes。这些源也为perf、LTTng所用
Easter79 Easter79
2年前
systemtap安装与使用
http://sourceware.org/systemtap/tutorial.pdf(https://www.oschina.net/action/GoToLink?urlhttp%3A%2F%2Fsourceware.org%2Fsystemtap%2Ftutorial.pdf)
Stella981 Stella981
2年前
Android So动态加载 优雅实现与原理分析
背景:漫品Android客户端集成适配转换功能(基于目标识别(So库35M)和人脸识别库(5M)),导致apk体积50M左右,为优化客户端体验,决定实现So文件动态加载.!(https://oscimg.oschina.net/oscnet/00d1ff90e4b34869664fef59e3ec3fdd20b.png)点击上方“蓝字”关注我
Easter79 Easter79
2年前
SystemTap使用技巧
1.简介SystemTap是一个Linux非常有用的调试(跟踪/探测)工具,常用于Linux内核或者应用程序的信息采集,比如:获取一个函数里面运行时的变量、调用堆栈,甚至可以直接修改变量的值,对诊断性能或功能问题非常有帮助。SystemTap提供非常简单的命令行接口和很简洁的脚本语
Stella981 Stella981
2年前
Hightopo 2D 入门
这是一片HT的入门级文章,如果您能读懂http://www.hightopo.com/guide/guide/core/beginners/examples/example\_overview.html(https://www.oschina.net/action/GoToLink?urlhttp%3A%2F%2Fwww.hightopo.c
Wesley13 Wesley13
2年前
35岁是技术人的天花板吗?
35岁是技术人的天花板吗?我非常不认同“35岁现象”,人类没有那么脆弱,人类的智力不会说是35岁之后就停止发展,更不是说35岁之后就没有机会了。马云35岁还在教书,任正非35岁还在工厂上班。为什么技术人员到35岁就应该退役了呢?所以35岁根本就不是一个问题,我今年已经37岁了,我发现我才刚刚找到自己的节奏,刚刚上路。
Wesley13 Wesley13
2年前
MySQL部分从库上面因为大量的临时表tmp_table造成慢查询
背景描述Time:20190124T00:08:14.70572408:00User@Host:@Id:Schema:sentrymetaLast_errno:0Killed:0Query_time:0.315758Lock_
Python进阶者 Python进阶者
3个月前
Excel中这日期老是出来00:00:00,怎么用Pandas把这个去除
大家好,我是皮皮。一、前言前几天在Python白银交流群【上海新年人】问了一个Pandas数据筛选的问题。问题如下:这日期老是出来00:00:00,怎么把这个去除。二、实现过程后来【论草莓如何成为冻干莓】给了一个思路和代码如下:pd.toexcel之前把这
Easter79
Easter79
Lv1
今生可爱与温柔,每一样都不能少。
文章
2.8k
粉丝
5
获赞
1.2k