openresty测试工具安装失败

98 views
Skip to first unread message

mirac...@gmail.com

unread,
Dec 14, 2016, 12:55:04 AM12/14/16
to openresty
Hello,春哥,我在debian上安装openresty的测试工具遇到些问题
uname -r 显示版本为 3.16.0-4-amd64
perl版本为5.20.2
openresty是源码编译的

下面是我安装测试工具步骤
--------------------我是可爱的分割线---------------------

#!/bin/bash

install_path=/soft
stap_path=/opt/stap
systemtap_version=3.0

#1. install basics - wget git
    apt-get install wget git -y

#2. install systemtap

    #2.1 install dependent
        apt-get install build-essential zlib1g-dev elfutils libdw-dev gettext
    #2.2 install kernel-debuginfo kernel-devel
        apt-get install linux-image-$(uname -r)-dbg
        apt-get install linux-headers-$(uname -r)
    #2.3 install systemtap
        #systemtap版本在2.1以上
        mkdir $install_path
        cd $install_path
        tar -xvf systemtap-$systemtap_version.tar.gz
        cd systemtap-$systemtap_version
        ./configure --prefix=$stap_path --disable-docs --disable-publican --disable-refdocs CFLAGS="-g -O2"
        make && make install
        rm -rf systemtap-$systemtap_version.tar.gz

#3. install openresty-systemtap-toolkit stapxx

    #3.1 utrace
        #如果linux kernels版本低于3.5, 则需打utrace patch
    #3.2 perl
        #perl 要求版本在5.6.1以上

    #3.3 git clone openresty-systemtap-toolkit stapxx
        cd $install_path

#4. install FlameGraph
    cd $install_path

#5. PATH
    new_profile=/etc/profile.d/openresty_toos.sh
    echo "PATH=\$PATH:$stap_path/bin" > $new_profile
    echo "PATH=\$PATH:$install_path/stapxx" >> $new_profile
    echo "PATH=\$PATH:$install_path/FlameGraph" >> $new_profile
    echo "export LC_ALL=C" >> $new_profile
    #source $new_profile

--------------------我是可爱的分割线---------------------

安装过程也没有问题,
但是我用openresty-systemtap-toolkit的第一个指令就出现了问题
./ngx-active-reqs -p 12545
报错如下:

WARNING: Kernel function symbol table missing [man warning::symbols]
WARNING: cannot find module /secone/webapng/nginx/sbin/nginx debuginfo: No DWARF information found [man warning::debuginfo]
semantic error: while processing probe process("/secone/webapng/nginx/sbin/nginx").function("ngx_process_events_and_timers") from: process("/secone/webapng/nginx/sbin/nginx").function("ngx_process_events_and_timers")

semantic error: unable to find global 'ngx_cached_time' in /secone/webapng/nginx/sbin/nginx: operator '@var' at <input>:16:22
        source:         cached_sec = @var("ngx_cached_time")->sec
                                     ^

Pass 2: analysis failed.  [man error::pass2]
Number of similar warning messages suppressed: 327.
Rerun with -v to see them.

请问,
1. 第二个WARNING,提示找不到debuginfo,那安装的linux-image-$(uname -r)-dbg是不是没生效?
2. 下面的semantic error该如何修补?


Miracle

unread,
Dec 14, 2016, 1:39:34 AM12/14/16
to openresty
我按照上面兄弟的方式安装一次,
同样安装过程没有报错,但
./ngx-active-reqs -p xxxx 出现下面的问题

ERROR: module version mismatch (#1 SMP Debian 3.16.36-1+deb8u2 (2016-10-19) vs #1 SMP Debian 3.16.7-ckt25-2 (2016-04-08)), release 3.16.0-4-amd64
WARNING: /opt/stap/bin/staprun exited with status: 1
Pass 5: run failed.  [man error::pass5]

为何apt-get install linux-image-$(uname -r)-dbg得到却是3.16.36和3.16.7版本的?该如何解决嘞?

asf

unread,
Dec 14, 2016, 2:02:12 AM12/14/16
to openresty
哦,明白了
内核名称没变一直是3.16.0-4-amd64,但我的依然是Debian 3.16.7-ckt25-2 (2016-04-08)
只要更新内核就好了
Reply all
Reply to author
Forward
0 new messages