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

相关文章

idea npm install很慢问题及解决(nodejs)

《ideanpminstall很慢问题及解决(nodejs)》npm安装速度慢可通过配置国内镜像源(如淘宝)、清理缓存及切换工具解决,建议设置全局镜像(npmconfigsetregistryht... 目录idea npm install很慢(nodejs)配置国内镜像源清理缓存总结idea npm in

在Ubuntu上打不开GitHub的完整解决方法

《在Ubuntu上打不开GitHub的完整解决方法》当你满心欢喜打开Ubuntu准备推送代码时,突然发现终端里的gitpush卡成狗,浏览器里的GitHub页面直接变成Whoathere!警告页面... 目录一、那些年我们遇到的"红色惊叹号"二、三大症状快速诊断症状1:浏览器直接无法访问症状2:终端操作异常

Ubuntu向多台主机批量传输文件的流程步骤

《Ubuntu向多台主机批量传输文件的流程步骤》:本文主要介绍在Ubuntu中批量传输文件到多台主机的方法,需确保主机互通、用户名密码统一及端口开放,通过安装sshpass工具,准备包含目标主机信... 目录Ubuntu 向多台主机批量传输文件1.安装 sshpass2.准备主机列表文件3.创建一个批处理脚

Ubuntu如何升级Python版本

《Ubuntu如何升级Python版本》Ubuntu22.04Docker中,安装Python3.11后,使用update-alternatives设置为默认版本,最后用python3-V验证... 目China编程录问题描述前提环境解决方法总结问题描述Ubuntu22.04系统自带python3.10,想升级

Ubuntu 24.04启用root图形登录的操作流程

《Ubuntu24.04启用root图形登录的操作流程》Ubuntu默认禁用root账户的图形与SSH登录,这是为了安全,但在某些场景你可能需要直接用root登录GNOME桌面,本文以Ubuntu2... 目录一、前言二、准备工作三、设置 root 密码四、启用图形界面 root 登录1. 修改 GDM 配

如何在Ubuntu 24.04上部署Zabbix 7.0对服务器进行监控

《如何在Ubuntu24.04上部署Zabbix7.0对服务器进行监控》在Ubuntu24.04上部署Zabbix7.0监控阿里云ECS服务器,需配置MariaDB数据库、开放10050/1005... 目录软硬件信息部署步骤步骤 1:安装并配置mariadb步骤 2:安装Zabbix 7.0 Server

Ubuntu如何分配​​未使用的空间

《Ubuntu如何分配​​未使用的空间》Ubuntu磁盘空间不足,实际未分配空间8.2G因LVM卷组名称格式差异(双破折号误写)导致无法扩展,确认正确卷组名后,使用lvextend和resize2fs... 目录1:原因2:操作3:报错5:解决问题:确认卷组名称​6:再次操作7:验证扩展是否成功8:问题已解

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