RHEL中基於OS來統計某程式使用的IO;
semantic error: no match while resolving probe point vfs.read.return semantic error: no match while resolving probe point kernel.function("vfs_write").return semantic error: no match while resolving probe point vfs.write.return Pass 2: analysis failed. Try again with another '--vp 01' option 出現這個錯誤是因為沒有安裝kernel_debuginfo包; 找到KERNEL相關的包: kernel-debuginfo-`uname -r`.x86_64.rpm kernel-debuginfo-common-`uname -r`.x86_64.rpm
附上 stap檔案
=====================
######disk io
#!/usr/bin/env stap
#
# Copyright (C) 2007 Oracle Corp.
#
# Get the status of reading/writing disk every 5 seconds,
# output top ten entries
#
# This is free software,GNU General Public License (GPL);
# either version 2, or (at your option) any later version.
#
# Usage:
# ./disktop.stp
#
global io_stat,device,io_stat1,device1
global read_bytes,write_bytes,read_bytes1,write_bytes1
probe vfs.read.return {
if ($return>0) {
if (devname!="N/A") {/*skip read from cache*/
io_stat[pid(),execname(),uid(),ppid(),"R"] += $return
device[pid(),execname(),uid(),ppid(),"R"] = devname
read_bytes += $return
if (devname == "N/A"){
io_stat1[pid(),execname(),uid(),ppid(),"R"] += $return
device1[pid(),execname(),uid(),ppid(),"R"] = devname
read_bytes1 += $return
}
}
}
}
probe vfs.write.return {
if ($return>0) {
if (devname!="N/A") { /*skip update cache*/
io_stat[pid(),execname(),uid(),ppid(),"W"] += $return
device[pid(),execname(),uid(),ppid(),"W"] = devname
write_bytes += $return
}
if (devname=="N/A") {
io_stat1[pid(),execname(),uid(),ppid(),"w"] += $return
device1[pid(),execname(),uid(),ppid(),"w"] = devname
write_bytes1 += $return
}
}
}
probe timer.ms(5000) {
/* skip non-read/write disk */
if (read_bytes+write_bytes) {
printf("n%-25s, %-8s%4dKb/sec, %-7s%6dKb, %-7s%6dKbnn",ctime(gettimeofday_s()),"Raw Average:", ((read_bytes+write_bytes)/1024)/5,"Raw Read:",read_bytes/1024,"Raw Write:",write_bytes/1024)
printf("%8s %8s %8s %25s %8s %4s %12sn","UID","PID","PPID","CMD","DEVICE","T","BYTES")
foreach ([process,cmd,userid,parent,action] in io_stat- limit 10)
printf("%8d %8d %8d %25s %8s %4s %12dn",userid,process,parent,cmd,device[process,cmd,userid,parent,action],action,io_stat[process,cmd,userid,parent,action])
delete io_stat
delete device
read_bytes = 0
write_bytes = 0
}
if (read_bytes1+write_bytes1){
printf("n%-25s, %-8s%4dKb/sec, %-7s%6dKb, %-7s%6dKbnn",ctime(gettimeofday_s()),"Cach Average:", ((read_bytes+write_bytes)/1024)/5,"Cach Read:",read_bytes1/1024,"Cach Write:",write_bytes1/1024)
printf("%8s %8s %8s %25s %8s %4s %12sn","UID","PID","PPID","CMD","DEVICE","T","BYTES")
foreach ([process,cmd,userid,parent,action] in io_stat1- limit 10)
printf("%8d %8d %8d %25s %8s %4s %12dn",userid,process,parent,cmd,device1[process,cmd,userid,parent,action],action,io_stat1[process,cmd,userid,parent,action])
delete io_stat1
delete device1
read_bytes1 = 0
write_bytes1 = 0
}
printf("n-------------------------------------------------------------------------------------------------n")
}
probe end{
delete io_stat
delete device
delete read_bytes
delete write_bytes
delete io_stat1
delete device1
delete read_bytes1
delete write_bytes1
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/703656/viewspace-1056508/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Redox OS:基於Rust的作業系統Rust作業系統
- IO裝置在OS中的權衡
- 某個OA系統的程式碼審計
- golang中基於kevent的IO多路複用實踐Golang
- 基於linux原生非同步io建立的簡易聊天程式Linux非同步
- 基於java jsp的某企業員工管理系統JavaJS
- Linux系統程式設計-檔案IOLinux程式設計
- 【python基礎】os模組的使用Python
- Linux中檔案/檔案系統的壓縮、打包和備份總結(基於rhel7)Linux
- 關於socket.io的使用
- 基於中臺思想的物流系統設計(一)
- Java程式設計基礎23——IO(其他流)&PropertiesJava程式設計
- Linux系統程式設計之檔案IOLinux程式設計
- 【OS】5種網路IO模型模型
- Python基礎之:Python中的IOPython
- 基於UDP程式設計UDP程式設計
- Java程式設計基礎20——異常&IO(File類)Java程式設計
- 【網路程式設計】阻塞IO程式設計的坑程式設計
- LKCOS:基於程式移植的COS系統
- 基於Jacoco的單元測試程式碼覆蓋率統計
- 基於使用者的協同過濾來構建推薦系統
- 我的第一個基於HarmonyOS的 (鴻蒙 OS)TV鴻蒙
- Go 中 io 包的使用方法Go
- 談談基於機器學習的程式設計到底比傳統程式設計強在哪裡?機器學習程式設計
- 檔案IO中基礎操作
- Oracle統計某個使用者下所有表的各自行數Oracle
- t-io網路程式設計基礎知識介紹程式設計
- 關於JAVA中順序IO的基本操作Java
- 基於MVVM結構和Kotlin,使用Android Jetpack元件的gank.io的客戶端MVVMKotlinAndroidJetpack元件客戶端
- iOS中基於協議的路由設計iOS協議路由
- 香橙派將推 Orange Pi OS 系統,基於開源鴻蒙 OpenHarmony 打造鴻蒙
- 基於MCU的系統從面向使用者的設計角度獲益
- 非同步程式設計:基於事件的非同步程式設計模式(EAP)非同步程式設計事件設計模式
- 深圳IO:Shenzhen IO for Mac(燒腦程式設計遊戲)Mac程式設計遊戲
- Wizzdi :基於 Spring Boot 的無程式碼系統Spring Boot
- 基於Python的自動化程式碼審計Python
- 程式設計中快取的使用程式設計快取
- 基於電商中臺架構-商品系統設計(一)架構
- [譯] JavaScript 中的 CSS:基於元件的樣式的未來JavaScriptCSS元件