Skip to contentSkip to conversation

perfcounters/core for v2.6.32

GIT PULL Ingo Molnar 1 participant 1 message Sep 11, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Linus,

Please pull the latest perfcounters-core-for-linus git tree from:

git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git perfcounters-core-for-linus

Highlights:

- New 'perf trace' tool
- Output channel multiplexing
- Updated statistics model for perf stat --repeat
- x86 BTS branch recording
- Call-chain support on PowerPC

Thanks,

Ingo

------------------>
Arnaldo Carvalho de Melo (1):
perf top: Show RIP only in verbose mode

Brice Goglin (2):
perf report: Fix and improve the displaying of per-thread event counters perf report: Add raw displaying of per-thread counters

Frederic Weisbecker (23):
perf tools: Factorize high level dso helpers
perf tools: Factorize the event structure definitions in a single file perf tools: Factorize the map helpers
perf tools: Factorize the thread code in a dedicated file perf tools: Substract -Wformat-nonliteral from Wformat=2 in extra flags perf tools: Factorize the dprintf definition
perf tools: Put the show mode into the event headers files perf tools: Librarize sample type and attr finding from headers perf tools: Librarize trace_event() helper
perf tools: Add perf trace
perf tools: Fix spelling mistake in callchain error
perf tools: Warn while running perf trace without sample perf tools: Record events info also when :record suffix is used. perf tools: Make trace event format parser aware of cast to pointers perf tools: Fix comm column adjusting
perf tools: Save partial non-overlapping map
perf tools: Only save the event formats we need
perf tools: Fix missing string field printing in perf trace perf tools: Add missing parameters documentation
perf tools: Librarize idle thread registration
perf tools: Resolve idle thread cmdline for perf trace
perf tools: Unify swapper tasks naming
perf tools: Complete support for dynamic strings

Ingo Molnar (13):
perf: Enable more compiler warnings
perf: Build with stack-protector and with -D_FORTIFY_SOURCE=2 perf tools: Remove obsolete defines
perf tools: Clean up warnings list in the Makefile
perf tools: Work around strict aliasing related warnings
perf trace: Sample the CPU too
perf_counter: Introduce new (non-)paranoia level to allow raw tracepoint access perf trace: Sample timestamps as well
perf trace: Fix parsing of perf.data
perf tools: Seek to the end of the header area
perf trace: Print out in nanoseconds
perf trace: Fix read_string()
perf_counter: Fix output-sharing error path

Markus Metzger (1):
x86, perf_counter, bts: Add BTS support to perfcounters

Masami Hiramatsu (1):
perf trace: Add OPT_END to option array of perf-trace

Paul Mackerras (4):
powerpc/32: Always order writes to halves of 64-bit PTEs
powerpc: Allow perf_counters to access user memory at interrupt time
perf_counter: powerpc: Add callchain support
perf_counter: Start counting time enabled when group leader gets enabled

Peter Zijlstra (7):
perf tools: Add some comments to the event definitions
perf_counter: Allow sharing of output channels perf stat: Change noise calculation to use stddev perf stat: Remove the limit on repeat
perf stat: Use stddev_mean in stead of stddev perf stat: More advanced variance computation perf stat: Clean up statistics calculations a bit more

Pierre Habouzit (1):
perf tools: do not complain if root is owning perf.data

Steven Rostedt (3):
perf tools: Add trace event debugfs IO handler perf tools: Add trace event debugfs stream reader perf tools: Add trace event information parser

Ulrich Drepper (1):
perf tools: Avoid unnecessary work in directory lookups

[email protected] (3):
x86, perf_counter, bts: Fail if BTS is not available x86, perf_counter, bts: Correct pointer-to-u64 casts x86, perf_counter, bts: Do not allow kernel BTS tracing for now

 arch/powerpc/include/asm/pgtable.h       |    6 +-
 arch/powerpc/kernel/Makefile             |    2 +-
 arch/powerpc/kernel/asm-offsets.c        |    2 +
 arch/powerpc/kernel/exceptions-64s.S     |   19 +
 arch/powerpc/kernel/perf_callchain.c     |  527 ++++++
 arch/powerpc/mm/slb.c                    |   37 +-
 arch/powerpc/mm/stab.c                   |   11 +-
 arch/x86/include/asm/perf_counter.h      |   10 +
 arch/x86/kernel/cpu/perf_counter.c       |  329 ++++-
 include/linux/perf_counter.h             |    5 +
 kernel/perf_counter.c                    |  173 ++-
 tools/perf/Documentation/perf-record.txt |    4 +
 tools/perf/Documentation/perf-report.txt |   13 +
 tools/perf/Makefile                      |   39 +-
 tools/perf/builtin-annotate.c            |  472 +-----
 tools/perf/builtin-help.c                |    1 +
 tools/perf/builtin-record.c              |   38 +-
 tools/perf/builtin-report.c              |  719 ++------
 tools/perf/builtin-stat.c                |  239 +--
 tools/perf/builtin-top.c                 |   66 +-
 tools/perf/builtin-trace.c               |  297 +++
 tools/perf/builtin.h                     |    1 +
 tools/perf/perf.c                        |    1 +
 tools/perf/util/abspath.c                |    3 +-
 tools/perf/util/cache.h                  |    1 -
 tools/perf/util/callchain.c              |    2 +
 tools/perf/util/callchain.h              |    1 +
 tools/perf/util/color.c                  |   16 +-
 tools/perf/util/color.h                  |    3 +-
 tools/perf/util/config.c                 |   22 +-
 tools/perf/util/debug.c                  |   95 +
 tools/perf/util/debug.h                  |    8 +
 tools/perf/util/event.h                  |   96 +
 tools/perf/util/exec_cmd.c               |    1 -
 tools/perf/util/header.c                 |   37 +-
 tools/perf/util/header.h                 |    4 +
 tools/perf/util/map.c                    |   97 +
 tools/perf/util/module.c                 |    4 +-
 tools/perf/util/parse-events.c           |  139 +-
 tools/perf/util/parse-events.h           |   17 +-
 tools/perf/util/parse-options.c          |   22 +
 tools/perf/util/path.c                   |   25 +-
 tools/perf/util/run-command.c            |    6 +-
 tools/perf/util/symbol.c                 |  199 ++-
 tools/perf/util/symbol.h                 |   14 +-
 tools/perf/util/thread.c                 |  175 ++
 tools/perf/util/thread.h                 |   21 +
 tools/perf/util/trace-event-info.c       |  539 ++++++
 tools/perf/util/trace-event-parse.c      | 2942 ++++++++++++++++++++++++++++++
 tools/perf/util/trace-event-read.c       |  512 ++++++
 tools/perf/util/trace-event.h            |  240 +++
 tools/perf/util/util.h                   |    6 +-
 tools/perf/util/values.c                 |  230 +++
 tools/perf/util/values.h                 |   27 +
 54 files changed, 7110 insertions(+), 1405 deletions(-)
 create mode 100644 arch/powerpc/kernel/perf_callchain.c
 create mode 100644 tools/perf/builtin-trace.c
 create mode 100644 tools/perf/util/debug.c
 create mode 100644 tools/perf/util/debug.h
 create mode 100644 tools/perf/util/event.h
 create mode 100644 tools/perf/util/map.c
 create mode 100644 tools/perf/util/thread.c
 create mode 100644 tools/perf/util/thread.h
 create mode 100644 tools/perf/util/trace-event-info.c
 create mode 100644 tools/perf/util/trace-event-parse.c
 create mode 100644 tools/perf/util/trace-event-read.c
 create mode 100644 tools/perf/util/trace-event.h
 create mode 100644 tools/perf/util/values.c
 create mode 100644 tools/perf/util/values.h
arch/powerpc/include/asm/pgtable.h +3 -3
index eb17da7..2a5da06 100644
@@ -104,8 +104,8 @@ static inline void __set_pte_at(struct mm_struct *mm, unsigned long addr,
 	else
 		pte_update(ptep, ~_PAGE_HASHPTE, pte_val(pte));
 
-#elif defined(CONFIG_PPC32) && defined(CONFIG_PTE_64BIT) && defined(CONFIG_SMP)
-	/* Second case is 32-bit with 64-bit PTE in SMP mode. In this case, we
+#elif defined(CONFIG_PPC32) && defined(CONFIG_PTE_64BIT)
+	/* Second case is 32-bit with 64-bit PTE.  In this case, we
 	 * can just store as long as we do the two halves in the right order
 	 * with a barrier in between. This is possible because we take care,
 	 * in the hash code, to pre-invalidate if the PTE was already hashed,
@@ -140,7 +140,7 @@ static inline void __set_pte_at(struct mm_struct *mm, unsigned long addr,
 
 #else
 	/* Anything else just stores the PTE normally. That covers all 64-bit
-	 * cases, and 32-bit non-hash with 64-bit PTEs in UP mode
+	 * cases, and 32-bit non-hash with 32-bit PTEs.
 	 */
 	*ptep = pte;
 #endif
arch/powerpc/kernel/Makefile +1 -1
index b73396b..9619285 100644
@@ -97,7 +97,7 @@ obj64-$(CONFIG_AUDIT)		+= compat_audit.o
 
 obj-$(CONFIG_DYNAMIC_FTRACE)	+= ftrace.o
 obj-$(CONFIG_FUNCTION_GRAPH_TRACER)	+= ftrace.o
-obj-$(CONFIG_PPC_PERF_CTRS)	+= perf_counter.o
+obj-$(CONFIG_PPC_PERF_CTRS)	+= perf_counter.o perf_callchain.o
 obj64-$(CONFIG_PPC_PERF_CTRS)	+= power4-pmu.o ppc970-pmu.o power5-pmu.o \
 				   power5+-pmu.o power6-pmu.o power7-pmu.o
 obj32-$(CONFIG_PPC_PERF_CTRS)	+= mpc7450-pmu.o
arch/powerpc/kernel/asm-offsets.c +2 -0
index 561b646..197b156 100644
@@ -67,6 +67,8 @@ int main(void)
 	DEFINE(MMCONTEXTID, offsetof(struct mm_struct, context.id));
 #ifdef CONFIG_PPC64
 	DEFINE(AUDITCONTEXT, offsetof(struct task_struct, audit_context));
+	DEFINE(SIGSEGV, SIGSEGV);
+	DEFINE(NMI_MASK, NMI_MASK);
 #else
 	DEFINE(THREAD_INFO, offsetof(struct task_struct, stack));
 #endif /* CONFIG_PPC64 */
arch/powerpc/kernel/exceptions-64s.S +19 -0
index eb89811..8ac85e0 100644
@@ -729,6 +729,11 @@ BEGIN_FTR_SECTION
 	bne-	do_ste_alloc		/* If so handle it */
 END_FTR_SECTION_IFCLR(CPU_FTR_SLB)
 
+	clrrdi	r11,r1,THREAD_SHIFT
+	lwz	r0,TI_PREEMPT(r11)	/* If we're in an "NMI" */
+	andis.	r0,r0,NMI_MASK@h	/* (i.e. an irq when soft-disabled) */
+	bne	77f			/* then don't call hash_page now */
+
 	/*
 	 * On iSeries, we soft-disable interrupts here, then
 	 * hard-enable interrupts so that the hash_page code can spin on
@@ -833,6 +838,20 @@ handle_page_fault:
 	bl	.low_hash_fault
 	b	.ret_from_except
 
+/*
+ * We come here as a result of a DSI at a point where we don't want
+ * to call hash_page, such as when we are accessing memory (possibly
+ * user memory) inside a PMU interrupt that occurred while interrupts
+ * were soft-disabled.  We want to invoke the exception handler for
+ * the access, or panic if there isn't a handler.
+ */
+77:	bl	.save_nvgprs
+	mr	r4,r3
+	addi	r3,r1,STACK_FRAME_OVERHEAD
+	li	r5,SIGSEGV
+	bl	.bad_page_fault
+	b	.ret_from_except
+
 	/* here we have a segment miss */
 do_ste_alloc:
 	bl	.ste_allocate		/* try to insert stab entry */
arch/powerpc/kernel/perf_callchain.c new file +527 -0

527 lines not on this page · raw message

arch/powerpc/mm/slb.c +26 -11
index 5b7038f..a685652 100644
@@ -92,15 +92,13 @@ static inline void create_shadowed_slbe(unsigned long ea, int ssize,
 		     : "memory" );
 }
 
-void slb_flush_and_rebolt(void)
+static void __slb_flush_and_rebolt(void)
 {
 	/* If you change this make sure you change SLB_NUM_BOLTED
 	 * appropriately too. */
 	unsigned long linear_llp, vmalloc_llp, lflags, vflags;
 	unsigned long ksp_esid_data, ksp_vsid_data;
 
-	WARN_ON(!irqs_disabled());
-
 	linear_llp = mmu_psize_defs[mmu_linear_psize].sllp;
 	vmalloc_llp = mmu_psize_defs[mmu_vmalloc_psize].sllp;
 	lflags = SLB_VSID_KERNEL | linear_llp;
@@ -117,12 +115,6 @@ void slb_flush_and_rebolt(void)
 		ksp_vsid_data = get_slb_shadow()->save_area[2].vsid;
 	}
 
-	/*
-	 * We can't take a PMU exception in the following code, so hard
-	 * disable interrupts.
-	 */
-	hard_irq_disable();
-
 	/* We need to do this all in asm, so we're sure we don't touch
 	 * the stack between the slbia and rebolting it. */
 	asm volatile("isync\n"
@@ -139,6 +131,21 @@ void slb_flush_and_rebolt(void)
 		     : "memory");
 }
 
+void slb_flush_and_rebolt(void)
+{
+
+	WARN_ON(!irqs_disabled());
+
+	/*
+	 * We can't take a PMU exception in the following code, so hard
+	 * disable interrupts.
+	 */
+	hard_irq_disable();
+
+	__slb_flush_and_rebolt();
+	get_paca()->slb_cache_ptr = 0;
+}
+
 void slb_vmalloc_update(void)
 {
 	unsigned long vflags;
@@ -180,12 +187,20 @@ static inline int esids_match(unsigned long addr1, unsigned long addr2)
 /* Flush all user entries from the segment table of the current processor. */
 void switch_slb(struct task_struct *tsk, struct mm_struct *mm)
 {
-	unsigned long offset = get_paca()->slb_cache_ptr;
+	unsigned long offset;
 	unsigned long slbie_data = 0;
 	unsigned long pc = KSTK_EIP(tsk);
 	unsigned long stack = KSTK_ESP(tsk);
 	unsigned long unmapped_base;
 
+	/*
+	 * We need interrupts hard-disabled here, not just soft-disabled,
+	 * so that a PMU interrupt can't occur, which might try to access
+	 * user memory (to get a stack trace) and possible cause an SLB miss
+	 * which would update the slb_cache/slb_cache_ptr fields in the PACA.
+	 */
+	hard_irq_disable();
+	offset = get_paca()->slb_cache_ptr;
 	if (!cpu_has_feature(CPU_FTR_NO_SLBIE_B) &&
 	    offset <= SLB_CACHE_ENTRIES) {
 		int i;
@@ -200,7 +215,7 @@ void switch_slb(struct task_struct *tsk, struct mm_struct *mm)
 		}
 		asm volatile("isync" : : : "memory");
 	} else {
-		slb_flush_and_rebolt();
+		__slb_flush_and_rebolt();
 	}
 
 	/* Workaround POWER5 < DD2.1 issue */
arch/powerpc/mm/stab.c +10 -1
index 98cd1dc..ab5fb48 100644
@@ -164,7 +164,7 @@ void switch_stab(struct task_struct *tsk, struct mm_struct *mm)
 {
 	struct stab_entry *stab = (struct stab_entry *) get_paca()->stab_addr;
 	struct stab_entry *ste;
-	unsigned long offset = __get_cpu_var(stab_cache_ptr);
+	unsigned long offset;
 	unsigned long pc = KSTK_EIP(tsk);
 	unsigned long stack = KSTK_ESP(tsk);
 	unsigned long unmapped_base;
@@ -172,6 +172,15 @@ void switch_stab(struct task_struct *tsk, struct mm_struct *mm)
 	/* Force previous translations to complete. DRENG */
 	asm volatile("isync" : : : "memory");
 
+	/*
+	 * We need interrupts hard-disabled here, not just soft-disabled,
+	 * so that a PMU interrupt can't occur, which might try to access
+	 * user memory (to get a stack trace) and possible cause an STAB miss
+	 * which would update the stab_cache/stab_cache_ptr per-cpu variables.
+	 */
+	hard_irq_disable();
+
+	offset = __get_cpu_var(stab_cache_ptr);
 	if (offset <= NR_STAB_CACHE_ENTRIES) {
 		int i;
 
arch/x86/include/asm/perf_counter.h +10 -0
index fa64e40..e7b7c93 100644
@@ -84,6 +84,16 @@ union cpuid10_edx {
 #define MSR_ARCH_PERFMON_FIXED_CTR2			0x30b
 #define X86_PMC_IDX_FIXED_BUS_CYCLES			(X86_PMC_IDX_FIXED + 2)
 
+/*
+ * We model BTS tracing as another fixed-mode PMC.
+ *
+ * We choose a value in the middle of the fixed counter range, since lower
+ * values are used by actual fixed counters and higher values are used
+ * to indicate other overflow conditions in the PERF_GLOBAL_STATUS msr.
+ */
+#define X86_PMC_IDX_FIXED_BTS				(X86_PMC_IDX_FIXED + 16)
+
+
 #ifdef CONFIG_PERF_COUNTERS
 extern void init_hw_perf_counters(void);
 extern void perf_counters_lapic_init(void);
arch/x86/kernel/cpu/perf_counter.c +323 -6

479 lines not on this page · raw message

include/linux/perf_counter.h +5 -0
index b53f700..e022b84 100644
@@ -216,6 +216,7 @@ struct perf_counter_attr {
 #define PERF_COUNTER_IOC_REFRESH	_IO ('$', 2)
 #define PERF_COUNTER_IOC_RESET		_IO ('$', 3)
 #define PERF_COUNTER_IOC_PERIOD		_IOW('$', 4, u64)
+#define PERF_COUNTER_IOC_SET_OUTPUT	_IO ('$', 5)
 
 enum perf_counter_ioc_flags {
 	PERF_IOC_FLAG_GROUP		= 1U << 0,
@@ -415,6 +416,9 @@ enum perf_callchain_context {
 	PERF_CONTEXT_MAX		= (__u64)-4095,
 };
 
+#define PERF_FLAG_FD_NO_GROUP	(1U << 0)
+#define PERF_FLAG_FD_OUTPUT	(1U << 1)
+
 #ifdef __KERNEL__
 /*
  * Kernel-internal data types and definitions:
@@ -536,6 +540,7 @@ struct perf_counter {
 	struct list_head		sibling_list;
 	int				nr_siblings;
 	struct perf_counter		*group_leader;
+	struct perf_counter		*output;
 	const struct pmu		*pmu;
 
 	enum perf_counter_active_state	state;
kernel/perf_counter.c +137 -36

320 lines not on this page · raw message

tools/perf/Documentation/perf-record.txt +4 -0
index 6be696b..0ff23de 100644
@@ -91,6 +91,10 @@ OPTIONS
 --no-samples::
 	Don't sample.
 
+-R::
+--raw-samples::
+Collect raw sample records from all opened counters (typically for tracepoint counters).
+
 SEE ALSO
 --------
 linkperf:perf-stat[1], linkperf:perf-list[1]
tools/perf/Documentation/perf-report.txt +13 -0
index e72e931..59f0b84 100644
@@ -27,6 +27,9 @@ OPTIONS
 -n
 --show-nr-samples
 	Show the number of samples for each symbol
+-T
+--threads
+	Show per-thread event counters
 -C::
 --comms=::
 	Only consider symbols in these comms. CSV that understands
@@ -48,6 +51,16 @@ OPTIONS
 	all occurances of this separator in symbol names (and other output)
 	with a '.' character, that thus it's the only non valid separator.
 
+-g [type,min]::
+--call-graph::
+        Display callchains using type and min percent threshold.
+	type can be either:
+	- flat: single column, linear exposure of callchains.
+	- graph: use a graph tree, displaying absolute overhead rates.
+	- fractal: like graph, but displays relative rates. Each branch of
+		 the tree is considered as a new profiled object. +
+	Default: fractal,0.5.
+
 SEE ALSO
 --------
 linkperf:perf-stat[1]
tools/perf/Makefile +38 -1
index c045b42..9f8d207 100644
@@ -166,7 +166,35 @@ endif
 
 # CFLAGS and LDFLAGS are for the users to override from the command line.
 
-CFLAGS = $(M64) -ggdb3 -Wall -Wextra -Wstrict-prototypes -Wmissing-declarations -Wmissing-prototypes -std=gnu99 -Wdeclaration-after-statement -Werror -O6
+#
+# Include saner warnings here, which can catch bugs:
+#
+
+EXTRA_WARNINGS := -Wcast-align
+EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wformat
+EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wformat-security
+EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wformat-y2k
+EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wshadow
+EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Winit-self
+EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wpacked
+EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wredundant-decls
+EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wstack-protector
+EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wstrict-aliasing=3
+EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wswitch-default
+EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wswitch-enum
+EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wno-system-headers
+EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wundef
+EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wvolatile-register-var
+EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wwrite-strings
+EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wbad-function-cast
+EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wmissing-declarations
+EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wmissing-prototypes
+EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wnested-externs
+EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wold-style-definition
+EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wstrict-prototypes
+EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wdeclaration-after-statement
+
+CFLAGS = $(M64) -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 -fstack-protector-all -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS)
 LDFLAGS = -lpthread -lrt -lelf -lm
 ALL_CFLAGS = $(CFLAGS)
 ALL_LDFLAGS = $(LDFLAGS)
@@ -310,6 +338,7 @@ LIB_H += util/sigchain.h
 LIB_H += util/symbol.h
 LIB_H += util/module.h
 LIB_H += util/color.h
+LIB_H += util/values.h
 
 LIB_OBJS += util/abspath.o
 LIB_OBJS += util/alias.o
@@ -337,6 +366,13 @@ LIB_OBJS += util/color.o
 LIB_OBJS += util/pager.o
 LIB_OBJS += util/header.o
 LIB_OBJS += util/callchain.o
+LIB_OBJS += util/values.o
+LIB_OBJS += util/debug.o
+LIB_OBJS += util/map.o
+LIB_OBJS += util/thread.o
+LIB_OBJS += util/trace-event-parse.o
+LIB_OBJS += util/trace-event-read.o
+LIB_OBJS += util/trace-event-info.o
 
 BUILTIN_OBJS += builtin-annotate.o
 BUILTIN_OBJS += builtin-help.o
@@ -345,6 +381,7 @@ BUILTIN_OBJS += builtin-record.o
 BUILTIN_OBJS += builtin-report.o
 BUILTIN_OBJS += builtin-stat.o
 BUILTIN_OBJS += builtin-top.o
+BUILTIN_OBJS += builtin-trace.o
 
 PERFLIBS = $(LIB_FILE)
 
tools/perf/builtin-annotate.c +55 -417

690 lines not on this page · raw message

tools/perf/builtin-help.c +1 -0
index 2599d86..4fb8734 100644
@@ -456,6 +456,7 @@ int cmd_help(int argc, const char **argv, const char *prefix __used)
 		break;
 	case HELP_FORMAT_WEB:
 		show_html_page(argv[0]);
+	default:
 		break;
 	}
 
tools/perf/builtin-record.c +18 -20
index 89a5ddc..99a12fe 100644
@@ -15,6 +15,9 @@
 #include "util/string.h"
 
 #include "util/header.h"
+#include "util/event.h"
+#include "util/debug.h"
+#include "util/trace-event.h"
 
 #include <unistd.h>
 #include <sched.h>
@@ -42,7 +45,6 @@ static int			inherit				= 1;
 static int			force				= 0;
 static int			append_file			= 0;
 static int			call_graph			= 0;
-static int			verbose				= 0;
 static int			inherit_stat			= 0;
 static int			no_samples			= 0;
 static int			sample_address			= 0;
@@ -62,24 +64,6 @@ static int			file_new = 1;
 
 struct perf_header		*header;
 
-struct mmap_event {
-	struct perf_event_header	header;
-	u32				pid;
-	u32				tid;
-	u64				start;
-	u64				len;
-	u64				pgoff;
-	char				filename[PATH_MAX];
-};
-
-struct comm_event {
-	struct perf_event_header	header;
-	u32				pid;
-	u32				tid;
-	char				comm[16];
-};
-
-
 struct mmap_data {
 	int			counter;
 	void			*base;
@@ -419,8 +403,11 @@ static void create_counter(int counter, int cpu, pid_t pid)
 	if (call_graph)
 		attr->sample_type	|= PERF_SAMPLE_CALLCHAIN;
 
-	if (raw_samples)
+	if (raw_samples) {
+		attr->sample_type	|= PERF_SAMPLE_TIME;
 		attr->sample_type	|= PERF_SAMPLE_RAW;
+		attr->sample_type	|= PERF_SAMPLE_CPU;
+	}
 
 	attr->mmap		= track;
 	attr->comm		= track;
@@ -563,6 +550,17 @@ static int __cmd_record(int argc, const char **argv)
 	else
 		header = perf_header__new();
 
+
+	if (raw_samples) {
+		read_tracing_data(attrs, nr_counters);
+	} else {
+		for (i = 0; i < nr_counters; i++) {
+			if (attrs[i].sample_type & PERF_SAMPLE_RAW) {
+				read_tracing_data(attrs, nr_counters);
+				break;
+			}
+		}
+	}
 	atexit(atexit_header);
 
 	if (!system_wide) {
tools/perf/builtin-report.c +136 -583

605 lines not on this page · raw message

tools/perf/builtin-stat.c +94 -145

239 lines not on this page · raw message

tools/perf/builtin-top.c +29 -37

66 lines not on this page · raw message

tools/perf/builtin-trace.c new file +297 -0

297 lines not on this page · raw message

tools/perf/builtin.h +1 -0
index 51d1682..3a63e41 100644

Lines of this file are not shown. View the raw message.

tools/perf/perf.c +1 -0
index 31982ad..fe4589d 100644

Lines of this file are not shown. View the raw message.

tools/perf/util/abspath.c +2 -1
index 61d33b8..a791dd4 100644

Lines of this file are not shown. View the raw message.

tools/perf/util/cache.h +0 -1
index 4b50c41..6f8ea9d 100644

Lines of this file are not shown. View the raw message.

tools/perf/util/callchain.c +2 -0
index 0114734..3b8380f 100644

Lines of this file are not shown. View the raw message.

tools/perf/util/callchain.h +1 -0
index a926ae4..43cf3ea 100644

Lines of this file are not shown. View the raw message.

tools/perf/util/color.c +10 -6
index 90a044d..e88bca5 100644

Lines of this file are not shown. View the raw message.

tools/perf/util/color.h +2 -1
index 706cec5..58d5975 100644

Lines of this file are not shown. View the raw message.

tools/perf/util/config.c +13 -9
index 780df54..8784649 100644

Lines of this file are not shown. View the raw message.

tools/perf/util/debug.c new file +95 -0

95 lines not on this page · raw message

tools/perf/util/debug.h new file +8 -0
new file mode 100644
index 0000000..437eea5

Lines of this file are not shown. View the raw message.

tools/perf/util/event.h new file +96 -0

96 lines not on this page · raw message

tools/perf/util/exec_cmd.c +0 -1
index 34a3528..2745605 100644

Lines of this file are not shown. View the raw message.

tools/perf/util/header.c +36 -1
index b92a457..ec4d4c2 100644

Lines of this file are not shown. View the raw message.

tools/perf/util/header.h +4 -0
index bf28044..5d0a72e 100644

Lines of this file are not shown. View the raw message.

tools/perf/util/map.c new file +97 -0

97 lines not on this page · raw message

tools/perf/util/module.c +2 -2
index ddabe92..3d567fe 100644

Lines of this file are not shown. View the raw message.

tools/perf/util/parse-events.c +88 -51

139 lines not on this page · raw message

tools/perf/util/parse-events.h +14 -3
index 192a962..60704c1 100644

Lines of this file are not shown. View the raw message.

tools/perf/util/parse-options.c +22 -0
index 1bf6719..6d8af48 100644

Lines of this file are not shown. View the raw message.

tools/perf/util/path.c +15 -10
index a501a40..fd1f2fa 100644

Lines of this file are not shown. View the raw message.

tools/perf/util/run-command.c +3 -3
index a393534..2b615ac 100644

Lines of this file are not shown. View the raw message.

tools/perf/util/symbol.c +149 -50

199 lines not on this page · raw message

tools/perf/util/symbol.h +13 -1
index b53bf01..6e84907 100644

Lines of this file are not shown. View the raw message.

tools/perf/util/thread.c new file +175 -0

175 lines not on this page · raw message

tools/perf/util/thread.h new file +21 -0
new file mode 100644
index 0000000..634f280

Lines of this file are not shown. View the raw message.

tools/perf/util/trace-event-info.c new file +539 -0

539 lines not on this page · raw message

tools/perf/util/trace-event-parse.c new file +2942 -0

2,942 lines not on this page · raw message

tools/perf/util/trace-event-read.c new file +512 -0

512 lines not on this page · raw message

tools/perf/util/trace-event.h new file +240 -0

240 lines not on this page · raw message

tools/perf/util/util.h +2 -4
index 68fe157..9de2329 100644

Lines of this file are not shown. View the raw message.

tools/perf/util/values.c new file +230 -0

230 lines not on this page · raw message

tools/perf/util/values.h new file +27 -0
new file mode 100644
index 0000000..cadf8cf

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Part of the diff is not shown here. View the raw message.