Coder Social home page Coder Social logo

coresight-decoder's Issues

std::exit()の回避

たまにアドレスが0のトレースが含まれることがあり,ライブラリ側で終了されてしまうとトレーサでハンドルできないため,修正をお願いしたいです.
エラーを伝搬できると良さそうなのですが,うまい修正方法が分からずIssueを立てました.

std::exit(1);

逐次的なデコード対応

背景

AFL++ CoreSight modeは現状QEMU modeより少し速い程度でPtrixのように高速とは言えない.ハードウェアによるトレースを利用している利点を生かすためにはさらなる高速化が必要.

gprofでプロファイリングを見るとdeformatTraceData(unsigned char const*, unsigned long, unsigned char)の実行時間が支配的となっている.

機能

Ptrixでは開始時にデコーダスレッドを立ち上げ,実行時にある程度トレースが溜まったらデコーダに通知して逐次的にデコードしてカバレッジのビットマップを更新している.これと同じような動きを実現したい.

  1. トレーサがデコーダスレッドを生成
  2. トレーサはETRのバッファの書き込み状況をpollingで監視してある程度溜まったらデコーダにトレースのバッファへのポインタと大きさを渡してデコードを依頼
  3. デコーダはデコードしてカバレッジビットマップを更新

逐次的なデコードは現在のエッジカバレッジからビットマップを更新する方法では実現できないはず(トレースの途中の状態では完全なエッジカバレッジを構築できない,という認識).そのためPtrixにあるPT-friendlyなフィードバックに変える必要がある(Issue #4).

実装の進め方

前提としてIssue #4の機能が必須なのでそちらの実装を先にお願いしたいです.スレッドなどについてはトレーサ側で管理するのでAPIの大枠は @retrage で作る形で進めたいと思います.

Address with Context packet support

Jetson Nanoでトレースを取得すると以下のように"Address & Context"パケットが生成される.

Idx:68; ID:13;  I_TRACE_ON : Trace On.                                          
Idx:69; ID:13;  I_ADDR_CTXT_L_64IS0 : Address & Context, Long, 64 bit, IS0.; Addr=0x00000055711556B0; Ctxt: AArch64,EL0, NS;
Idx:80; ID:13;  I_ATOM_F2 : Atom format 2.; EE                                        
Idx:81; ID:13;  I_ADDR_L_64IS0 : Address, Long, 64 bit, IS0.; Addr=0x0000007F84492640;

Jetson対応を行うにはこの種類のパケットのデコード対応が必要である.

"Address & Context"パケットについてはETMv4 Specification IHI0064H.a 6-298に仕様が記述されている.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.