I personally summarized the use of record_function in the following points:

If you think it is redundant, only the code segment with general statistics is needed.
Code snippets that need comment help to view.

Of course, there are more than these uses, you can dig by yourself.