原创 linux內核 網絡子系統

1.struct rtnl_link_stats64/獲得網卡的狀態,比如收到的數據包個數,錯誤個數嗎,丟包個數等/ /* The main device statistics structure */ struct rtnl_link_

原创 gdb調試coredump信息

開啓生成codedump文件的命令 ulimit -c unlimited:當程序crash之後獲得core文件 永久生效辦法: vi /etc/profile 然後,在profile中添加: ulimit -c 107374

原创 linux workqueue 工作隊列

[http://www.cnblogs.com/wwang/archive/2010/10/27/1862202.html

原创 linux環境命令行配置ip以及代理

使用dhcp服務獲取IP dhclient network_card_name ubuntu auto eth0 iface eth0 inet dhcp 重啓網絡服務 sudo /etc/init.d/networking re

原创 rpm包製作rpmbuild

rpm常用命令 rpm -ivh:安裝 rpm -e:卸載 rpm -q:查詢 rpmbuild使用 spec文件語法 %postun: %preun: 安裝rpm包spec語法 %pre -> %install -> %pos

原创 linux中通過proc獲取進程名以及PID

背景 給定某個線程的線程號tid,獲取對應的進程名 解決 剛開始以爲有難度,需要遍歷整個proc/***以及/proc/***/task/***;因爲拿到的是tid而非pid,該tid是由某個pid通過pthread_create或

原创 最近知識點

最近看到幾個不常見的編程技巧: linux下的線程局部存儲:http://blog.sina.com.cn/s/blog_5ea88c70010193is.html 互斥無鎖隊列:https://www.ibm.com/develop

原创 stream 內存帶寬測試工具

一個比較好的測試工具總結網站 http://hpctest.cs.tsinghua.edu.cn/programs.html stream測試內存帶寬的原理 原理很簡單:這裏排除編程上的技巧(openmp並行編程;編譯時使用-fop

原创 kernel中通過地址獲取函數名以及偏移量

sprint_symbol:通過函數地址獲取函數名字的API kallsyms_lookup:sprint_symbol底層使用的接口即爲該函數 獲取內核中調用棧:walk_stack_frame 參考 https://blog.cs

原创 disk-io

http://linuxperf.com/?p=161 1 目錄 1. BLOCK相關 1 1.1 對標vtune針對Disk I/O採樣的事件 2 1.2 相關採樣事件解釋 2 1.2.1 block_bio

原创 編程風格

http://zh-google-styleguide.readthedocs.io/en/latest/contents/

原创 scp : Host key verification failed

scp : Host key verification failed @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: REMOTE HO

原创 linux下多線程編程pthread 同步 互斥

前言 linux下關於並行編程有兩種實現方式:fork和pthread_create;其實內核中的執行路徑是相同的,只是flags不一樣罷了。本文的主題是關於pthread_create多線程編程中想要注意的一些知識點。 提多線程編程

原创 grpc 源碼安裝

不說了,由於各種內網環境問題,無法正常翻牆,因此不能正常git clone github,所以在編譯時遇到各種奇怪問題,特此記錄。但是不得不說,只要環境沒問題,google大人提供的源碼以及源碼包編譯完全只需要幾條簡單的命令。 先說一下

原创 Linux下系統調用的hook機制

Linux下系統調用的hook機制 [http://blog.csdn.net/sdulibh/article/details/42078681] http://0pointer.de/blog/projects/mutrace.htm