摘要:
包含的头文件: #include <dlfcn.h> 使用的函数有以下4个: 1) void * dlopen( const char * pathname, int mode) 参数pathname: 动态库so名称; 参数mode: 打开方式,有以下选项 RTLD_DEEPBIND -- 动态库 阅读全文
摘要:
nload eno1 -u m(nload 网卡名称 -u 单位) 查看网卡吞吐量 watch -n 1 " date;netstat -nalp|grep 7302" sar -n DEV 1 4 查看网卡信息 阅读全文
摘要:
strace -tt -T -v -f -e trace=file -o /data/log/strace.log -s 1024 -p 23489 -tt 在每行输出的前面,显示毫秒级别的时间-T 显示每次系统调用所花费的时间-v 对于某些相关调用,把完整的环境变量,文件stat结构等打出来。-f 阅读全文
摘要:
1、 可以通过objcopy分离符号文件 objcopy --only-keep-debug a.out a.out.sym //拷贝出一个符号表文件 objcopy --strip-debug a.out //删除符号文件 gdb调试的时候添加符号文件命令 symbol-file a.out.sy 阅读全文
摘要:
linux环境执行脚本文件时,如果这个文件是从win环境拷贝过来的,极有可能因为换行符的原因(win是\n\r, 而linux没有\r) 导致脚本执行失败, 所有需要去掉\r, 执行命令 sed -i "s/\r//" filename 就可以 阅读全文
摘要:
std::deque是区别于vector和list的一种有序容器,可以像vector一样高效的取下标,却别于vector, deque可以高效的前插入,自我成长也比vector要高效些。但deque的迭代器操作是没有vector高效的,对deque排序也是异常复杂的,deque的数据结构如下图所示。 阅读全文
摘要:
std::set template <typename Tp> struct Identity_ { const Tp& operator()(const Tp& x) const { return x; } }; template <typename Key, typename Compare = 阅读全文
摘要:
std::map的实现 template <typename Pair> struct Select1st_ { const typename Pair::first_type& operator()(const Pair& x) const { return x.first; } }; templ 阅读全文
摘要:
1、概念: 标准库的std::map、std::mulitmap、std::set、 std::multiset统称为关联式容器,其底层数据结构是基于红黑树实现的。 红黑树作为一种二叉树,满足以下规则: 1)每个节点不是红色就是黑色 2)根节点为黑色 3)如果节点为红色,其子节点必须为黑色 4)任何 阅读全文