telecom • networking • design

an EventHelix.com blog

Convert trace logs to sequence diagrams

Leave a comment

Browsing through the code traces is an exercise in frustration. Applications produce huge logs that take hours to analyze. The Python scripts presented here let you visualize the traces as sequence diagrams. Interactions between objects are presented visually.

Python scripts and EventStudio work together to transform the following trace…

[16-Apr-2011 03:05:02.111][Messaging][MessageHandler.cpp:563]received RandomAccessMessage(signalQuality=15) from DSP_01
[16-Apr-2011 03:05:02.111][Messaging][MessageRouter.cpp:94]called MessageRouter::OnRandomAccessMessage()
[16-Apr-2011 03:05:02.111][Messaging][MessageRouter.cpp:90]decoded RRCConnectionRequest(cause = Mobile Originated Data, s_tmsi=5)
[16-Apr-2011 03:05:02.111][Dispatcher][MobileManager.cpp:92]called MobileManager::OnRRCConnectionRequest()
[16-Apr-2011 03:05:02.112][Dispatcher][MobileManager.cpp:94]created Mobile(id=5)
[16-Apr-2011 03:05:02.112][UE][Mobile.cpp:110]called Mobile::OnRRCConnectionRequest()
[16-Apr-2011 03:05:02.112][UE][Mobile.cpp:89]moved-to Setting up RRC Connection
[16-Apr-2011 03:05:02.112][UE][Mobile.cpp:100]begun RRC Connection Setup
[16-Apr-2011 03:05:02.112][UE][Mobile.cpp:105]allocated TrafficDSP(id=23)
[16-Apr-2011 03:05:02.112][UE][Mobile.cpp:141]called Mobile::SendRRCConnection()
[16-Apr-2011 03:05:02.112][UE][Mobile.cpp:220]sent RRCConnectionSetup(s_tmsi=5) to DSP_23
[16-Apr-2011 03:05:02.112][UE][Mobile.cpp:118]returned from Mobile::SendRRCConnection
[16-Apr-2011 03:05:02.112][UE][Mobile.cpp:117]started AwaitRRCConnection
[16-Apr-2011 03:05:02.112][UE][Mobile.cpp:118]returned (val=5) from Mobile::OnRRCConnectionRequest

…sequence diagrams and collaboration diagrams.

This slideshow requires JavaScript.

The Python scripts lets you customize the mapping from your traces to sequence diagrams with regular expression definitions.

The example below shows how named regular expression groups are mapped to sequence diagram generation language (FDL).

 # Regular expression for parsing the function/method entry trace body
    invokeRegex = '(?P\w+)(\.|::)(?P\w+)\s*(\((?P\w+)\))?'

    # FDL mapping template for function/method entry
    invokeTemplate = '{method} {params} :{caller} -> {called}'

Trace Log to Sequence Diagram Conversion

About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 42 other followers