Motifs

Motifs

In context of a trace visualizer, a motif is a recurring pattern of events you find in a trace. Motifs provide P developers with a means to search for specific communication patterns within the graph. These patterns can greatly assist in debugging sessions, helping developers understand how the machines are interacting with each other.

Default Motifs

The trace visualizer comes with default motif options available under the 'Motif' tab in the left panel. By default, there are 2-event, 3-event, and 4-event motifs. Selecting any of these default motif options will highlight paths in the graph that match the motif pattern.

Demo Video: How to use default motifs in trace visualizer?

In the following video demo, paths in the graph that match Motif 1, a 2-event motif, are highlighted. This motif represents a simple send-receive pattern (one machine sends an event to another machine, and that machine receives the event).

Custom Motifs

In addition to the default motifs, you can also build your own custom motifs! You can build them in the search bar under the Structured Search tab. Here's how you can interact with the custom motif builder.

  • A single click on a machine line creates a node in that machine.
  • Clicking and dragging connects one machine's node to another machine's node.
  • Double-clicking a node deletes it.
Demo Video: How to build and use custom motifs in trace visualizer?

In the video demo below, a custom motif was built that searches for patterns where Machine 1 sends something to Machine 2, then later sends something to Machine 3, and finally sends something to Machine 4.

P Motifs

Lastly, we have P-specific motifs! With P-specific motifs, you can discover specific sequences of send-receive patterns that satisfy particular constraints within the graph using the following syntax in the search bar.

  • #pmotif=({constraint1}>{constraint2}>>{constraint3}...)
  • constraint[n] can be any filtering format supported by the basic search bar.
  • The characters > and >> indicate the searching behavior after a constraint is satisfied.
    Typing #pmotif=({constraint1}>{constraint2}) in the search bar will highlight a send-receive pattern where the first send event satisfies constraint1 and the immediate subsequent send event satisfies constraint2.
    In contrast, typing #pmotif=({constraint1}>>{constraint2}) in the search bar will highlight send-receive patterns where the first send event satisfies constraint1 and any second send event that follows the first one satisfies constraint2.
More explanation with an example

  • #pmotif=({eInformCoordinator && target="Participant(3)"}>>{"status=0"}>{target="Client(8)"})
  • This P motif will highlight a sequence of send-receive patterns as follows: The first send event will satisfy the constraint that the node contains the text eInformCoordinator and has a field target equal to Participant(3). Then, following this first send event, it will highlight any send events afterwards (indicated by >>) that satisfy the constraint that the node contains the text status=0 or any of the node's fields' values contain the text status=0. Lastly, we are searching for an immediate send event after any of the send events just found that satisfies the last constraint that the node contain the field target with its value equal to Client(8).

Demo Video: How to use p-specific motifs in trace visualizer?

Another example is shown in the following video demo with this P motif: #pmotif=({eWriteTransReq}>{eWriteTransResp}>{eReadTransReq}). This P motif looks for a sequence of send-receive patterns where the first is a send event that contains the text eWriteTransReq, then an immediate second send event that contains the text eWriteTransResp, and lastly, an immediate third send event that contains the text eReadTransReq.