Loading

随笔分类 -  linux

摘要:为了获取linux 当前的内存状态信息,可以直接使用Linux 提供的系统调用 sysinfo, 但是 sysinfo 获取的信息比较少,只有以下部分内容,其中totalram/ freeram/ sharedram/ bufferram 是一类,需要注意的是这里还缺usedram, usedram 阅读全文
posted @ 2023-01-04 22:56 aalanwyr 阅读(3197) 评论(0) 推荐(0)
摘要:一. 概述 1.1 CPU时间 cpu指标 含义user 用户态时间nice 用户态时间(低优先级,nice>0)system 内核态时间idle 空闲时间iowait I/O等待时间irq 硬中断softirq 软中断iowait时间是不可靠值,理由如下: CPU不会等待I/O执行完成,而iowa 阅读全文
posted @ 2022-12-03 22:47 aalanwyr 阅读(1094) 评论(0) 推荐(0)
摘要:循环打印当前系统的进程状态信息 /* * Copyright (c) 2008, The Android Open Source Project * All rights reserved. * * Redistribution and use in source and binary forms, 阅读全文
posted @ 2022-11-30 23:07 aalanwyr 阅读(119) 评论(0) 推荐(0)
摘要:Overview: top intel-gpu top xesmi(developed) perf top : apt install linux-tools-common perf top PTAT 阅读全文
posted @ 2022-10-08 11:02 aalanwyr 阅读(53) 评论(0) 推荐(0)
摘要:Background: Background: 遇到一个打包可执行程序和链接库生成rpm 包的需求,查遍了很多网站的资料,现在整理下解决方案。 前期参考的是这篇帖子: https://codeantenna.com/a/jUEqRgoEsZ CSDN 很多帖子都是抄的rpm 官方提供的教程:http 阅读全文
posted @ 2022-09-17 15:57 aalanwyr 阅读(1059) 评论(0) 推荐(1)
摘要:1、什么是Buddy System: The buddy memory allocation technique is a memory allocation algorithm that divides memory into partitions to try to satisfy a memo 阅读全文
posted @ 2022-05-19 22:38 aalanwyr 阅读(98) 评论(0) 推荐(0)
摘要:1、什么是Slab 分配器: 以下摘自维基百科:https://en.wikipedia.org/wiki/Slab_allocation Slab firstly introduced in kernel 2.2, it's now one of three memory allocator im 阅读全文
posted @ 2022-05-19 21:34 aalanwyr 阅读(458) 评论(0) 推荐(0)
摘要:最近在学习 《linux Kernel Development》,本书用的linux kernel 是v2.6 版本的。看完”系统调用“一节后,想尝试添加一个系统调用,然后重编一个kernel。经过几个小时的尝试,实现了这个小功能,其中也遇到了不少坑,本文主要是记录分享下如何在Linux Kerne 阅读全文
posted @ 2022-05-15 16:41 aalanwyr 阅读(1573) 评论(0) 推荐(0)
摘要:这篇帖子主要是记录一下自己使用信号量遇到的坑。 首先是需求:创建两个进程A,B。A往buffer中写,B读。两个进程利用命名管道进行通信,并实现读写同步。即A写完后通知B读,B读完后通知A写。 如果A,B两个进程各自独立操作的话,很容易出现下列情况。 看哪个进程先抢占到这个buffer,由于writ 阅读全文
posted @ 2022-02-23 23:41 aalanwyr 阅读(983) 评论(0) 推荐(0)
摘要:起因:之前租了一个腾讯云服务器,每次登录的时候都会弹出一个warning,提示有很多failed login,也就是有很多主机尝试登录你的服务器。 1、查看有哪些主机尝试过登录你的服务器: [root@VM-4-12-centos ~]# lastb | head cirros ssh:notty 阅读全文
posted @ 2021-12-21 11:05 aalanwyr 阅读(981) 评论(0) 推荐(0)

主题色彩
点击右上角即可分享
微信分享提示