Re: [PATCH perf-tools-next v6 3/5] perf ftrace: Support display of inlined functions in function graph tracer
From: Aaron Tomlin
Date: Sat Oct 17 2026 - 09:56:54 EST
On Fri, Oct 16, 2026 at 09:34:07AM -0700, Ian Rogers wrote:
> > diff --git a/tools/perf/tests/ftrace.c b/tools/perf/tests/ftrace.c
> > index 596cecee844e..ece7f4b73f44 100644
> > --- a/tools/perf/tests/ftrace.c
> > +++ b/tools/perf/tests/ftrace.c
> > @@ -7,6 +7,10 @@
> > #include <unistd.h>
> > #include "tests.h"
> > #include "debug.h"
> > +#include "dso.h"
> > +#include "machine.h"
> > +#include "map.h"
> > +#include "symbol.h"
> > #include "util/ftrace.h"
> >
> > static int test_parse_retaddr(void)
> > @@ -62,6 +66,372 @@ static int test_filter_retaddr(void)
> > return TEST_OK;
> > }
> >
> > +#define TEST_CHECK(text, cond) \
> > +do { \
> > + if (!(cond)) { \
> > + pr_debug("FAILED %s:%d %s\n", __FILE__, __LINE__, text); \
> > + ret = TEST_FAIL; \
> > + goto out_cleanup; \
> > + } \
> > +} while (0)
> > +
> > +static int test_inline_processing(void)
> > +{
> > + static const char line_entry[] = " 0) | wake_up_new_task() {";
> > + static const char line_enqueue[] =
> > + " 0) | enqueue_task() { /* <-wake_up_new_task+0x1d1/0x3e0 */";
> > + static const char line_exit_enqueue[] = " 0) + 10.000 us | } /* enqueue_task */";
> > + static const char line_exit_task[] = " 0) + 20.000 us | } /* wake_up_new_task */";
> > + static const char line_bare_enqueue[] = " 0) + 10.000 us | }";
> > + static const char line_bare_task[] = " 0) + 20.000 us | }";
> > + static const char line_unmatched[] = " 0) + 5.000 us | } /* unrelated_func */";
> > + static const char line_verbose_entry[] =
> > + " 1234.567890 | 0) bash-1234 | | wake_up_new_task() {";
> > + static const char line_verbose_enqueue[] =
> > + " 1234.567890 | 0) bash-1234 | | enqueue_task() { /* <-wake_up_new_task+0x1d1/0x3e0 */";
> > + static const char line_verbose_exit_enqueue[] =
> > + " 1234.567890 | 0) bash-1234 | 1.234 us | } /* enqueue_task */";
> > + static const char line_verbose_exit_task[] =
> > + " 1234.567890 | 0) bash-1234 | 2.567 us | } /* wake_up_new_task */";
> > + static const char line_verbose_inline_entry[] =
> > + " 1234.567890 | 0) bash-1234 | | activate_task() { /* (inline) */";
> > + static const char line_verbose_inline_exit[] =
> > + " 1234.567890 | 0) bash-1234 | | } /* activate_task (inline) */";
> > + struct perf_ftrace ftrace;
> > + char *out_buf = NULL;
> > + size_t out_len = 0;
> > + FILE *out;
> > + const char *unmatched_pos;
> > + const char *inline_exit_pos;
> > + int ret = TEST_OK;
> > +
> > + memset(&ftrace, 0, sizeof(ftrace));
> > + ftrace.use_inline = true;
> > + ftrace.filter_retaddr = 1; /* Default when --graph-opts retaddr is not specified */
> > + ftrace.tracer = "function_graph";
> > +
> > + /* If vmlinux is present, test resolving symbols */
> > + if (access("vmlinux", R_OK) == 0) {
>
> This series is great and I'm spotting nits. Could we try other vmlinux
> paths here similar to the symbol code? It also seems an early return
> could avoid indentation.
Hi Ian,
Thank you for your feedback.
I see. Looking at tools/perf/util/symbol.c, we can indeed utilise
vmlinux_paths[] as per vmlinux_path__init().
static const char * const vmlinux_paths[] = {
"vmlinux",
"/boot/vmlinux"
};
Acknowledged. I will make these changes.
Kind regards,
--
Aaron Tomlin