On Wed, Nov 12, 2025 at 11:37 PM Steven Rostedt <[email protected]> wrote: > > On Wed, 12 Nov 2025 17:00:10 +0800 > Donglin Peng <[email protected]> wrote: > > > I have a question regarding the behavior of the funcgraph-args option. > > > > Currently, when the funcgraph-args flag is set, the function arguments > > are saved. > > However, when the flag is cleared, the trace output still displays the > > function > > arguments unconditionally. > > Yes. The flag affects the behavior of the recording and not the displaying > of the arguments. There's no reason *not* to show them if they have already > been recorded. Recording the arguments causes a noticeable overhead which > is why it is optional.
Thank you for the clarification. I noticed that when funcgraph-args is enabled, it registers trace_graph_entry_args to replace trace_graph_entry. The only difference is whether a valid fregs pointer is passed. To reduce overhead, I propose consolidating the two entry functions. We could maintain only trace_graph_entry and pass the fregs parameter to graph_entry. Within __graph_entry, we can then conditionally record arguments based on 'TRACE_GRAPH_ARGS && !!fregs'. Additionally, I've confirmed that trace_graph_entry is exclusively used by the function_graph tracer. Other tracers like irqsoff and wakeup directly call __trace_graph_entry with a NULL fregs pointer. Therefore, this consolidation would not impact those tracers. What are your thoughts on this approach? Thanks, Donglin > > > > > I expected that the flag would control both saving and displaying the > > arguments. > > But it seems that the current design only controls the saving. This > > behavior seems > > inconsistent. > > Not at all. The option is only for the recording. Otherwise, one might > expect than they could do the recording and then after the fact enable > "func-args" and expect to see them. That would be more inconsistent. > > > > > I think we should add a check for the flag in the display part, > > specifically before > > calling print_function_args, to ensure that the arguments are only > > displayed when > > the flag is set. > > > > What are your thoughts? > > Big nope! > > The retaddr is different, as the information is somewhat redundant to the > call chain and may cause more noise then needed. > > -- Steve
