lkml.org 
[lkml]   [2019]   [Nov]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] TRACING: FTRACE: Use xarray structure for ftrace syscalls

ping?

-- Steve


On Tue, 22 Oct 2019 17:45:51 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:

> On Tue, 22 Oct 2019 15:51:04 -0400
> Steven Rostedt <rostedt@goodmis.org> wrote:
>
> > > static struct syscall_metadata *syscall_nr_to_meta(int nr)
> > > {
> > > - if (!syscalls_metadata || nr >= NR_syscalls || nr < 0)
> > > - return NULL;
> > > -
> > > - return syscalls_metadata[nr];
> > > + return xa_load(&syscalls_metadata, (unsigned long)nr);
> > > }
> > >
>
> There appears to be a slight overhead to this for archs that do not
> have a sparse syscall array. I wonder if we should make this only
> applicable for archs (via adding a HAVE_SPARSE_SYSCALL_NR define and
> checking against it). Then if an arch doesn't have a sparse array of
> system calls, it uses a normal lookup, but for archs that do, it can
> define this for this type of lookup.
>
> There's not much to this patch, so it wouldn't be too difficult to
> support both methods.
>
> Without this patch I ran:
>
> # trace-cmd start -e syscalls
> # /work/c/hackbench 50
> Time: 15.702
> # /work/c/hackbench 50
> Time: 15.932
> # /work/c/hackbench 50
> Time: 15.893
> # /work/c/hackbench 50
> Time: 16.038
> # /work/c/hackbench 50
> Time: 15.429
>
>
> With the patch it had:
>
> # trace-cmd start -e syscalls
> # /work/c/hackbench 50
> Time: 16.582
> # /work/c/hackbench 50
> Time: 15.972
> # /work/c/hackbench 50
> Time: 16.078
> # /work/c/hackbench 50
> Time: 16.133
> # /work/c/hackbench 50
> Time: 16.263
>
> -- Steve

\
 
 \ /
  Last update: 2019-11-13 20:25    [W:0.088 / U:1.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site