* Reason for unused flags argument in trace_raw_output_* function?
@ 2021-10-07 3:49 William Cohen
2021-10-07 13:20 ` Steven Rostedt
0 siblings, 1 reply; 3+ messages in thread
From: William Cohen @ 2021-10-07 3:49 UTC (permalink / raw)
To: Steven Rostedt, mingo, LKML
Hi,
I have some code that analyzes x86_64 binaries (https://developers.redhat.com/articles/2021/08/09/debugging-function-parameters-
dyninst#liveness_analysis) and list which function parameters are unused. I noticed that trace_raw_output_* functions have an unused flags argument. I assume this is is to make the argument list match up with some other function, but I couldn't see which function(s) the trace_raw_output_* functions are trying to match up with. Which functions are the trace_raw_output_* function's arguments trying to match?
-Will Cohen
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Reason for unused flags argument in trace_raw_output_* function?
2021-10-07 3:49 Reason for unused flags argument in trace_raw_output_* function? William Cohen
@ 2021-10-07 13:20 ` Steven Rostedt
2021-10-07 14:31 ` William Cohen
0 siblings, 1 reply; 3+ messages in thread
From: Steven Rostedt @ 2021-10-07 13:20 UTC (permalink / raw)
To: William Cohen; +Cc: mingo, LKML
On Wed, 6 Oct 2021 23:49:22 -0400
William Cohen <wcohen@redhat.com> wrote:
> Hi,
>
> I have some code that analyzes x86_64 binaries
> (https://developers.redhat.com/articles/2021/08/09/debugging-function-parameters-
> dyninst#liveness_analysis) and list which function parameters are unused.
> I noticed that trace_raw_output_* functions have an unused flags
> argument. I assume this is is to make the argument list match up with
> some other function, but I couldn't see which function(s) the
> trace_raw_output_* functions are trying to match up with. Which
> functions are the trace_raw_output_* function's arguments trying to match?
>
The match of other printing functions is in kernel/trace/trace_output.c
And is called from kernel/trace/trace.c where one place it does pass in
flags:
static enum print_line_t print_trace_fmt(struct trace_iterator *iter)
{
[..]
if (event)
return event->funcs->trace(iter, sym_flags, event);
Now if they are still used, is something we should investigate.
This code has changed a lot over the years when that "flags" parameter was
introduced. It could now just be a relic from the old implementations.
Thanks for pointing this out. If I get time I'll look deeper into it, but
feel free to look at it yourself.
-- Steve
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Reason for unused flags argument in trace_raw_output_* function?
2021-10-07 13:20 ` Steven Rostedt
@ 2021-10-07 14:31 ` William Cohen
0 siblings, 0 replies; 3+ messages in thread
From: William Cohen @ 2021-10-07 14:31 UTC (permalink / raw)
To: Steven Rostedt; +Cc: mingo, LKML
On 10/7/21 09:20, Steven Rostedt wrote:
> On Wed, 6 Oct 2021 23:49:22 -0400
> William Cohen <wcohen@redhat.com> wrote:
>
>> Hi,
>>
>> I have some code that analyzes x86_64 binaries
>> (https://developers.redhat.com/articles/2021/08/09/debugging-function-parameters-
>> dyninst#liveness_analysis) and list which function parameters are unused.
>> I noticed that trace_raw_output_* functions have an unused flags
>> argument. I assume this is is to make the argument list match up with
>> some other function, but I couldn't see which function(s) the
>> trace_raw_output_* functions are trying to match up with. Which
>> functions are the trace_raw_output_* function's arguments trying to match?
>>
>
> The match of other printing functions is in kernel/trace/trace_output.c
>
> And is called from kernel/trace/trace.c where one place it does pass in
> flags:
>
>
> static enum print_line_t print_trace_fmt(struct trace_iterator *iter)
> {
> [..]
> if (event)
> return event->funcs->trace(iter, sym_flags, event);
Hi Steve,
Thanks for pointing to where the trace_raw_output_* functions are called from.
>
> Now if they are still used, is something we should investigate.
For the trace_raw_output_* functions the flags arg all seems to be unused. Are there other trace functions should examining for unused args? With the extensive macro use I could see where some vestigial unused argument gets left behind.
>
> This code has changed a lot over the years when that "flags" parameter was
> introduced. It could now just be a relic from the old implementations.
>
> Thanks for pointing this out. If I get time I'll look deeper into it, but
> feel free to look at it yourself.
>
> -- Steve
>
Thanks again,
-Will
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-10-07 14:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-07 3:49 Reason for unused flags argument in trace_raw_output_* function? William Cohen
2021-10-07 13:20 ` Steven Rostedt
2021-10-07 14:31 ` William Cohen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).