(toppers-users 3936) Re: TOPPERS/FMPカーネルのトレースログの取得

Shinya Honda honda @ ertl.jp
2012年 3月 1日 (木) 22:58:53 JST


葛坂さん

本田です.

(2012/03/01 16:53), masato.kuzusaka.bh @ hitachi.com wrote:
> (1)Makefile
>  ENABLE_TRACE = trueにするとmake時にエラーが出ます。
>  対処方法を教えてください。
> 
> ../arch/logtrace/trace_config.c: In function 'trace_initialize':
> ../arch/logtrace/trace_config.c:74:2: warning: implicit declaration of function
> '_kernel_scu_counter_init' [-Wimplicit-function-declaration]
> ../arch/logtrace/trace_config.c: In function 'trace_wri_log':
> ../arch/logtrace/trace_config.c:109:3: warning: implicit declaration of function
>   'scu_counter_get_current' [-Wimplicit-function-declaration]
> ../arch/logtrace/trace_config.c:109:21: error: 'CORE_CLK' undeclared (first use
> in this function)
> ../arch/logtrace/trace_config.c:109:21: note: each undeclared identifier is repo
> rted only once for each function it appears in
> make: *** [trace_config.o] Error 1
これはkzm-ca9の不具合です.ARM11ではSCUにカウンタがあり,その値をトレー
スログの取得時のタイムスタンプとして使用していましたが,Cortex-A9にはこ
のカウンタは存在しないので,他の方法でタイムスタンプを取得する必要があり
ます.

精度はmsecになりますが,以下の変更でカーネル内のティックをタイムスタンプ
に使用します.精度を高めたい場合は,フリーランニングタイマ等を用意し
て,TRACE_GET_TIM()マクロで読み込めばよいです.

target/kzm_ca9_gcc/kzm_ca9.h : 154/155行目をコメントアウト

/*
 *  トレースログに関する定義
 *  SCUを用いる.
 */
//#define TRACE_HW_INIT()   scu_counter_init()
//#define TRACE_GET_TIM()   ((scu_counter_get_current() * 1000) / CORE_CLK)


arch/logtrace/trace_config.h : 77行目変更

/*
 *  トレース時刻の取得方法
 */
#ifndef TRACE_GET_TIM
#define TRACE_GET_TIM()		(get_my_current_time())
#endif /* TRACE_GET_TIM */

次のリリースでは何らかの対応をしたいと思います.


> 
> (2)user.txt
>  「11.6x トレースログ記録のサンプルコードの使用方法」にある
>  システムコンフィギュレーションファイルに次のような記述を追加すると
>  ありますが、システムコンフィギュレーションファイルとは
>  sample1.cfgでよいでしょうか。
はい,sample1.cfg で良いです.

以上,よろしくお願いします.