From: Steven Rostedt <rostedt@goodmis.org>
To: Hassan Naveed <hnaveed@wavecomp.com>
Cc: Ingo Molnar <mingo@redhat.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Paul Burton <pburton@wavecomp.com>
Subject: Re: [PATCH] TRACING: FTRACE: Use xarray structure for ftrace syscalls
Date: Tue, 22 Oct 2019 17:45:51 -0400 [thread overview]
Message-ID: <20191022174551.2fcc85fd@gandalf.local.home> (raw)
In-Reply-To: <20191022155104.29b062a5@gandalf.local.home>
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
next prev parent reply other threads:[~2019-10-22 21:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-22 18:24 Hassan Naveed
2019-10-22 19:51 ` Steven Rostedt
2019-10-22 21:45 ` Steven Rostedt [this message]
2019-11-13 19:24 ` Steven Rostedt
2019-11-15 23:44 ` [PATCH v2 1/2] tracing: Use xarray for syscall trace events Hassan Naveed
2019-11-15 23:44 ` [PATCH v2 2/2] tracing: enable syscall optimization for MIPS Hassan Naveed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191022174551.2fcc85fd@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=hnaveed@wavecomp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=pburton@wavecomp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®