查看当前环境变量

echo $PATH

添加临时环境变量

export PATH=/home/neethan/workspace/valgrind/bin:$PATH

添加动态库的查找路径 LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/home/neethan/workspace/valgrind/lib:$LD_LIBRARY_PATH
置之后最好运行一下:ldconfig

源码:
https://www.valgrind.org/downloads/

下载解压,修改configure
armv7) 改成 armv7|arm)
设置交叉编译工具链后,
make && make install

记住—prefix这里的路径要与你在板子上放的路径一样。否则会出现valgrind: failed to start tool ‘memcheck’ for platform ‘arm-linux’: No such file or directory”错误。