aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/perf/Makefile.perf1
-rw-r--r--tools/perf/builtin-annotate.c6
-rw-r--r--tools/perf/builtin-bench.c239
-rw-r--r--tools/perf/builtin-diff.c7
-rw-r--r--tools/perf/builtin-inject.c27
-rw-r--r--tools/perf/builtin-report.c24
-rw-r--r--tools/perf/builtin-sched.c44
-rw-r--r--tools/perf/builtin-script.c40
-rw-r--r--tools/perf/builtin-top.c4
-rw-r--r--tools/perf/config/Makefile4
-rw-r--r--tools/perf/tests/hists_link.c2
-rw-r--r--tools/perf/tests/sample-parsing.c4
-rw-r--r--tools/perf/ui/gtk/gtk.h2
-rw-r--r--tools/perf/ui/gtk/progress.c20
-rw-r--r--tools/perf/ui/gtk/setup.c2
-rw-r--r--tools/perf/ui/progress.c32
-rw-r--r--tools/perf/ui/progress.h19
-rw-r--r--tools/perf/ui/tui/progress.c15
-rw-r--r--tools/perf/ui/tui/setup.c3
-rw-r--r--tools/perf/ui/tui/tui.h6
-rw-r--r--tools/perf/util/build-id.c6
-rw-r--r--tools/perf/util/evlist.c14
-rw-r--r--tools/perf/util/hist.c23
-rw-r--r--tools/perf/util/hist.h3
-rw-r--r--tools/perf/util/probe-event.c1
-rw-r--r--tools/perf/util/probe-finder.c133
-rw-r--r--tools/perf/util/probe-finder.h1
-rw-r--r--tools/perf/util/session.c24
-rw-r--r--tools/perf/util/sort.c124
-rw-r--r--tools/perf/util/strfilter.c46
-rw-r--r--tools/perf/util/thread.c72
-rw-r--r--tools/perf/util/util.c2
32 files changed, 560 insertions, 390 deletions
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 326a26e5fc1c..8a9ca3836043 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -487,6 +487,7 @@ ifndef NO_SLANG
487 LIB_OBJS += $(OUTPUT)ui/tui/util.o 487 LIB_OBJS += $(OUTPUT)ui/tui/util.o
488 LIB_OBJS += $(OUTPUT)ui/tui/helpline.o 488 LIB_OBJS += $(OUTPUT)ui/tui/helpline.o
489 LIB_OBJS += $(OUTPUT)ui/tui/progress.o 489 LIB_OBJS += $(OUTPUT)ui/tui/progress.o
490 LIB_H += ui/tui/tui.h
490 LIB_H += ui/browser.h 491 LIB_H += ui/browser.h
491 LIB_H += ui/browsers/map.h 492 LIB_H += ui/browsers/map.h
492 LIB_H += ui/keysyms.h 493 LIB_H += ui/keysyms.h
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index 03cfa592071f..6c5ae57831f6 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -118,11 +118,11 @@ static int hist_entry__tty_annotate(struct hist_entry *he,
118 ann->print_line, ann->full_paths, 0, 0); 118 ann->print_line, ann->full_paths, 0, 0);
119} 119}
120 120
121static void hists__find_annotations(struct hists *self, 121static void hists__find_annotations(struct hists *hists,
122 struct perf_evsel *evsel, 122 struct perf_evsel *evsel,
123 struct perf_annotate *ann) 123 struct perf_annotate *ann)
124{ 124{
125 struct rb_node *nd = rb_first(&self->entries), *next; 125 struct rb_node *nd = rb_first(&hists->entries), *next;
126 int key = K_RIGHT; 126 int key = K_RIGHT;
127 127
128 while (nd) { 128 while (nd) {
@@ -247,7 +247,7 @@ static int __cmd_annotate(struct perf_annotate *ann)
247 247
248 if (nr_samples > 0) { 248 if (nr_samples > 0) {
249 total_nr_samples += nr_samples; 249 total_nr_samples += nr_samples;
250 hists__collapse_resort(hists); 250 hists__collapse_resort(hists, NULL);
251 hists__output_resort(hists); 251 hists__output_resort(hists);
252 252
253 if (symbol_conf.event_group && 253 if (symbol_conf.event_group &&
diff --git a/tools/perf/builtin-bench.c b/tools/perf/builtin-bench.c
index 33af80fa49cf..e47f90cc7b98 100644
--- a/tools/perf/builtin-bench.c
+++ b/tools/perf/builtin-bench.c
@@ -1,21 +1,18 @@
1/* 1/*
2 *
3 * builtin-bench.c 2 * builtin-bench.c
4 * 3 *
5 * General benchmarking subsystem provided by perf 4 * General benchmarking collections provided by perf
6 * 5 *
7 * Copyright (C) 2009, Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp> 6 * Copyright (C) 2009, Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
8 *
9 */ 7 */
10 8
11/* 9/*
10 * Available benchmark collection list:
12 * 11 *
13 * Available subsystem list: 12 * sched ... scheduler and IPC performance
14 * sched ... scheduler and IPC mechanism
15 * mem ... memory access performance 13 * mem ... memory access performance
16 * 14 * numa ... NUMA scheduling and MM performance
17 */ 15 */
18
19#include "perf.h" 16#include "perf.h"
20#include "util/util.h" 17#include "util/util.h"
21#include "util/parse-options.h" 18#include "util/parse-options.h"
@@ -25,112 +22,92 @@
25#include <stdio.h> 22#include <stdio.h>
26#include <stdlib.h> 23#include <stdlib.h>
27#include <string.h> 24#include <string.h>
25#include <sys/prctl.h>
28 26
29struct bench_suite { 27typedef int (*bench_fn_t)(int argc, const char **argv, const char *prefix);
30 const char *name; 28
31 const char *summary; 29struct bench {
32 int (*fn)(int, const char **, const char *); 30 const char *name;
31 const char *summary;
32 bench_fn_t fn;
33}; 33};
34 \
35/* sentinel: easy for help */
36#define suite_all { "all", "Test all benchmark suites", NULL }
37 34
38#ifdef HAVE_LIBNUMA_SUPPORT 35#ifdef HAVE_LIBNUMA_SUPPORT
39static struct bench_suite numa_suites[] = { 36static struct bench numa_benchmarks[] = {
40 { "mem", 37 { "mem", "Benchmark for NUMA workloads", bench_numa },
41 "Benchmark for NUMA workloads", 38 { "all", "Test all NUMA benchmarks", NULL },
42 bench_numa }, 39 { NULL, NULL, NULL }
43 suite_all,
44 { NULL,
45 NULL,
46 NULL }
47}; 40};
48#endif 41#endif
49 42
50static struct bench_suite sched_suites[] = { 43static struct bench sched_benchmarks[] = {
51 { "messaging", 44 { "messaging", "Benchmark for scheduling and IPC", bench_sched_messaging },
52 "Benchmark for scheduler and IPC mechanisms", 45 { "pipe", "Benchmark for pipe() between two processes", bench_sched_pipe },
53 bench_sched_messaging }, 46 { "all", "Test all scheduler benchmarks", NULL },
54 { "pipe", 47 { NULL, NULL, NULL }
55 "Flood of communication over pipe() between two processes",
56 bench_sched_pipe },
57 suite_all,
58 { NULL,
59 NULL,
60 NULL }
61}; 48};
62 49
63static struct bench_suite mem_suites[] = { 50static struct bench mem_benchmarks[] = {
64 { "memcpy", 51 { "memcpy", "Benchmark for memcpy()", bench_mem_memcpy },
65 "Simple memory copy in various ways", 52 { "memset", "Benchmark for memset() tests", bench_mem_memset },
66 bench_mem_memcpy }, 53 { "all", "Test all memory benchmarks", NULL },
67 { "memset", 54 { NULL, NULL, NULL }
68 "Simple memory set in various ways",
69 bench_mem_memset },
70 suite_all,
71 { NULL,
72 NULL,
73 NULL }
74}; 55};
75 56
76struct bench_subsys { 57struct collection {
77 const char *name; 58 const char