lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 8 Jun 2021 20:51:25 +0200
From:   Jiri Olsa <jolsa@...hat.com>
To:     Andrii Nakryiko <andrii.nakryiko@...il.com>
Cc:     Jiri Olsa <jolsa@...nel.org>, Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Andrii Nakryiko <andriin@...com>,
        "Steven Rostedt (VMware)" <rostedt@...dmis.org>,
        Networking <netdev@...r.kernel.org>, bpf <bpf@...r.kernel.org>,
        Martin KaFai Lau <kafai@...com>,
        Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>,
        John Fastabend <john.fastabend@...il.com>,
        KP Singh <kpsingh@...omium.org>, Daniel Xu <dxu@...uu.xyz>,
        Viktor Malik <vmalik@...hat.com>
Subject: Re: [PATCH 03/19] x86/ftrace: Make function graph use ftrace directly

On Tue, Jun 08, 2021 at 11:35:58AM -0700, Andrii Nakryiko wrote:

SNIP

> > diff --git a/kernel/trace/fgraph.c b/kernel/trace/fgraph.c
> > index b8a0d1d564fb..58e96b45e9da 100644
> > --- a/kernel/trace/fgraph.c
> > +++ b/kernel/trace/fgraph.c
> > @@ -115,6 +115,7 @@ int function_graph_enter(unsigned long ret, unsigned long func,
> >  {
> >         struct ftrace_graph_ent trace;
> >
> > +#ifndef CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS
> >         /*
> >          * Skip graph tracing if the return location is served by direct trampoline,
> >          * since call sequence and return addresses are unpredictable anyway.
> > @@ -124,6 +125,7 @@ int function_graph_enter(unsigned long ret, unsigned long func,
> >         if (ftrace_direct_func_count &&
> >             ftrace_find_rec_direct(ret - MCOUNT_INSN_SIZE))
> >                 return -EBUSY;
> > +#endif
> >         trace.func = func;
> >         trace.depth = ++current->curr_ret_depth;
> >
> > @@ -333,10 +335,10 @@ unsigned long ftrace_graph_ret_addr(struct task_struct *task, int *idx,
> >  #endif /* HAVE_FUNCTION_GRAPH_RET_ADDR_PTR */
> >
> >  static struct ftrace_ops graph_ops = {
> > -       .func                   = ftrace_stub,
> > +       .func                   = ftrace_graph_func,
> >         .flags                  = FTRACE_OPS_FL_INITIALIZED |
> > -                                  FTRACE_OPS_FL_PID |
> > -                                  FTRACE_OPS_FL_STUB,
> > +                                  FTRACE_OPS_FL_PID
> > +                                  FTRACE_OPS_GRAPH_STUB,
> 
> nit: this looks so weird... Why not define FTRACE_OPS_GRAPH_STUB as
> zero in case of #ifdef ftrace_graph_func? Then it will be natural and
> correctly looking | FTRACE_OPS_GRAPH_STUB?

ok, I can change that

thanks,
jirka

> 
> >  #ifdef FTRACE_GRAPH_TRAMP_ADDR
> >         .trampoline             = FTRACE_GRAPH_TRAMP_ADDR,
> >         /* trampoline_size is only needed for dynamically allocated tramps */
> > --
> > 2.31.1
> >
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ