
LINUX
文章平均质量分 61
shenhuxi_yu
记录职业生涯
展开
-
linux kworker
aarch32 linux4.14最近遇到一个kworker问题,callstack如下,线程adas的陷入kernel space后会schedule_work调用一个while(1)的worker,kill adas后重新启动adas后adas线程会在调用dma_alloc_coherent的时候block住以前的经验一直kworker为轻量的线程和可睡眠的中断下半部,对kwor...原创 2020-01-29 23:00:16 · 5982 阅读 · 0 评论 -
awk与shell传递参数
awk与shell传递变量原创 2023-12-08 16:33:25 · 628 阅读 · 0 评论 -
uprobe trace多线程mutex等待耗时
使用uprobe来trace多线程主程序等待在mutex上的耗时原创 2023-08-11 17:18:03 · 314 阅读 · 0 评论 -
ubuntu限制syslog文件大小
限制syslog文件大小翻译 2023-06-20 11:46:51 · 2807 阅读 · 0 评论 -
linux 配置物理内存
arm32 linux物理内存配置原创 2023-05-11 00:22:33 · 943 阅读 · 1 评论 -
linux nfs 配置
linux 板子通过nfs与ubuntu1804虚拟机传输文件原创 2023-02-23 22:28:07 · 591 阅读 · 0 评论 -
linux Console输入输出
uart console原创 2023-02-17 21:26:26 · 3022 阅读 · 0 评论 -
ARM 异常返回地址
armv7与armv8异常返回地址的correction原创 2022-12-14 01:33:06 · 676 阅读 · 0 评论 -
linux elf 格式详解
linux elf格式与程序的链接和加载过程原创 2022-09-02 23:06:56 · 2215 阅读 · 0 评论 -
armv7 tlb 概述
armv7上下文切换的tlb flush的时候为了减少开销,tlb 会有延迟刷新 lru 替换策略原创 2022-03-16 00:59:47 · 734 阅读 · 0 评论 -
交叉编译aarch64 strace
https://download.youkuaiyun.com/download/shenhuxi_yu/75552450http://资源链接1. ./bootstrap2. sudo apt-get install gcc-4.9-aarch64-linux-gnu3. sudo apt-get install g++-4.9-aarch64-linux-gnu4. ./configure CC=aarch64-linux-gnu-gcc-4.9 --target=aarch64-linux-gnu --ho原创 2022-01-12 19:27:50 · 365 阅读 · 0 评论 -
linux mem overcommit
linux overcommit 机制会欺骗进程,承诺分配给他的内存空间,只有当这些page被真正touch到的时候才通过缺页机制拿到真正的物理内存。以下摘自kernel docThe Linux kernel supports the following overcommit handling modes0 - Heuristic overcommit handling. Obvious overcommits of address space are refused. Used fo.原创 2021-11-03 10:17:12 · 269 阅读 · 0 评论 -
libc 获取文件/文件夹/存储设备 size
libc获取文件大小用stat系统调用即可strcut statst_size代表文件sizest_mode文件类型与文件权限#include <sys/stat.h>DESCRIPTIONThe <sys/stat.h> header shall define the structure of the data returned by the functions fstat(), lstat(), and stat().The stat structu.原创 2021-11-01 20:29:16 · 516 阅读 · 0 评论 -
repo sync后discard commit找回
repo sync -c拉的代码没有创建branch, git push的时候无法push所以repo sync .了一下,commit 被丢弃了从网上查找到方法git refloggit reflog 是存储在本地的一份你所有HEAD(不同branch)操作序列。与git log区别,git log则是你当前branch的提交历史b1693cd HEAD@{0}: commit: ver 7 fix eeprom access errora2c0663 HEAD@{1}: comm原创 2021-11-01 16:01:11 · 1332 阅读 · 0 评论 -
protobuf 文档
c++ protobuf 使用教程protocol-buffers c++ tutorialhttps://developers.google.com/protocol-buffers/docs/cpptutorialc++ protoc编译器安装protoc installProtocol Buffers - Google's data interchange format - protobuf/README.md at master · protocolbuffers/protobufhttps://g原创 2021-10-27 22:16:40 · 383 阅读 · 0 评论 -
linux uart hw flowcontrl
aarch32 linux4.19基本处理流程如下cts的状态改变的中断使能,发生cts assert,uart中断更新uart port的状态位hw_stoppped 且停止发送,cts状态转变位deassert时状态恢复重新开始发送cts assert 底层停止发送的方式是关闭TXfifo empty中断(the TxFIFO Empty interrupt to alert the software to fill-up the TxFIFO again),uart port 停止发送,s原创 2021-04-17 15:42:24 · 615 阅读 · 0 评论 -
find 删除某个文件之外的文件
find /tmp/ -path "/tmp/mm/tt" -prune -o -type f -print -exec rm {} \;BusyBox v1.29.0.git (2018-09-29 12:01:19 CST) multi-call binary.Usage: find [-HL] [PATH]... [OPTIONS] [ACTIONS]Search for files and perform actions on them.First failed action ..原创 2021-01-08 11:01:40 · 521 阅读 · 0 评论 -
arm linux iperf 局域网测速
aarch32 linux 4.14iperf 百科描述: Iperf 是一个网络性能测试工具。Iperf可以测试最大TCP和UDP带宽性能,具有多种参数和UDP特性,可以根据需要调整,可以报告带宽、延迟抖动和数据包丢失服务端启动服务,作为server:sudo apt-get install iperfiperf -s -i 2每两秒间隔输出测试结果客户端启动服务,作为client:获取iperf source code https://sourceforge.net/project原创 2020-12-24 11:14:38 · 1010 阅读 · 0 评论 -
ulimit 命令使用说明
ulimits areper-process, not per-user nor per-system.Theulimitcommand is built into the shell, so it remains within the same process; however, the adjusted limit only affectsthatprocess, as well as everything you run from it (child processes inherit ...原创 2020-12-18 15:34:41 · 2917 阅读 · 0 评论 -
linux meminfo cache计算方式
aarch32 linux4.14static int meminfo_proc_show(struct seq_file *m, void *v) { struct sysinfo i;...... si_meminfo(&i); si_swapinfo(&i); cached = global_node_page_state(NR_FILE_PAGES) - total_swapcache_pages() - i.buf原创 2020-12-09 20:09:44 · 3501 阅读 · 0 评论 -
linux procps free mem计算与oom free mem计算
aarch32 linux 4.14 busybox-1.30经常使用free查看mem信息类似如下打印free 49 total used free shared buffers cachedMem: 239 189 49 0 0 65-/+ buffers/cache: 124 115...原创 2020-12-04 11:24:08 · 796 阅读 · 0 评论 -
linux /proc/sys/vm 参数说明
摘自 kernel Document 方便查阅This file contains the documentation for the sysctl files in/proc/sys/vm and is valid for Linux kernel version 2.6.29.The files in this directory can be used to tune the operationof the virtual memory (VM) subsystem of the Linu原创 2020-11-27 11:31:47 · 1438 阅读 · 0 评论 -
linux task mem rss 解释
RSS is the Resident Set Size and is used to show how much memory is allocated to that process and is in RAM. It does not include memory that is swapped out. It does include memory from shared libraries as long as the pages from those libraries are actually原创 2020-11-23 11:36:13 · 1083 阅读 · 0 评论 -
交叉编译wpa-supplicant
https://blog.youkuaiyun.com/fangye945a/article/details/86658621http://distfiles.macports.org/openssl/http://www.infradead.org/~tgr/libnl/原创 2020-10-27 19:46:00 · 227 阅读 · 0 评论 -
交叉编译procps
板子原本系统软件,top命令来自busybox 内部自带的procps,不支持显示进程优先级开源的procps-ng源码交叉编译可以得到功能较丰富的top命令,(以top命令举例,还有ps pmap vmstat watch等命令)procps 依赖ncurses 库,交叉编译ncurses-6.0 source code./configure --prefix=/home/faun/backup/ncurses-6.0 --host=arm-linux-gnueabihf --...原创 2020-09-27 15:45:59 · 3018 阅读 · 0 评论 -
linux 内存回收机制
linux 4.9 aarch32page_cache 会占用一些内存缓存外存中的文件以达到文件访问的效率,但当内存紧张的时候page_cache会被释放以提供物理内存swap 会利用外存空间将部分内存置换出去达到内存的利用效率drop_cachesWriting to this will cause the kernel to drop clean caches, as well asreclaimable slab objects like dentries and inodes.原创 2020-09-08 00:28:28 · 1400 阅读 · 0 评论 -
linux /etc/mdev.conf配置详解
mdev是busybox下的udev的精简版,适合在嵌入式系统下管理设备但mdev会把所有的设备文件都动态地创建在/dev/目录下,如果程序使用dev目录子目录下的设备,就必须修改程序,比较麻烦,当然也可以在mdev运行之后,手工创建子目录,然后再用 ln -s 做设备文件的软链接这里有人作出了更好的脚本处理机制:http://lists.busybox.net/pipermail/busybox/2007-May/027309.html再贴上mdev的使用说明------------转载 2020-06-18 14:11:32 · 3341 阅读 · 0 评论 -
vimrc
share下自己在用的比较基本的vimrcshift * 快速查找=号自动缩进空格代码折叠打开" example for a vimrc file."" Maintainer: Bram Moolenaar <>" Last change: 2002 May 28"" To use it, copy it to" for Unix and OS/2: ~/.vimrc" for Amiga: s:.vimrc" for原创 2020-05-28 17:47:43 · 324 阅读 · 0 评论 -
jtag dump内存数据
aarch32 linux4.14 zynq-7000系统概率死机重启,关掉watchdog后,系统hang住,串口没打印任何异常log,且串口无法输入判断系统状态,camera中断中添加blink led操作,死机的时候中断无法操作,一般情况软件的crash,串口总会有些log打印的,很奇怪这个死机没有串口log打印出来,推测在中断中遇到BUG_ON或者crash,或者硬件导致(bus ...原创 2020-04-27 00:53:49 · 1571 阅读 · 0 评论 -
arm linux 生成火焰图
aarch32 arm-linux-gnueabihf-gcc linux4.9perf 工具 linux/tools/perf ./build.shperf 采集栈信息的linux支持CONFIG_PERF_EVENTS=yCONFIG_HW_PERF_EVENTS=y采集命令./perf record -F [sample freq]-p [pid]-g -- sle...原创 2020-04-01 17:58:27 · 1192 阅读 · 0 评论 -
gdb debug 技巧
main程序挂掉,没有积极的log打印出来上gdb的时候因为程序的形式不太方便用gdbstart.shexport LD_LIBRARY_PATH+***:****./test.bin --config test_cfg.txtstart.shexport LD_LIBRARY_PATH+***:****gdb ./test.bin sudo ./start.shr ...原创 2020-03-24 21:41:36 · 273 阅读 · 1 评论 -
gdb 调试core dump
1、什么是coredump:我们经常听到大家说到程序core掉了,需要定位解决,这里说的大部分是指对应程序由于各种异常或者bug导致在运行过程中异常退出或者中止,并且在满足一定条件下会产生一个叫做core的文件。通常情况下,core文件会包含了程序运行时的内存,寄存器状态,堆栈指针,内存管理信息还有各种函数调用堆栈信息等,我们可以理解为是程序工作当前状态存储生成的一个文件,许多...转载 2020-03-24 19:36:25 · 420 阅读 · 0 评论 -
gdb 内存操作
使用gdb调试程序,读写操作是很普遍的事情。其中,读操作包括:读取某个变量的值 读取某个内存地址里的内容 读取某个寄存器的值对应地,写操作包括:修改某个变量的值 修改某个内存地址里的内容 修改某个寄存器的值本文将首先简单介绍一下读操作,然后重点介绍一下写操作。1. 读操作读取某个变量的值:p <var> 读取某个内存地址里的内容:x /NFU <...转载 2020-03-23 11:29:46 · 5495 阅读 · 0 评论 -
gdb交叉编译与编译参数说明
下载can-utils源码后手动编译的步骤./configure CC=arm-linux-gnueabihf-gcc --target=arm-linux --host=arm-linuxbuild:执行代码编译的主机,自己的主机系统ubuntu会是x86_64-pc-linux-gnu。如果不做配置一般由config.guess来猜就可以。host:编译出来的二进制程序所执行的主机...原创 2020-01-14 16:43:18 · 1027 阅读 · 0 评论 -
linux socket can code flow
read(socket_fd)[ 809.672693] [<c0648c64>] (__skb_wait_for_more_packets) from [<c0649d0c>] (__skb_recv_datagram+0x8c/0xa0)[ 809.672714] [<c0649d0c>] (__skb_recv_datagram) from [&...原创 2021-04-26 11:47:20 · 873 阅读 · 0 评论 -
网络拥塞控制介绍
原理介绍Linux操作系统中的流量控制器TC(Traffic Control)用于Linux内核的流量控制,它利用队列规定建立处理数据包的队列,并定义队列中的数据包被发送的方式, 从而实现对流量的控制。TC模块实现流量控制功能使用的队列规定分为两类,一类是无类队列规定, 另一类是分类队列规定。 无类队列规定相对简单,而分类队列规定则引出了分类和过滤器等概念,使其流量控制功能增强。无类队...转载 2019-12-11 20:22:11 · 1172 阅读 · 0 评论 -
insmod ko invalid module format [unknown relocation]
linux版本4.14 aarch32用如下出错版本的Makefile编译basic.ko,insmod ko到kernel后提示invalid module format, dmesg查看内核打印信息 basic: unknown relocation: 10出错的版本obj-m := basic.oARCH := arm CROSS_COMPILE := arm-linux-g...原创 2019-12-05 12:11:21 · 1437 阅读 · 0 评论 -
kernel gpio userspace 使用
kernel gpio userspace 使用kernel gpio userspace sysfspoll gpiofd 配合gpio 中断monitor gpio状态合理的创建标题,有助于目录的生成如何改变文本的样式插入链接与图片如何插入一段漂亮的代码片生成一个适合你的列表创建一个表格设定内容居中、居左、居右SmartyPants创建一个自定义列表如何创建一个注脚注释也是必不可少的KaTeX...原创 2019-11-05 23:59:47 · 431 阅读 · 0 评论 -
ubuntu 无法显示任务栏菜单栏
问题某次开机后直接弹出上报问题界面,重启后无法显示菜单与任务栏,找不到gnome-terminal,尝试用xterm连接wifi失败,重启后wifi自动连接成功但是xterm又没了解决方法用另外一台windows 用xshell登录ubunt安装gnome-terminal sudo apt-get install gnome-terminal之后按照如下方法修复后,重启解决了问题你...转载 2019-10-13 23:37:05 · 1029 阅读 · 0 评论 -
linux paltform驱动中的to_platform_device
to_platform_device转载 2017-07-07 17:32:02 · 2547 阅读 · 0 评论