Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: g.borello@gmail.com (Gianluca Borello)
Subject: [lttng-dev] Tracepoints overhead in x86_64
Date: Sat, 31 Aug 2013 15:16:35 -0700	[thread overview]
Message-ID: <CAJWsiukmE7s1KkLwg_EJy_fsX4BsQYLb+R_skFBM6YQ_S6FB6Q@mail.gmail.com> (raw)
In-Reply-To: <20130831202107.GA21499@Krystal>

On Aug 31, 2013 1:21 PM, "Mathieu Desnoyers" <mathieu.desnoyers at efficios.com>
wrote:
>
> My recommendation would be to implement a dummy trace_sys_enter and
> trace_sys_exit, and then benchmark the overhead of enabling system call
> tracing (this will set TIF_SYSCALL_TRACEPOINT in every thread). So at
> least it would help you pinpoint where most of the overhead comes from.
>

Yes, I already did that before writing the patch I attached in the previous
mail, and I can confirm that simply setting  TIF_SYSCALL_TRACEPOINT in all
threads (without registering any tracepoint) shows the same overhead.

> Indeed, if you come up with ways to shrink the overhead of this "slow
> path", I'm sure the LTTng community would gladly welcome this. Of
> course, these changes would have to be proposed to the Linux kernel
> community. You will need to keep in mind that they will frown upon
> pretty much _any_ slowdown of the fast path (common case, no tracing)
> for improving the speed of the slow (uncommon) case.
>

That might be interesting.
I guess I have a couple of questions:

1) Where do you think I could find an answer to the question "can
trace_sys_enter be safely called from the fast path?". In my tests it
worked just fine, but I'm concerned that calling the tracepoint without
using the IRET slow path could lead to the potential DoS the commit was
fixing.

2) How do you think the kernel community would react to a patch that adds
the tracepoint call to the fast path? Basically, if it works, I'd check the
TIF_SYSCALL_TRACEPOINT directly in the fast path and, if set, I would
proceed in saving the registers and calling the probes, so in the common
case there would be just one more check against the current thread's flags.

Thank you again!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lttng.org/pipermail/lttng-dev/attachments/20130831/740f30f1/attachment.html>


      reply	other threads:[~2013-08-31 22:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-30 21:47 Gianluca Borello
2013-08-31 20:21 ` Mathieu Desnoyers
2013-08-31 22:16   ` Gianluca Borello [this message]

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=CAJWsiukmE7s1KkLwg_EJy_fsX4BsQYLb+R_skFBM6YQ_S6FB6Q@mail.gmail.com \
    --to=g.borello@gmail.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