Skip to content

Commit

Permalink
update 1
Browse files Browse the repository at this point in the history
  • Loading branch information
taoboyang committed Jul 7, 2023
1 parent 569bee5 commit 289ce86
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions content/en/docs/bmf/multiple_features/trace_and_debug/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ The tool will print and generate tracelog logs after execution. Users can refer

When using the Trace tool, after the graph is executed, some information about the Trace will be printed out:

![Trace printing](/img/traceimg_print0.png)
![Trace printing](/img/docs/traceimg_print0.png)

The printed information includes:
- **Runtime Information**
Expand Down Expand Up @@ -72,15 +72,15 @@ $ export BMF_TRACE_PRINTING=DISABLE

The Tracelog JSON log format conforms to the format used in Chrome Tracing (Chrome web browser - chrome://tracing/ ), so it can be visualized using Chrome Tracing:

![Viewing tracelog in Chrome Tracing](/img/traceimg_common1.png)
![Viewing tracelog in Chrome Tracing](/img/docs/traceimg_common1.png)

The representations of Instant events and duration events are easily distinguished:

![Instant event and duration event](/img/traceimg_common2.png)
![Instant event and duration event](/img/docs/traceimg_common2.png)

At the end of the recording, Trace will append relevant information (Trace info) to the end of the log to indicate that the log is complete:

![Trace info display](/img/traceimg_common3.png)
![Trace info display](/img/docs/traceimg_common3.png)

In the bottom panel you can see:
- **Title**: Trace event name
Expand All @@ -95,7 +95,7 @@ Note: If the overflow count is not 0, it means that the current buffer allocated

In addition to Chrome Tracing, [BMF GraphUtilization Tool](./Page_GraphUtilization.md) also supports visualization of trace events:

![Visualizing tracelog using BMF GraphUtilization](/img/graphutil_common2.png)
![Visualizing tracelog using BMF GraphUtilization](/img/docs/graphutil_common2.png)

The GraphUtilization tool can display graphs and some information or charts that Chrome Tracing cannot display.

Expand All @@ -105,7 +105,7 @@ The GraphUtilization tool can display graphs and some information or charts that

As an example of using the Trace tool to identify bottlenecks in an implementation, consider a typical transcoding example:

![Typical transcoding DAG](/img/traceimg_example1.png)
![Typical transcoding DAG](/img/docs/traceimg_example1.png)

Note: The construction graph of the above graph can be displayed by [GraphUtilization Tool](./Page_GraphUtilization.md)

Expand Down Expand Up @@ -134,7 +134,7 @@ module_name = "analysis"

Executing this graph is time consuming if the pre-module method is not used. Using the tracelog generated by the Trace tool, it can be seen in Chrome Tracing that the initialization of Node 2 (that is, the analysis module in the above figure - the number in brackets indicates the Node ID) takes 3 seconds:

![Module initialization time](/img/traceimg_example2.png)
![Module initialization time](/img/docs/traceimg_example2.png)

Optimized code using pre-module:

Expand Down Expand Up @@ -163,19 +163,19 @@ pre_module = bmf.create_module(module_name, {

The pre-loading mode (pre-module) can significantly reduce graph execution time:

![Analysis module in pre-module mode](/img/traceimg_example3.png)
![Analysis module in pre-module mode](/img/docs/traceimg_example3.png)

### Example 2: Troubleshooting Hang problems

When writing modules, sometimes some bugs or bottlenecks are encountered, and the Trace tool can help users find the source of the problem.

The following example occurs in the encoder module, and the graph seems to hang when executing. Since the graph is not executed, the tracelog is not generated. However, after using [trace_format_log](#trace_format_log), the tracelog will be constructed from and can be analyzed on Chrome Tracing:

![Hang problem troubleshoot](/img/traceimg_example7.png)
![Hang problem troubleshoot](/img/docs/traceimg_example7.png)

The basic Trace node is limited, but it can be seen which node (and module) did not complete the process_node. If you need further analysis, you can add a CUSTOM Trace node (using the Trace interface) from the function, and you can further see the process call of the process function after re-running:

![Hang problem troubleshoot](/img/traceimg_example6.png)
![Hang problem troubleshoot](/img/docs/traceimg_example6.png)

In this example, it can be seen that whenever there is a new video frame, the handle_video_frame function needs to process more than a thousand sync frames, resulting in a long execution time (it looks like hang).

Expand Down

0 comments on commit 289ce86

Please sign in to comment.