Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tracecompass-dev] [v5.3.0] Question about JsonTrace module and custom parser for json files
  • From: tracecompass developer discussions <tracecompass-dev@xxxxxxxxxxx>
  • Date: Mon, 6 Apr 2020 08:49:08 -0400
  • Autocrypt: addr=gbastien@xxxxxxxxxxxx; prefer-encrypt=mutual; keydata= xsFNBFBOneQBEACmVKsSR9YiWFJuUI5qFPMHh11O3aHBjxsVXIcPchi/FJF9ZB4rOaQ4cbVq AOFD4wftjWl5cZE6SwQS+IsCB3QjaJvq/hQsSgwW959PllZ266/yW7G8f77si2g9NeK+u5NB EwNCTLcai6VPjHXpXvWD0s9oeD5RuEK5qRjAjne7D1F/vpDEzfolc8ZIYkTp+eQ7gwgqSoei z9qPObes8fg6l/zB+vsOu2L5DE8/2Ad5ItYlC8MTD+LrFjyhxuFC14VuXvIV4DwOkKRfWGn9 PDDUnQbu2p1x4g6zLmk9Karm9qzWDKNrqhUHvrQwUS5ooiLHeCbkjDG3Iq7f9u3DiqP7OFmu 313UX8qB8glOJgGLnjha9sVwUT6Eqx+oqAXwBZJIopG5mVDTuhIiapWcWUzwewIF5rIw7ReN RQsCD2e+a+xBhoFTfM0yqbHKLaPfds2/b7+vIzi9lKfqOX8o5OEKPjJkxcxXJcYVpxCWQpfG rVuek0ucfyBd5zeHJYfwOdiVjGn7lqrhAlzsCYj7DYYSC/7bNykh2wyttuzi4DcprgxsVKIk j1KaSdq8GhSuAgOnja9Ro1/E4pNZHdBd/kNU+Qb1L98s8r3EcdOoPI4CJCDrNLodNbBliH5Y JvnpaYvMqWek+MQ8a/spmuSdFS5FivSMaOfifzWCOItTksOtEQARAQABzTJHZW5ldmlldmUg QmFzdGllbiAodGFoaW5pKSA8Z2Jhc3RpZW5AdmVyc2F0aWMubmV0PsLBoQQTAQIASwIbAwYL CQgHAwIGFQgCCQoLBBYCAwECHgECF4AfGGh0dHA6Ly9wb29sLnNrcy1rZXlzZXJ2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TL0SPlGaq4PMm+Wl8cxakWYJio09E9HaP+V7b jvgrBQ==
  • Delivered-to: tracecompass-dev@xxxxxxxxxxx
  • List-archive: <https://www.eclipse.org/mailman/private/tracecompass-dev>
  • List-help: <mailto:tracecompass-dev-request@eclipse.org?subject=help>
  • List-subscribe: <https://www.eclipse.org/mailman/listinfo/tracecompass-dev>, <mailto:tracecompass-dev-request@eclipse.org?subject=subscribe>
  • List-unsubscribe: <https://www.eclipse.org/mailman/options/tracecompass-dev>, <mailto:tracecompass-dev-request@eclipse.org?subject=unsubscribe>
  • User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1

Hi Yang,


By json trace, do you mean the trace-event trace format? Where a trace event looks like this:


{"cat":"task","pid":23885,"tid":11,"ts":1496637340355,"ph":"B","name":"SyncChannel::SendWithTimeout"},


If so, the current analysis is already at thread level so you wouldn't have to do much. Trace Compass itself produces, when logging is activated, such a trace type.


Or is it rather a variation on the OpenTracing trace?


In both cases, you should look at the incubator source code [1], where the 2 classes, OpenTracingTrace and TraceEventTrace, both extend the JsonTrace and have their associated analyses.


Don't hesitate to ask more question if that does not give you the answer you were looking for.


[1] https://projects.eclipse.org/projects/tools.tracecompass.incubator/developer


Best regards,

Geneviève





On 4/6/20 8:12 AM, tracecompass developer discussions wrote:

Sorry it was my bad, I solved this by select the add-ons and the jsontrace option is now available,


Now my question is about developing a custom parser for json file, since the java trace data we are creating is output in this file format. 

The attribute we are using might be different from JsonTrace, since it is for thread-level infomation instead of processes,


So I would like to know if it's possible to:


1. define custom event type for thread-level events

    ​so that the analysis module could recognize the event types and highlight them in charts.

2. extend (or create) another json file parser for this kind of json file. 


I have looked into the class JsonTrace and TmfTrace which it extends, and think I may start from extending JsonTrace, 

but I would like to know your suggestions, how to better structure this?


Best regards,


Yang Zhou
Kungliga Tekniska högskolan | KTH Royal Institute of Technology
Master i datalogi | Master of Computer Science
Datorgrafik och visualisering | Computer Graphics and Visualization
Email (preferred): zhy@xxxxxx
Tel: +46 073 846 48 96 

From: tracecompass-dev-bounces@xxxxxxxxxxx <tracecompass-dev-bounces@xxxxxxxxxxx> on behalf of tracecompass developer discussions <tracecompass-dev@xxxxxxxxxxx>
Sent: Monday, April 6, 2020 1:54 PM
To: tracecompass-dev@xxxxxxxxxxx
Subject: [tracecompass-dev] [v5.3.0] Question about JsonTrace module and custom parser for json files
 

Hi all


I'm Yang and I'm doing a master thesis about visualising Java traces with TraceCompass, my supervisor is Cyrille Artho.


Currently I built TC v5.3.0 from source and was trying to import a json file, however the JsonTrace module doesn't exist, and Json Trace files cannot be recognized. 

Before this I was using the official release package v5.2 and it supports importing Json file, no matter it is a valid trace or not. 

The current problem is, the maven build log shows that all modules are built successfully, including JsonTrace.


[INFO] Trace Compass Json trace Parent .................... SUCCESS [  0.031 s]
[INFO] org.eclipse.tracecompass.jsontrace.core ............ SUCCESS [  0.677 s]
[INFO] org.eclipse.tracecompass.jsontrace ................. SUCCESS [  1.890 s]
...
[INFO] org.eclipse.tracecompass.tmf.remote ................ SUCCESS [  1.234 s]
[INFO] Trace Compass Repository ........................... SUCCESS [ 14.221 s]
[INFO] org.eclipse.tracecompass.jsontrace.core.tests ...... SUCCESS [  0.554 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------

However option "jsontrace" doesn't exist in the menu.


I look up the build configurations and there is <module> jsontrace </module> in the root pom file, but do I need to pass any parameters when building?


Looking forward to your reply and thanks in advance, once I got this solved, I have some further questions about extending class JsonTrace ​and  analysis of custom event types.


Best regards,


Yang Zhou
Kungliga Tekniska högskolan | KTH Royal Institute of Technology
Master i datalogi | Master of Computer Science
Datorgrafik och visualisering | Computer Graphics and Visualization
Email (preferred): zhy@xxxxxx
Tel: +46 073 846 48 96 

_______________________________________________
tracecompass-dev mailing list
tracecompass-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/tracecompass-dev

Back to the top