1 Star 0 Fork 4

lamdota/perf

forked from maygeek/perf 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
uss.sh 1.67 KB
一键复制 编辑 原始数据 按行查看 历史
maygeek 提交于 2020-10-16 11:12 . update info
#!/bin/bash
#
# xargs usage
#pidof DaemonExe |xargs -i cat /proc/{}/statm
cmd=`pidof RTDaemonExe`
echo "pidof RTDaemonExe $cmd"
echo "pidof DaemonExe `pidof DaemonExe`"
page_size=`getconf PAGESIZE` #4096
memory=`free -m | grep Mem`
read total used buffers cached <<< `echo "$memory" |awk '{print $2,$3,$6,$7}'`
echo "total:$total used:$used buffers:$buffers cached:$cached"
rss=`cat /proc/$(pidof DaemonExe)/status |grep VmRSS|awk '{print $2}'`
#share=`cat /proc/$(pidof DaemonExe)/statm |awk '{print $3}'`
read a b <<< `cat /proc/$(pidof DaemonExe)/statm |awk '{print $2,$3}'`
uss=$(($a-$b))
echo "page_size $page_size rss $rss share $share uss $uss"
while true; do read a b <<< `cat /proc/$(pidof CCSRTDaemonExe)/statm |awk '{print $2,$3}'`;echo "uss $(($a-$b))"; sleep 2; done
#while true; do pidof CCSDaemonExe|xargs -i pmap -x {}| tail -1; sleep 1; done
while true; do pmap -x `pidof CCSDaemonExe`| tail -1; sleep 1; done
## [文件分割](https://www.cnblogs.com/OliverQin/p/10240222.html)
split -b 1000k tmp.log
split -l 10000 tmp.log -d -a 2 row_
split -b 30m CUST_INFO.dat -d -a 2 file_&&ls|grep file_|xargs -n1 -i{} mv {} {}.txt
readelf -s Binary|grep UND|grep -v GLIBC|awk '{print $8}'|sort -n|uniq
for dir in `ls `
do
echo $dir
cd $dir/;git reset HEAD --hard ;cd -
done
if [ -d "Test" ]; then
echo "$dir is a dir"
else
echo "$dir is a file"
fi
if [ $1x == "ab"x ]; then
echo "you had enter ab"
elif [ $1x == "cd"x ]; then
echo "you had enter cd"
else
echo "you had enter unexpected word"
fi
# 前100个占用内存总和
ps -aux | sort -k6nr | head -n 100 | awk '{sum+=$6} END {print sum}'
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/lamdota/perf.git
git@gitee.com:lamdota/perf.git
lamdota
perf
perf
master

搜索帮助