kernel-fxtec-pro1x/arch/x86/kernel/cpu
Seiji Aguchi cf910e83ae x86, trace: Add irq vector tracepoints
[Purpose of this patch]

As Vaibhav explained in the thread below, tracepoints for irq vectors
are useful.

http://www.spinics.net/lists/mm-commits/msg85707.html

<snip>
The current interrupt traces from irq_handler_entry and irq_handler_exit
provide when an interrupt is handled.  They provide good data about when
the system has switched to kernel space and how it affects the currently
running processes.

There are some IRQ vectors which trigger the system into kernel space,
which are not handled in generic IRQ handlers.  Tracing such events gives
us the information about IRQ interaction with other system events.

The trace also tells where the system is spending its time.  We want to
know which cores are handling interrupts and how they are affecting other
processes in the system.  Also, the trace provides information about when
the cores are idle and which interrupts are changing that state.
<snip>

On the other hand, my usecase is tracing just local timer event and
getting a value of instruction pointer.

I suggested to add an argument local timer event to get instruction pointer before.
But there is another way to get it with external module like systemtap.
So, I don't need to add any argument to irq vector tracepoints now.

[Patch Description]

Vaibhav's patch shared a trace point ,irq_vector_entry/irq_vector_exit, in all events.
But there is an above use case to trace specific irq_vector rather than tracing all events.
In this case, we are concerned about overhead due to unwanted events.

So, add following tracepoints instead of introducing irq_vector_entry/exit.
so that we can enable them independently.
   - local_timer_vector
   - reschedule_vector
   - call_function_vector
   - call_function_single_vector
   - irq_work_entry_vector
   - error_apic_vector
   - thermal_apic_vector
   - threshold_apic_vector
   - spurious_apic_vector
   - x86_platform_ipi_vector

Also, introduce a logic switching IDT at enabling/disabling time so that a time penalty
makes a zero when tracepoints are disabled. Detailed explanations are as follows.
 - Create trace irq handlers with entering_irq()/exiting_irq().
 - Create a new IDT, trace_idt_table, at boot time by adding a logic to
   _set_gate(). It is just a copy of original idt table.
 - Register the new handlers for tracpoints to the new IDT by introducing
   macros to alloc_intr_gate() called at registering time of irq_vector handlers.
 - Add checking, whether irq vector tracing is on/off, into load_current_idt().
   This has to be done below debug checking for these reasons.
   - Switching to debug IDT may be kicked while tracing is enabled.
   - On the other hands, switching to trace IDT is kicked only when debugging
     is disabled.

In addition, the new IDT is created only when CONFIG_TRACING is enabled to avoid being
used for other purposes.

Signed-off-by: Seiji Aguchi <seiji.aguchi@hds.com>
Link: http://lkml.kernel.org/r/51C323ED.5050708@hds.com
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
2013-06-20 22:25:34 -07:00
..
mcheck x86, trace: Add irq vector tracepoints 2013-06-20 22:25:34 -07:00
mtrr taint: add explicit flag to show whether lock dep is still OK. 2013-01-21 17:17:57 +10:30
.gitignore
amd.c x86, CPU, AMD: Drop useless label 2013-04-16 11:50:51 +02:00
bugs.c x86: Fold-in trivial check_config function 2013-04-16 11:50:50 +02:00
bugs_64.c
centaur.c
common.c x86, trace: Add irq vector tracepoints 2013-06-20 22:25:34 -07:00
cpu.h
cyrix.c x86, cpu: Convert Cyrix coma bug detection 2013-04-02 10:12:54 -07:00
hypervisor.c x86/apic: Allow x2apic without IR on VMware platform 2013-01-24 13:11:18 +01:00
intel.c Merge branch 'x86-kaslr-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-04-30 08:37:24 -07:00
intel_cacheinfo.c Merge branch 'x86-debug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-02-19 20:09:48 -08:00
Makefile Merge branch 'x86-paravirt-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-04-30 08:41:21 -07:00
match.c
mkcapflags.sh mkcapflags.pl: convert to mkcapflags.sh 2013-04-29 15:54:27 -07:00
mshyperv.c x86, hyperv: Handle Xen emulation of Hyper-V more gracefully 2013-04-18 08:59:20 -07:00
perf_event.c perf/x86: Check all MSRs before passing hw check 2013-04-21 11:16:29 +02:00
perf_event.h perf/x86: Add support for PEBS Precise Store 2013-04-01 12:17:06 -03:00
perf_event_amd.c perf/x86/amd: Remove old-style NB counter support from perf_event_amd.c 2013-04-21 17:21:59 +02:00
perf_event_amd_ibs.c treewide: Replace incomming with incoming in all comments and strings 2013-01-03 16:15:49 +01:00
perf_event_amd_uncore.c perf/x86/amd: Fix AMD NB and L2I "uncore" support 2013-04-22 10:10:55 +02:00
perf_event_intel.c Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-05-05 11:37:16 -07:00
perf_event_intel_ds.c Merge branch 'perf/urgent' into perf/core 2013-04-21 10:57:33 +02:00
perf_event_intel_lbr.c perf/x86/intel/lbr: Demand proper privileges for PERF_SAMPLE_BRANCH_KERNEL 2013-05-05 10:58:11 +02:00
perf_event_intel_uncore.c Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-05-05 11:37:16 -07:00
perf_event_intel_uncore.h perf/x86/intel: Add Ivy Bridge-EP uncore support 2013-04-21 11:01:24 +02:00
perf_event_knc.c x86: Constify a few items 2013-03-11 15:11:03 +01:00
perf_event_p4.c perf/x86/intel/P4: Robistify P4 PMU types 2013-04-26 09:31:41 +02:00
perf_event_p6.c x86: Constify a few items 2013-03-11 15:11:03 +01:00
perfctr-watchdog.c
powerflags.c
proc.c x86, cpu: Convert Cyrix coma bug detection 2013-04-02 10:12:54 -07:00
rdrand.c
scattered.c cpufreq: AMD "frequency sensitivity feedback" powersave bias for ondemand governor 2013-04-10 13:19:26 +02:00
topology.c
transmeta.c
umc.c
vmware.c x86/apic: Allow x2apic without IR on VMware platform 2013-01-24 13:11:18 +01:00