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设置程序开机自启动的操作步骤

《Ubuntu设置程序开机自启动的操作步骤》在部署程序到边缘端时,我们总希望可以通电即启动我们写好的程序,本篇博客用以记录如何在ubuntu开机执行某条命令或者某个可执行程序,需要的朋友可以参考下... 目录1、概述2、图形界面设置3、设置为Systemd服务1、概述测试环境:Ubuntu22.04 带图

Ubuntu上手动安装Go环境并解决“可执行文件格式错误”问题

《Ubuntu上手动安装Go环境并解决“可执行文件格式错误”问题》:本文主要介绍Ubuntu上手动安装Go环境并解决“可执行文件格式错误”问题,具有很好的参考价值,希望对大家有所帮助,如有错误或未... 目录一、前言二、系统架构检测三、卸载旧版 Go四、下载并安装正确版本五、配置环境变量六、验证安装七、常见

ubuntu如何部署Dify以及安装Docker? Dify安装部署指南

《ubuntu如何部署Dify以及安装Docker?Dify安装部署指南》Dify是一个开源的大模型应用开发平台,允许用户快速构建和部署基于大语言模型的应用,ubuntu如何部署Dify呢?详细请... Dify是个不错的开源LLM应用开发平台,提供从 Agent 构建到 AI workflow 编排、RA

ubuntu系统使用官方操作命令升级Dify指南

《ubuntu系统使用官方操作命令升级Dify指南》Dify支持自动化执行、日志记录和结果管理,适用于数据处理、模型训练和部署等场景,今天我们就来看看ubuntu系统中使用官方操作命令升级Dify的方... Dify 是一个基于 docker 的工作流管理工具,旨在简化机器学习和数据科学领域的多步骤工作流。

如何在Ubuntu上安装NVIDIA显卡驱动? Ubuntu安装英伟达显卡驱动教程

《如何在Ubuntu上安装NVIDIA显卡驱动?Ubuntu安装英伟达显卡驱动教程》Windows系统不同,Linux系统通常不会自动安装专有显卡驱动,今天我们就来看看Ubuntu系统安装英伟达显卡... 对于使用NVIDIA显卡的Ubuntu用户来说,正确安装显卡驱动是获得最佳图形性能的关键。与Windo

双系统电脑中把Ubuntu装进外接移动固态硬盘的全过程

《双系统电脑中把Ubuntu装进外接移动固态硬盘的全过程》:本文主要介绍如何在Windows11系统中使用VMware17创建虚拟机,并在虚拟机中安装Ubuntu22.04桌面版或Ubunt... 目录一、首先win11中安装vmware17二、磁盘分区三、保存四、使用虚拟机进行系统安装五、遇见的错误和解决

CentOS和Ubuntu系统使用shell脚本创建用户和设置密码

《CentOS和Ubuntu系统使用shell脚本创建用户和设置密码》在Linux系统中,你可以使用useradd命令来创建新用户,使用echo和chpasswd命令来设置密码,本文写了一个shell... 在linux系统中,你可以使用useradd命令来创建新用户,使用echo和chpasswd命令来设

解决Maven项目idea找不到本地仓库jar包问题以及使用mvn install:install-file

《解决Maven项目idea找不到本地仓库jar包问题以及使用mvninstall:install-file》:本文主要介绍解决Maven项目idea找不到本地仓库jar包问题以及使用mvnin... 目录Maven项目idea找不到本地仓库jar包以及使用mvn install:install-file基

Ubuntu中远程连接Mysql数据库的详细图文教程

《Ubuntu中远程连接Mysql数据库的详细图文教程》Ubuntu是一个以桌面应用为主的Linux发行版操作系统,这篇文章主要为大家详细介绍了Ubuntu中远程连接Mysql数据库的详细图文教程,有... 目录1、版本2、检查有没有mysql2.1 查询是否安装了Mysql包2.2 查看Mysql版本2.

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

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