From: Thomas Gleixner <tglx@linutronix.de>
To: Vaibhav Nagarnaik <vnagarnaik@google.com>
Cc: Steven Rostedt <rostedt@goodmis.org>,
Ingo Molnar <mingo@redhat.com>, Michael Rubin <mrubin@google.com>,
David Sharp <dhsharp@google.com>,
linux-kernel@vger.kernel.org, x86@kernel.org,
Jiaying Zhang <jiayingz@google.com>
Subject: Re: [PATCH 1/2] trace: Add trap entry/exit tracepoints
Date: Fri, 29 Apr 2011 02:33:04 +0200 (CEST) [thread overview]
Message-ID: <alpine.LFD.2.02.1104290215290.3005@ionos> (raw)
In-Reply-To: <1303513438-26519-1-git-send-email-vnagarnaik@google.com>
On Fri, 22 Apr 2011, Vaibhav Nagarnaik wrote:
> #include <asm/uaccess.h>
> #include <asm/pgtable.h>
> #include <asm/system.h>
> @@ -1330,8 +1332,10 @@ void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs,
> struct siginfo info;
>
> fill_sigtrap_info(tsk, regs, error_code, si_code, &info);
> + trace_trap_entry(tsk->thread.trap_no);
What the heck? How is that a trap? The code is sending SIGTRAP not
entering a trap at all. What are you trying to measure ? The time it
takes to send SIGTRAP? So how is that useful as an extra event?
> /* Send us the fake SIGTRAP */
> force_sig_info(SIGTRAP, &info, tsk);
> + trace_trap_exit(tsk->thread.trap_no);
> }
>
>
> diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
> index 4857ff6..d450349 100644
> --- a/arch/x86/kernel/traps.c
> +++ b/arch/x86/kernel/traps.c
> @@ -33,6 +33,9 @@
> #include <linux/io.h>
> #include <trace/events/irq.h>
>
> +#define CREATE_TRACE_POINTS
> +#include <trace/events/trap.h>
> +
> #ifdef CONFIG_EISA
> #include <linux/ioport.h>
> #include <linux/eisa.h>
> @@ -123,6 +126,7 @@ do_trap(int trapnr, int signr, char *str, struct pt_regs *regs,
> {
> struct task_struct *tsk = current;
>
> + trace_trap_entry(trapnr);
While the event of do_trap() itself might be interesting, it does not
matter at all how long it takes to handle it. That code is really not
so interesting.
> @@ -286,7 +293,9 @@ do_general_protection(struct pt_regs *regs, long error_code)
> printk("\n");
> }
>
> + trace_trap_entry(tsk->thread.trap_no);
> force_sig(SIGSEGV, tsk);
> + trace_trap_exit(tsk->thread.trap_no);
We really do not care how long the force_sig() call takes. It's
irrelevant. The only interesting thing here is that we ran into a GP
trap.
> +
> +dotraplinkage void __kprobes
> +do_page_fault(struct pt_regs *regs, unsigned long error_code)
> +{
> + trace_trap_entry(14);
Yuck. Magic number 14 ? Why not 42 ?
> + __do_page_fault(regs, error_code);
> + trace_trap_exit(14);
> +}
That page fault thing is the only interesting event in terms of
runtime, but I have yet to see a proper rationale for the whole thing
aside of that completly bogus changelog which tells what output I can
produce, but not why the hell it is a good idea to add all that trace
points.
Thanks,
tglx
next prev parent reply other threads:[~2011-04-29 0:33 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-22 23:03 Vaibhav Nagarnaik
2011-04-22 23:03 ` [PATCH 2/2] x86: Change trap definitions to enumerated values Vaibhav Nagarnaik
2011-04-28 23:15 ` Vaibhav Nagarnaik
2011-04-28 23:40 ` Steven Rostedt
2011-04-29 0:38 ` Thomas Gleixner
2011-04-25 23:39 ` [PATCH 1/2] trace: Add trap entry/exit tracepoints Vaibhav Nagarnaik
2011-04-28 23:36 ` Steven Rostedt
2011-04-29 0:33 ` Thomas Gleixner [this message]
2011-04-30 0:52 ` Vaibhav Nagarnaik
2011-04-30 0:52 ` [PATCH 1/2] x86: Change trap definitions to enumerated values Vaibhav Nagarnaik
2011-05-03 13:18 ` Don Zickus
2011-05-03 19:00 ` Vaibhav Nagarnaik
2011-05-03 22:41 ` Michael Rubin
2011-05-03 22:54 ` Steven Rostedt
2011-05-03 23:08 ` David Sharp
2011-04-30 0:52 ` [PATCH 2/2] trace: Add trap entry/exit tracepoints Vaibhav Nagarnaik
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=alpine.LFD.2.02.1104290215290.3005@ionos \
--to=tglx@linutronix.de \
--cc=dhsharp@google.com \
--cc=jiayingz@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=mrubin@google.com \
--cc=rostedt@goodmis.org \
--cc=vnagarnaik@google.com \
--cc=x86@kernel.org \
/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®