systemtap install ubuntu

2024-06-20 09:32
文章标签 ubuntu install systemtap

本文主要是介绍systemtap install ubuntu,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

机器环境

uname -r

4.15.0-47-generic

uname -a

Linux jinbo-Latitude-E5440 4.15.0-47-generic #50-Ubuntu SMP Wed Mar 13 10:44:52 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

lsb_release -a

No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.2 LTS
Release: 18.04
Codename: bionic
安装systemtap
sudo apt-get install systemtap systemtap-runtime

检测安装

执行命令测试一下或者使用stap-prep 查看

stap -v -e 'probe vfs.read {printf(“read performed\n”); exit()}'

WARNING: Kernel function symbol table missing [man warning::symbols]
Pass 1: parsed user script and 465 library scripts using 126200virt/44648res/7372shr/37716data kb, in 120usr/10sys/137real ms.
semantic error: while resolving probe point: identifier 'kernel' at /usr/share/systemtap/tapset/linux/vfs.stp:915:18source: probe vfs.read = kernel.function("vfs_read")^semantic error: missing x86_64 kernel/module debuginfo [man warning::debuginfo] under '/lib/modules/4.15.0-47-generic/build'semantic error: resolution failed in alias expansion buildersemantic error: while resolving probe point: identifier 'vfs' at <input>:1:7source: probe vfs.read {printf("read performed\n"); exit()}^semantic error: no matchPass 2: analyzed script: 0 probes, 0 functions, 0 embeds, 0 globals using 127256virt/46552res/7996shr/38772data kb, in 30usr/100sys/124real ms.
Pass 2: analysis failed.  [man error::pass2]
Tip: /usr/share/doc/systemtap/README.Debian should help you get started.

stap-prep

You need package linux-image-4.15.0-47-generic-dbgsym but it does not seem to be available
Ubuntu -dbgsym packages are typically in a separate repository
Follow https://wiki.ubuntu.com/DebuggingProgramCrash to add this repository

安装 linux-image-4.15.0-47-generic-dbgsym

根据提示进入 https://wiki.ubuntu.com/DebuggingProgramCrashCRTL+F  搜索 "Non-built-in debug symbol packages (*-dbgsym)" 

或者直接访问如下链接:
https://wiki.ubuntu.com/DebuggingProgramCrash#Non-built-in_debug_symbol_packages_.28.2A-dbgsym.29

创建 /etc/apt/sources.list.d/ddebs.list

echo "deb http://ddebs.ubuntu.com $(lsb_release -cs) main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ddebs.listecho -e "deb http://ddebs.ubuntu.com $(lsb_release -cs)-updates main restricted universe multiverse\ndeb http://ddebs.ubuntu.com $(lsb_release -cs)-proposed main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ddebs.listsudo apt install ubuntu-dbgsym-keyringsudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F2EDC64DC5AEE1F6B9C621F0C8CAB6595FDFF622sudo apt-get update

继续检测

stap-prep

Please install linux-image-4.15.0-47-generic-dbgsym

根据提示安装:

sudo apt-get install linux-image-4.15.0-47-generic-dbgsymReading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:linux-image-unsigned-4.15.0-47-generic-dbgsym
The following NEW packages will be installed:linux-image-4.15.0-47-generic-dbgsym linux-image-unsigned-4.15.0-47-generic-dbgsym
0 upgraded, 2 newly installed, 0 to remove and 46 not upgraded.
Need to get 781 MB of archives.
After this operation, 5,485 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://ddebs.ubuntu.com bionic-updates/main amd64 linux-image-unsigned-4.15.0-47-generic-dbgsym amd64 4.15.0-47.50 [781 MB]
Get:1 http://ddebs.ubuntu.com bionic-updates/main amd64 linux-image-unsigned-4.15.0-47-generic-dbgsym amd64 4.15.0-47.50 [781 MB]
Get:1 http://ddebs.ubuntu.com bionic-updates/main amd64 linux-image-unsigned-4.15.0-47-generic-dbgsym amd64 4.15.0-47.50 [781 MB]
Get:1 http://ddebs.ubuntu.com bionic-updates/main amd64 linux-image-unsigned-4.15.0-47-generic-dbgsym amd64 4.15.0-47.50 [781 MB]
Get:2 http://ddebs.ubuntu.com bionic-updates/main amd64 linux-image-4.15.0-47-generic-dbgsym amd64 4.15.0-47.50 [12.9 kB]       
Fetched 618 MB in 5h 18min 8s (32.4 kB/s)                                                                                       
Selecting previously unselected package linux-image-unsigned-4.15.0-47-generic-dbgsym.
(Reading database ... 262650 files and directories currently installed.)
Preparing to unpack .../linux-image-unsigned-4.15.0-47-generic-dbgsym_4.15.0-47.50_amd64.ddeb ...
Unpacking linux-image-unsigned-4.15.0-47-generic-dbgsym (4.15.0-47.50) ...
Selecting previously unselected package linux-image-4.15.0-47-generic-dbgsym.
Preparing to unpack .../linux-image-4.15.0-47-generic-dbgsym_4.15.0-47.50_amd64.ddeb ...
Unpacking linux-image-4.15.0-47-generic-dbgsym (4.15.0-47.50) ...
Setting up linux-image-unsigned-4.15.0-47-generic-dbgsym (4.15.0-47.50) ...
Setting up linux-image-4.15.0-47-generic-dbgsym (4.15.0-47.50) ...

注:包有安装包有些大
Need to get 781 MB of archives.
After this operation, 5,485 MB of additional disk space will be used.

再次检测安装环境

stap-prep
没有任何提示,恭喜你安装成功了!

运行测试执行脚本

stap -v -e 'probe vfs.read {printf(“read performed\n”); exit()}'

Pass 1: parsed user script and 465 library scripts using 122716virt/49568res/7224shr/42640data kb, in 110usr/20sys/132real ms.
Pass 2: analyzed script: 1 probe, 1 function, 7 embeds, 0 globals using 348260virt/276660res/8656shr/268184data kb, in 2030usr/250sys/2291real ms.
Pass 3: translated to C into "/tmp/stap4N1z5i/stap_b59c23d8c67219a47c3e7d36242c79ab_2666_src.c" using 348260virt/276852res/8848shr/268184data kb, in 10usr/10sys/6real ms.
Pass 4: compiled C into "stap_b59c23d8c67219a47c3e7d36242c79ab_2666.ko" in 2460usr/430sys/2666real ms.
Pass 5: starting run.
read performed
Pass 5: run completed in 20usr/30sys/522real ms.

注:建议使用sudo 执行,或者按提示添加用户组

附件

https://sourceware.org/systemtap/SystemTap_Beginners_Guide.pdf

这篇关于systemtap install ubuntu的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/1077749

相关文章

新特性抢先看! Ubuntu 25.04 Beta 发布:Linux 6.14 内核

《新特性抢先看!Ubuntu25.04Beta发布:Linux6.14内核》Canonical公司近日发布了Ubuntu25.04Beta版,这一版本被赋予了一个活泼的代号——“Plu... Canonical 昨日(3 月 27 日)放出了 Beta 版 Ubuntu 25.04 系统镜像,代号“Pluc

使用国内镜像源优化pip install下载的方法步骤

《使用国内镜像源优化pipinstall下载的方法步骤》在Python开发中,pip是一个不可或缺的工具,用于安装和管理Python包,然而,由于默认的PyPI服务器位于国外,国内用户在安装依赖时可... 目录引言1. 为什么需要国内镜像源?2. 常用的国内镜像源3. 临时使用国内镜像源4. 永久配置国内镜

Ubuntu中Nginx虚拟主机设置的项目实践

《Ubuntu中Nginx虚拟主机设置的项目实践》通过配置虚拟主机,可以在同一台服务器上运行多个独立的网站,本文主要介绍了Ubuntu中Nginx虚拟主机设置的项目实践,具有一定的参考价值,感兴趣的可... 目录简介安装 Nginx创建虚拟主机1. 创建网站目录2. 创建默认索引文件3. 配置 Nginx4

Ubuntu 22.04 服务器安装部署(nginx+postgresql)

《Ubuntu22.04服务器安装部署(nginx+postgresql)》Ubuntu22.04LTS是迄今为止最好的Ubuntu版本之一,很多linux的应用服务器都是选择的这个版本... 目录是什么让 Ubuntu 22.04 LTS 变得安全?更新了安全包linux 内核改进一、部署环境二、安装系统

pip install jupyterlab失败的原因问题及探索

《pipinstalljupyterlab失败的原因问题及探索》在学习Yolo模型时,尝试安装JupyterLab但遇到错误,错误提示缺少Rust和Cargo编译环境,因为pywinpty包需要它... 目录背景问题解决方案总结背景最近在学习Yolo模型,然后其中要下载jupyter(有点LSVmu像一个

Ubuntu固定虚拟机ip地址的方法教程

《Ubuntu固定虚拟机ip地址的方法教程》本文详细介绍了如何在Ubuntu虚拟机中固定IP地址,包括检查和编辑`/etc/apt/sources.list`文件、更新网络配置文件以及使用Networ... 1、由于虚拟机网络是桥接,所以ip地址会不停地变化,接下来我们就讲述ip如何固定 2、如果apt安

怎么关闭Ubuntu无人值守升级? Ubuntu禁止自动更新的技巧

《怎么关闭Ubuntu无人值守升级?Ubuntu禁止自动更新的技巧》UbuntuLinux系统禁止自动更新的时候,提示“无人值守升级在关机期间,请不要关闭计算机进程”,该怎么解决这个问题?详细请看... 本教程教你如何处理无人值守的升级,即 Ubuntu linux 的自动系统更新。来源:https://

Ubuntu系统怎么安装Warp? 新一代AI 终端神器安装使用方法

《Ubuntu系统怎么安装Warp?新一代AI终端神器安装使用方法》Warp是一款使用Rust开发的现代化AI终端工具,该怎么再Ubuntu系统中安装使用呢?下面我们就来看看详细教程... Warp Terminal 是一款使用 Rust 开发的现代化「AI 终端」工具。最初它只支持 MACOS,但在 20

在Ubuntu上部署SpringBoot应用的操作步骤

《在Ubuntu上部署SpringBoot应用的操作步骤》随着云计算和容器化技术的普及,Linux服务器已成为部署Web应用程序的主流平台之一,Java作为一种跨平台的编程语言,具有广泛的应用场景,本... 目录一、部署准备二、安装 Java 环境1. 安装 JDK2. 验证 Java 安装三、安装 mys

如何评价Ubuntu 24.04 LTS? Ubuntu 24.04 LTS新功能亮点和重要变化

《如何评价Ubuntu24.04LTS?Ubuntu24.04LTS新功能亮点和重要变化》Ubuntu24.04LTS即将发布,带来一系列提升用户体验的显著功能,本文深入探讨了该版本的亮... Ubuntu 24.04 LTS,代号 Noble NumBAT,正式发布下载!如果你在使用 Ubuntu 23.