[Suzaku:01005] Re: SUZAKU-Vで実行時間プロファイリング

大川 猛 email@hidden
2007年 8月 7日 (火) 17:16:00 JST


大川猛@産総研です。

どなたか、挑戦される方のために、現在までの状況をお知らせしておきます。


使用している環境は、uClinux-dist-suzaku-v-2.6-at1です。
http://suzaku.atmark-techno.com/files/downloads/suzaku/misc/uClinux-dist-suzaku-v-2.6-at1.tar.gz

まず、カーネルのコンフィギュレーション(make menuconfig)で、
 Profiling support >Profiling support (EXPERIMENTAL)および OProfile system profiling (EXPERIMENTAL) 
をチェックしました。
これでビルドしたカーネルを使っています。(Experimentalなので、ちょっと疑わしい?ですが)

使用しているのは、最新版のoprofile-0.9.3.tar.gzです。
まずクロスコンパイルをしなくてはいけません。coLinux(2.6.10-co-0.6.2)上でビルドしています。GCCのバージョンは3.3.5です。

configureスクリプトのオプションは、このメールの後半にしめします。
できあがったコードを動かしてみると、"Illegal Instruction"とのエラーが出て止まってしまいます。
(oprofiledは、oprofileのデーモンです)

# ./oprofiled
Illegal instruction

ちょっと調べてみたら、oprofileがこのエラーを表示しているのではなく、
"Illegal Instruction"の割り込みが発生してbusyboxのmshがエラーメッセージを表示している様子です。
(busyboxのmshのソースで、エラー文字列を書き換えて確認してみました)

素直に考えると、PPC405には無いインストラクションが実行されてしまっている、という事だと思います。
「-msoft-float -mcpu=405」のオプションがあるので、PPC405で動くはずなのに・・・

また、シェルとしてbashを導入すればもうちょっと情報が得られるかな?と思い、bashも入れてみましたが、得られる情報は同じです。
もうちょっとデータが欲しい(割り込みが起こった時の実行アドレスなど)ところなので、何らかのデバッガを動かしてみるべきでしょうか?
組込み開発の経験が浅いもので、なにかヒントをいただけると幸いです。

**********同僚のkubotaさんからもらったメモ****

oprofile の config & make の設定です。

OS:
email@hidden:~/make/oprofile-0.9.3$ uname -a
Linux colinux 2.6.10-co-0.6.2 #5 Sat Feb 5 10:19:16 IST 2005 i686 GNU/Linux

コンパイラ:
email@hidden:~/make/oprofile-0.9.3$ powerpc-linux-gcc -v
Reading specs from /usr/lib/gcc-lib/powerpc-linux/3.3.5/specs
Configured with: ../src/configure --with-cpu=405 --enable-softfloat -v --enable-languages=c,c++ --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/powerpc-linux/include/c++/3.3 --enable-shared --enable-__cxa_atexit --with-system-zlib --enable-nls --without-included-gettext --enable-clocale=gnu --enable-debug --disable-multilib --includedir=/usr/powerpc-linux/include --build=i386-linux --host=i386-linux --target=powerpc-linux
Thread model: posix
gcc version 3.3.5 (Debian 1:3.3.5-13)

フラグ:
email@hidden:~/make/oprofile-0.9.3$ env | grep 'FLAGS'
LDFLAGS=-static
CXXFLAGS=-msoft-float -mcpu=405
CFLAGS=-msoft-float -mcpu=405

configure オプション:
email@hidden:~/make/oprofile-0.9.3$ head ./config.log
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by configure, which was
generated by GNU Autoconf 2.59.  Invocation command line was

  $ ./configure --with-linux --with-kernel-support --host=powerpc-linux \
	--with-extra-includes=/home/kubota/make/rpm-4.4.6/popt:/home/kubota/make/binutils-2.13.1/bfd:/home/kubota/make/binutils-2.13.1/include \
	--with-extra-libs=/home/kubota/make/rpm-4.4.6/popt/.libs/:/home/kubota/make/binutils-2.13.1/libiberty:/home/kubota/make/binutils-2.13.1/bfd \
	--prefix=/usr/local/powerpc-oprofile
***

大川 猛 (Ohkawa Takeshi)
産業技術総合研究所情報技術研究部門 



suzaku メーリングリストの案内