2

このスクリプトをオラクルからテストして、Ubuntu 10.04 でアクティブな NFS クライアントを取得しようとしていますが、実行できません。

それを実現するために、まずこれらの指示に従ってdtrace をインストールしました。これは私が正確にやったことです:

apt-get install bison flex zlib1g-dev libelf-dev binutils-dev libdw-dev libc6-dev-i386
wget ftp://crisp.dyndns-server.com/pub/release/website/dtrace/dtrace-20121009.tar.bz2
tar xfj dtrace-20121009.tar.bz2
cd dtrace-20121009
make all
make install
make load

ただし、コンパイル時に次の警告が表示されます。

=================================================================
=== You need /usr/lib/libdwarf.a and /usr/lib/libbfd.a installed to build.
=== 
=== apt-get install binutils-dev
=== apt-get install libdw-dev
=== 
=== Without these, we will not build ctfconvert (needed for 
=== SDT structure definitions).
=================================================================
cd cmd/instr ; make --no-print-directory
cd usdt/c ; make --no-print-directory
tools/mkdriver.pl all
Executing: /usr/src/dtrace/dtrace-20121009/tools/make-me
make -C /lib/modules/2.6.38-16-server/build M=/usr/src/dtrace/dtrace-20121009/build-2.6.38-16-server/driver
  CC [M]  /usr/src/dtrace/dtrace-20121009/build-2.6.38-16-server/driver/systrace.o
  LD [M]  /usr/src/dtrace/dtrace-20121009/build-2.6.38-16-server/driver/dtracedrv.o
  Building modules, stage 2.
  MODPOST 1 modules
  LD [M]  /usr/src/dtrace/dtrace-20121009/build-2.6.38-16-server/driver/dtracedrv.ko
tools/mkctf.sh
build/ctfconvert not available - so not building the linux.ctf file
NOTE: The build is complete, but build/ctfconvert is not available.
      This means you will get run time errors from the io.d and sched.d files
      due to undefined kernel structure definitions. Simply delete or rename
      these files until a fix can be put in place to handle older
      distros which do not have the required libdwarf dependencies.

      (Typical error is references to undefined struct definitions such
      as dtrace_cpu_t).

sync

と をインストールlibdw-devしましbinutils-devたが、makefile を見ると、 を探しているようで、libdwarf.solibdwのシステムでは という名前になっていlibdw.soます。

これを回避するために、でシンボリックリンクを作成しln -s /usr/lib/libdw.so /usr/lib/libdwarf.soます。その後、コンパイルは失敗します。

cd cmd/ctfconvert ; make --no-print-directory
gcc -g -I. -I../../ -I../../libctf -I../../common -I../../uts/common -I../../linux -I/usr/include/libdwarf -c dwarf.c
In file included from dwarf.c:94:
/usr/include/dwarf.h:56: error: expected identifier before numeric constant
/usr/include/dwarf.h:136: error: expected identifier before numeric constant
/usr/include/dwarf.h:321: error: expected identifier before numeric constant
/usr/include/dwarf.h:461: error: expected identifier before numeric constant
/usr/include/dwarf.h:517: error: expected identifier before numeric constant
make[3]: *** [../../build/ctfconvert.obj/dwarf.o] Error 1
make[2]: *** [all] Error 2
make[1]: *** [do_cmds] Error 2
tools/bug.sh
make: *** [all] Error 1

では、元に戻しましょう。シンボリックリンクを削除し、再度コンパイルして実行make installmake load、すべてがうまくいくことを願っています。そして、すべてがうまくいくようです。

しかし、その後、上記のスクリプトを実行しようとすると失敗します。

# ./get_ngs_clients.d 
dtrace: failed to compile script ./get_ngs_clients.d: Preprocessor not found

何が起こっているのかわかりません。念のため、gccをインストールしました。

# dpkg -l | grep gcc
ii  gcc                                    4:4.4.3-1ubuntu1                  The GNU C compiler
ii  gcc-4.4                                4.4.3-4ubuntu5.1                  The GNU C compiler
ii  gcc-4.4-base                           4.4.3-4ubuntu5.1                  The GNU Compiler Collection (base package)
ii  gcc-4.4-multilib                       4.4.3-4ubuntu5.1                  The GNU C compiler (multilib files)
ii  gcc-multilib                           4:4.4.3-1ubuntu1                  The GNU C compiler (multilib files)
ii  lib32gcc1                              1:4.4.3-4ubuntu5.1                GCC support library (32 bit Version)
ii  libgcc1                                1:4.4.3-4ubuntu5.1                GCC support library
4

2 に答える 2

1

If you do not have libdwarf.a on your system, the ctfconvert tool will not build. (libdwarf.a and libdw.a are not the same).

If ctfconvert does not build, then any of your own, or the dtrace etc/*.d scripts may not load. (Dtrace force loads these scripts for you automatically, which is annoying). Any script which relies on structure definitions will then fail.

As of May 2013, I am looking at seeing what it takes to update to libdw.a since this seems to be the modern replacement for libdwarf.

(posted by the 'author' of DTrace/Linux).

于 2013-05-05T11:03:09.137 に答える
0

--enable-dtrace=false を /.configure に追加しようとしましたか? それとも --with-dtrace=false でしょうか?

それは私が思うトリックをするはずです...

于 2013-04-19T02:29:32.810 に答える