共 19 篇文章 |
|
/bin/bash# 获取当前脚本的进程IDscript_pid=$$echo ''''''''当前脚本的进程ID为: $script_pid''''''''# 可以使用$script_pid进行其他处理,例如输出到日志文件、构建唯一文件名等等log_file=''''''''/var/log/mylog_$script_pid.log'... 阅3 转0 评0 公众公开 24-01-19 15:21 |
Linux ELF二进制文件解析及实战。ELF目标文件的类型;程序头表中各个段用Elf32_Phdr或Elf64_Phdr结构体表示,定义在include/uapi/linux/elf.h中,分为32位和64位两种版本,分别为Elf32_Phdr和Elf64_Phdr,内容如下:GNU-stack [ 1ed] .rela.debug_aranges [ 201] .rela.debug_info [ 212] .debug_abbrev [ 220] .rela.debug_line [ 231] .rela.... 阅301 转0 评0 公众公开 23-11-19 10:21 |
其次,使用dlopen打开的so并不是在进程启动时候加载映射的,而是当进程运行到调用dlopen代码地方才加载该so,也就是说,如果每个进程显示链接a.so;但是如果发布该程序时候忘记附带发布该a.so,程序仍然能够正常启动,甚至如果运行逻辑没有触发运行到调用dlopen函数代码地方。[stevenrao]$ g++ -o demo /tmp/libtmp.so main.cpp。像前面提到的 -... 阅25 转0 评0 公众公开 23-11-09 08:13 |
3.1 用户态时间统计//file:kernel/sched/cputime.cvoid account_user_time(struct task_struct *p, u64 cputime){ //分两种种情况统计用户态 CPU 的使用情况 int index; index = (task_nice(p) > 0) ? CPUTIME_NICE : CPUTIME_USER;//file:kernel/sched/cputime.cstatic inline void task_group_account_field(struct task_struct *p, int i... 阅373 转0 评0 公众公开 23-04-19 12:36 |
3.1 用户态时间统计//file:kernel/sched/cputime.cvoid account_user_time(struct task_struct *p, u64 cputime){ //分两种种情况统计用户态 CPU 的使用情况 int index; index = (task_nice(p) > 0) ? CPUTIME_NICE : CPUTIME_USER;//file:kernel/sched/cputime.cstatic inline void task_group_account_field(struct task_struct *p, int i... 阅36 转0 评0 公众公开 23-02-27 10:33 |
3.1 用户态时间统计//file:kernel/sched/cputime.cvoid account_user_time(struct task_struct *p, u64 cputime){ //分两种种情况统计用户态 CPU 的使用情况 int index; index = (task_nice(p) > 0) ? CPUTIME_NICE : CPUTIME_USER;//file:kernel/sched/cputime.cstatic inline void task_group_account_field(struct task_struct *p, int i... 阅14 转0 评0 公众公开 23-02-27 09:41 |
Linux性能工具有哪些?网络性能工具性能工具谱图。接下来,我就从 CPU、内存、磁盘 I/O 以及网络等几个角度,梳理这些常见的 Linux 性能工具。首先,从 CPU 的角度来说,主要的性能指标就是 CPU 的使用率、上下文切换以及 CPU Cache 的命中率等。同 CPU 性能工具一样,这儿我也帮你梳理了,常见工具的特点和注意事项。同 CPU 和内存性能工具一... 阅3 转0 评0 公众公开 23-01-15 22:17 |
[root@server1 ~]# firewall-cmd --permanent --direct --add-rule ipv4 filter INPUT 0 -p tcp --dport 8081 -j ACCEPTsuccess[root@server1 ~]# firewall-cmd --reloadsuccess要列出当前区域中的Direct规则,请运行:[root@server1 ~]# firewall-cmd --direct --get-all-rules ipv4 filter INPUT 0 -p tcp --dport 8080 -j ACCEPTipv4 filter... 阅400 转0 评0 公众公开 22-05-23 08:00 |
1、将文件checkout到本地目录命令:svn checkout path(path是服务器上的目录)例如:svn checkout svn://192.168.1.1/pro/domain简写:svn co.3、将改动提交至版本库命令:svn commit -m ''''''''log message''''''''例如:svn commit -m ''''''... 阅13 转0 评0 公众公开 22-01-29 09:45 |
捋清楚这个关系之后就知道怎么去拿参数了,直接去中断栈帧中获取用户栈栈顶值 ,再根据参数返回地址的位置关系获取一个个参数,来看 中有关获取参数的几个函数:int argint(int n, int *ip) //获取系统调用的第n个int型的参数,存到ip这个位置{ return fetchint((myproc()->tf->esp) + 4 + 4*n, ip); //原栈中获取n个int型参数,加4... 阅67 转0 评0 公众公开 21-09-26 09:58 |