* [GIT PULL 00/10] perf/core improvements and fixes
@ 2014-04-08 18:00 Jiri Olsa
2014-04-08 18:00 ` [PATCH 01/10] perf tests: Add thread maps lookup automated tests Jiri Olsa
` (11 more replies)
0 siblings, 12 replies; 13+ messages in thread
From: Jiri Olsa @ 2014-04-08 18:00 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Adrian Hunter, Corey Ashford, David Ahern,
Don Zickus, Frederic Weisbecker, Jiri Olsa, Mike Galbraith,
Namhyung Kim, Paul Mackerras, Peter Zijlstra,
Ramkumar Ramachandra, Stephane Eranian, Steven Rostedt
hi Ingo,
please consider pulling
jirka
The following changes since commit 538592ff0b008237ae88f5ce5fb1247127dc3ce5:
Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2014-03-19 08:05:47 +0100)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git tags/perf-core-for-mingo
for you to fetch changes up to dad45c767443b738232a99c747efaaddbe56855c:
MAINTAINERS: Change e-mail to kernel.org one (2014-04-08 19:39:43 +0200)
----------------------------------------------------------------
perf/core improvements and fixes:
Documentation:
. Fix documentation of invalid 'perf top -s' option (Namhyung Kim)
. Change e-mail to kernel.org one in MAINTAINERS file (Arnaldo Carvalho de Melo)
Developer stuff:
. Disable unwind libraries when libelf isn't found (Arnaldo Carvalho de Melo)
. Add thread maps lookup automated tests (Jiri Olsa)
. Print event name when showing libtraceevent warnings if possible (Namhyung Kim)
. Add --list-cmds to 'kmem', 'mem', 'lock' and 'sched', for use by completion scripts (Ramkumar Ramachandra)
----------------------------------------------------------------
Arnaldo Carvalho de Melo (2):
perf callchains: Disable unwind libraries when libelf isn't found
MAINTAINERS: Change e-mail to kernel.org one
Jiri Olsa (1):
perf tests: Add thread maps lookup automated tests
Namhyung Kim (3):
perf top: Fix documentation of invalid -s option
tools lib traceevent: Print event name when show warning if possible
tools lib traceevent: Do not call warning() directly
Ramkumar Ramachandra (4):
perf kmem: Introduce --list-cmds for use by scripts
perf mem: Introduce --list-cmds for use by scripts
perf lock: Introduce --list-cmds for use by scripts
perf sched: Introduce --list-cmds for use by scripts
MAINTAINERS | 2 +-
tools/lib/traceevent/event-parse.c | 109 +++++++++-------
tools/perf/Documentation/perf-top.txt | 1 -
tools/perf/Makefile.perf | 1 +
tools/perf/builtin-kmem.c | 8 +-
tools/perf/builtin-lock.c | 10 +-
tools/perf/builtin-mem.c | 15 ++-
tools/perf/builtin-sched.c | 10 +-
tools/perf/config/Makefile | 2 +
tools/perf/perf-completion.sh | 4 +-
tools/perf/perf.h | 6 +
tools/perf/tests/builtin-test.c | 4 +
tools/perf/tests/mmap-thread-lookup.c | 233 ++++++++++++++++++++++++++++++++++
tools/perf/tests/tests.h | 1 +
14 files changed, 341 insertions(+), 65 deletions(-)
create mode 100644 tools/perf/tests/mmap-thread-lookup.c
^ permalink raw reply [flat|nested] 13+ messages in thread* [PATCH 01/10] perf tests: Add thread maps lookup automated tests 2014-04-08 18:00 [GIT PULL 00/10] perf/core improvements and fixes Jiri Olsa @ 2014-04-08 18:00 ` Jiri Olsa 2014-04-08 18:01 ` [PATCH 02/10] perf top: Fix documentation of invalid -s option Jiri Olsa ` (10 subsequent siblings) 11 siblings, 0 replies; 13+ messages in thread From: Jiri Olsa @ 2014-04-08 18:00 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Jiri Olsa, Don Zickus, Corey Ashford, David Ahern, Frederic Weisbecker, Namhyung Kim, Paul Mackerras, Peter Zijlstra Adding automated test for memory maps lookup within multiple machines threads. The test creates 4 threads and separated memory maps. It checks that we could use thread__find_addr_map function with thread object based on TID to find memory maps. Signed-off-by: Jiri Olsa <jolsa@redhat.com> Cc: Don Zickus <dzickus@redhat.com> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/n/tip-1l6knzgxco4zd3cp45jk2hsg@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/Makefile.perf | 1 + tools/perf/perf.h | 6 + tools/perf/tests/builtin-test.c | 4 + tools/perf/tests/mmap-thread-lookup.c | 233 ++++++++++++++++++++++++++++++++++ tools/perf/tests/tests.h | 1 + 5 files changed, 245 insertions(+) create mode 100644 tools/perf/tests/mmap-thread-lookup.c diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index 50d875d..667e85a 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -414,6 +414,7 @@ ifeq ($(ARCH),x86) LIB_OBJS += $(OUTPUT)tests/dwarf-unwind.o endif endif +LIB_OBJS += $(OUTPUT)tests/mmap-thread-lookup.o BUILTIN_OBJS += $(OUTPUT)builtin-annotate.o BUILTIN_OBJS += $(OUTPUT)builtin-bench.o diff --git a/tools/perf/perf.h b/tools/perf/perf.h index e18a8b5..1138c41 100644 --- a/tools/perf/perf.h +++ b/tools/perf/perf.h @@ -15,6 +15,9 @@ #ifndef __NR_futex # define __NR_futex 240 #endif +#ifndef __NR_gettid +# define __NR_gettid 224 +#endif #endif #if defined(__x86_64__) @@ -29,6 +32,9 @@ #ifndef __NR_futex # define __NR_futex 202 #endif +#ifndef __NR_gettid +# define __NR_gettid 186 +#endif #endif #ifdef __powerpc__ diff --git a/tools/perf/tests/builtin-test.c b/tools/perf/tests/builtin-test.c index b11bf8a..d947d1a 100644 --- a/tools/perf/tests/builtin-test.c +++ b/tools/perf/tests/builtin-test.c @@ -124,6 +124,10 @@ static struct test { #endif #endif { + .desc = "Test mmap thread lookup", + .func = test__mmap_thread_lookup, + }, + { .func = NULL, }, }; diff --git a/tools/perf/tests/mmap-thread-lookup.c b/tools/perf/tests/mmap-thread-lookup.c new file mode 100644 index 0000000..cb73e1f --- /dev/null +++ b/tools/perf/tests/mmap-thread-lookup.c @@ -0,0 +1,233 @@ +#include <unistd.h> +#include <sys/syscall.h> +#include <sys/types.h> +#include <sys/mman.h> +#include <pthread.h> +#include <stdlib.h> +#include <stdio.h> +#include "debug.h" +#include "tests.h" +#include "machine.h" +#include "thread_map.h" +#include "symbol.h" +#include "thread.h" + +#define THREADS 4 + +static int go_away; + +struct thread_data { + pthread_t pt; + pid_t tid; + void *map; + int ready[2]; +}; + +static struct thread_data threads[THREADS]; + +static int thread_init(struct thread_data *td) +{ + void *map; + + map = mmap(NULL, page_size, + PROT_READ|PROT_WRITE|PROT_EXEC, + MAP_SHARED|MAP_ANONYMOUS, -1, 0); + + if (map == MAP_FAILED) { + perror("mmap failed"); + return -1; + } + + td->map = map; + td->tid = syscall(SYS_gettid); + + pr_debug("tid = %d, map = %p\n", td->tid, map); + return 0; +} + +static void *thread_fn(void *arg) +{ + struct thread_data *td = arg; + ssize_t ret; + int go; + + if (thread_init(td)) + return NULL; + + /* Signal thread_create thread is initialized. */ + ret = write(td->ready[1], &go, sizeof(int)); + if (ret != sizeof(int)) { + pr_err("failed to notify\n"); + return NULL; + } + + while (!go_away) { + /* Waiting for main thread to kill us. */ + usleep(100); + } + + munmap(td->map, page_size); + return NULL; +} + +static int thread_create(int i) +{ + struct thread_data *td = &threads[i]; + int err, go; + + if (pipe(td->ready)) + return -1; + + err = pthread_create(&td->pt, NULL, thread_fn, td); + if (!err) { + /* Wait for thread initialization. */ + ssize_t ret = read(td->ready[0], &go, sizeof(int)); + err = ret != sizeof(int); + } + + close(td->ready[0]); + close(td->ready[1]); + return err; +} + +static int threads_create(void) +{ + struct thread_data *td0 = &threads[0]; + int i, err = 0; + + go_away = 0; + + /* 0 is main thread */ + if (thread_init(td0)) + return -1; + + for (i = 1; !err && i < THREADS; i++) + err = thread_create(i); + + return err; +} + +static int threads_destroy(void) +{ + struct thread_data *td0 = &threads[0]; + int i, err = 0; + + /* cleanup the main thread */ + munmap(td0->map, page_size); + + go_away = 1; + + for (i = 1; !err && i < THREADS; i++) + err = pthread_join(threads[i].pt, NULL); + + return err; +} + +typedef int (*synth_cb)(struct machine *machine); + +static int synth_all(struct machine *machine) +{ + return perf_event__synthesize_threads(NULL, + perf_event__process, + machine, 0); +} + +static int synth_process(struct machine *machine) +{ + struct thread_map *map; + int err; + + map = thread_map__new_by_pid(getpid()); + + err = perf_event__synthesize_thread_map(NULL, map, + perf_event__process, + machine, 0); + + thread_map__delete(map); + return err; +} + +static int mmap_events(synth_cb synth) +{ + struct machines machines; + struct machine *machine; + int err, i; + + /* + * The threads_create will not return before all threads + * are spawned and all created memory map. + * + * They will loop until threads_destroy is called, so we + * can safely run synthesizing function. + */ + TEST_ASSERT_VAL("failed to create threads", !threads_create()); + + machines__init(&machines); + machine = &machines.host; + + dump_trace = verbose > 1 ? 1 : 0; + + err = synth(machine); + + dump_trace = 0; + + TEST_ASSERT_VAL("failed to destroy threads", !threads_destroy()); + TEST_ASSERT_VAL("failed to synthesize maps", !err); + + /* + * All data is synthesized, try to find map for each + * thread object. + */ + for (i = 0; i < THREADS; i++) { + struct thread_data *td = &threads[i]; + struct addr_location al; + struct thread *thread; + + thread = machine__findnew_thread(machine, getpid(), td->tid); + + pr_debug("looking for map %p\n", td->map); + + thread__find_addr_map(thread, machine, + PERF_RECORD_MISC_USER, MAP__FUNCTION, + (u64) (td->map + 1), &al); + + if (!al.map) { + pr_debug("failed, couldn't find map\n"); + err = -1; + break; + } + + pr_debug("map %p, addr %lx\n", al.map, al.map->start); + } + + machine__delete_threads(machine); + machines__exit(&machines); + return err; +} + +/* + * This test creates 'THREADS' number of threads (including + * main thread) and each thread creates memory map. + * + * When threads are created, we synthesize them with both + * (separate tests): + * perf_event__synthesize_thread_map (process based) + * perf_event__synthesize_threads (global) + * + * We test we can find all memory maps via: + * thread__find_addr_map + * + * by using all thread objects. + */ +int test__mmap_thread_lookup(void) +{ + /* perf_event__synthesize_threads synthesize */ + TEST_ASSERT_VAL("failed with sythesizing all", + !mmap_events(synth_all)); + + /* perf_event__synthesize_thread_map synthesize */ + TEST_ASSERT_VAL("failed with sythesizing process", + !mmap_events(synth_process)); + + return 0; +} diff --git a/tools/perf/tests/tests.h b/tools/perf/tests/tests.h index a24795c..6db764c 100644 --- a/tools/perf/tests/tests.h +++ b/tools/perf/tests/tests.h @@ -41,6 +41,7 @@ int test__sample_parsing(void); int test__keep_tracking(void); int test__parse_no_sample_id_all(void); int test__dwarf_unwind(void); +int test__mmap_thread_lookup(void); #if defined(__x86_64__) || defined(__i386__) #ifdef HAVE_DWARF_UNWIND_SUPPORT -- 1.8.3.1 ^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 02/10] perf top: Fix documentation of invalid -s option 2014-04-08 18:00 [GIT PULL 00/10] perf/core improvements and fixes Jiri Olsa 2014-04-08 18:00 ` [PATCH 01/10] perf tests: Add thread maps lookup automated tests Jiri Olsa @ 2014-04-08 18:01 ` Jiri Olsa 2014-04-08 18:01 ` [PATCH 03/10] tools lib traceevent: Print event name when show warning if possible Jiri Olsa ` (9 subsequent siblings) 11 siblings, 0 replies; 13+ messages in thread From: Jiri Olsa @ 2014-04-08 18:01 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, David Ahern, Jiri Olsa, Namhyung Kim, Paul Mackerras, Peter Zijlstra From: Namhyung Kim <namhyung@kernel.org> On perf top, the -s option is used for --sort, but the man page contains invalid documentation of -s option for --sym-annotate. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Cc: David Ahern <dsahern@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung.kim@lge.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1395193578-27098-1-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Jiri Olsa <jolsa@redhat.com> --- tools/perf/Documentation/perf-top.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/perf/Documentation/perf-top.txt b/tools/perf/Documentation/perf-top.txt index cdd8d49..976b00c 100644 --- a/tools/perf/Documentation/perf-top.txt +++ b/tools/perf/Documentation/perf-top.txt @@ -87,7 +87,6 @@ Default is to monitor all CPUS. --realtime=<priority>:: Collect data with this RT SCHED_FIFO priority. --s <symbol>:: --sym-annotate=<symbol>:: Annotate this symbol. -- 1.8.3.1 ^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 03/10] tools lib traceevent: Print event name when show warning if possible 2014-04-08 18:00 [GIT PULL 00/10] perf/core improvements and fixes Jiri Olsa 2014-04-08 18:00 ` [PATCH 01/10] perf tests: Add thread maps lookup automated tests Jiri Olsa 2014-04-08 18:01 ` [PATCH 02/10] perf top: Fix documentation of invalid -s option Jiri Olsa @ 2014-04-08 18:01 ` Jiri Olsa 2014-04-08 18:01 ` [PATCH 04/10] tools lib traceevent: Do not call warning() directly Jiri Olsa ` (8 subsequent siblings) 11 siblings, 0 replies; 13+ messages in thread From: Jiri Olsa @ 2014-04-08 18:01 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Frederic Weisbecker, Jiri Olsa, Namhyung Kim, Peter Zijlstra, Ramkumar Ramachandra, Steven Rostedt From: Namhyung Kim <namhyung@kernel.org> It's sometimes useful to know where the parse failure was occurred. Add do_warning_event() macro to see the failing event. It now shows the messages like below: $ perf test 5 5: parse events tests : Warning: [kvmmmu:kvm_mmu_get_page] bad op token { Warning: [kvmmmu:kvm_mmu_sync_page] bad op token { Warning: [kvmmmu:kvm_mmu_unsync_page] bad op token { Warning: [kvmmmu:kvm_mmu_prepare_zap_page] bad op token { Warning: [kvmmmu:fast_page_fault] function is_writable_pte not defined Warning: [xen:xen_mmu_ptep_modify_prot_commit] function sizeof not defined Warning: [xen:xen_mmu_ptep_modify_prot_start] function sizeof not defined Warning: [xen:xen_mmu_set_pgd] function sizeof not defined Warning: [xen:xen_mmu_set_pud] function sizeof not defined Warning: [xen:xen_mmu_set_pmd] function sizeof not defined ... Signed-off-by: Namhyung Kim <namhyung@kernel.org> Acked-by: Steven Rostedt <rostedt@goodmis.org> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung.kim@lge.com> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Ramkumar Ramachandra <artagnon@gmail.com> Cc: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/r/1395192174-26273-1-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Jiri Olsa <jolsa@redhat.com> --- tools/lib/traceevent/event-parse.c | 103 ++++++++++++++++++++++--------------- 1 file changed, 62 insertions(+), 41 deletions(-) diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c index 1587ea39..33803c0b9 100644 --- a/tools/lib/traceevent/event-parse.c +++ b/tools/lib/traceevent/event-parse.c @@ -50,6 +50,18 @@ static int show_warning = 1; warning(fmt, ##__VA_ARGS__); \ } while (0) +#define do_warning_event(event, fmt, ...) \ + do { \ + if (!show_warning) \ + continue; \ + \ + if (event) \ + warning("[%s:%s] " fmt, event->system, \ + event->name, ##__VA_ARGS__); \ + else \ + warning(fmt, ##__VA_ARGS__); \ + } while (0) + static void init_input_buf(const char *buf, unsigned long long size) { input_buf = buf; @@ -1355,7 +1367,7 @@ static int event_read_fields(struct event_format *event, struct format_field **f } if (!field->type) { - do_warning("%s: no type found", __func__); + do_warning_event(event, "%s: no type found", __func__); goto fail; } field->name = last_token; @@ -1402,7 +1414,7 @@ static int event_read_fields(struct event_format *event, struct format_field **f free_token(token); type = read_token(&token); if (type == EVENT_NONE) { - do_warning("failed to find token"); + do_warning_event(event, "failed to find token"); goto fail; } } @@ -1636,7 +1648,7 @@ process_cond(struct event_format *event, struct print_arg *top, char **tok) right = alloc_arg(); if (!arg || !left || !right) { - do_warning("%s: not enough memory!", __func__); + do_warning_event(event, "%s: not enough memory!", __func__); /* arg will be freed at out_free */ free_arg(left); free_arg(right); @@ -1686,7 +1698,7 @@ process_array(struct event_format *event, struct print_arg *top, char **tok) arg = alloc_arg(); if (!arg) { - do_warning("%s: not enough memory!", __func__); + do_warning_event(event, "%s: not enough memory!", __func__); /* '*tok' is set to top->op.op. No need to free. */ *tok = NULL; return EVENT_ERROR; @@ -1792,7 +1804,7 @@ process_op(struct event_format *event, struct print_arg *arg, char **tok) if (arg->type == PRINT_OP && !arg->op.left) { /* handle single op */ if (token[1]) { - do_warning("bad op token %s", token); + do_warning_event(event, "bad op token %s", token); goto out_free; } switch (token[0]) { @@ -1802,7 +1814,7 @@ process_op(struct event_format *event, struct print_arg *arg, char **tok) case '-': break; default: - do_warning("bad op token %s", token); + do_warning_event(event, "bad op token %s", token); goto out_free; } @@ -1888,7 +1900,7 @@ process_op(struct event_format *event, struct print_arg *arg, char **tok) char *new_atom; if (left->type != PRINT_ATOM) { - do_warning("bad pointer type"); + do_warning_event(event, "bad pointer type"); goto out_free; } new_atom = realloc(left->atom.atom, @@ -1930,7 +1942,7 @@ process_op(struct event_format *event, struct print_arg *arg, char **tok) type = process_array(event, arg, tok); } else { - do_warning("unknown op '%s'", token); + do_warning_event(event, "unknown op '%s'", token); event->flags |= EVENT_FL_FAILED; /* the arg is now the left side */ goto out_free; @@ -1951,7 +1963,7 @@ process_op(struct event_format *event, struct print_arg *arg, char **tok) return type; out_warn_free: - do_warning("%s: not enough memory!", __func__); + do_warning_event(event, "%s: not enough memory!", __func__); out_free: free_token(token); *tok = NULL; @@ -2385,7 +2397,7 @@ process_flags(struct event_format *event, struct print_arg *arg, char **tok) field = alloc_arg(); if (!field) { - do_warning("%s: not enough memory!", __func__); + do_warning_event(event, "%s: not enough memory!", __func__); goto out_free; } @@ -2438,7 +2450,7 @@ process_symbols(struct event_format *event, struct print_arg *arg, char **tok) field = alloc_arg(); if (!field) { - do_warning("%s: not enough memory!", __func__); + do_warning_event(event, "%s: not enough memory!", __func__); goto out_free; } @@ -2477,7 +2489,7 @@ process_hex(struct event_format *event, struct print_arg *arg, char **tok) field = alloc_arg(); if (!field) { - do_warning("%s: not enough memory!", __func__); + do_warning_event(event, "%s: not enough memory!", __func__); goto out_free; } @@ -2492,7 +2504,7 @@ process_hex(struct event_format *event, struct print_arg *arg, char **tok) field = alloc_arg(); if (!field) { - do_warning("%s: not enough memory!", __func__); + do_warning_event(event, "%s: not enough memory!", __func__); *tok = NULL; return EVENT_ERROR; } @@ -2555,7 +2567,7 @@ process_dynamic_array(struct event_format *event, struct print_arg *arg, char ** free_token(token); arg = alloc_arg(); if (!arg) { - do_warning("%s: not enough memory!", __func__); + do_warning_event(event, "%s: not enough memory!", __func__); *tok = NULL; return EVENT_ERROR; } @@ -2614,13 +2626,14 @@ process_paren(struct event_format *event, struct print_arg *arg, char **tok) /* prevous must be an atom */ if (arg->type != PRINT_ATOM) { - do_warning("previous needed to be PRINT_ATOM"); + do_warning_event(event, "previous needed to be PRINT_ATOM"); goto out_free; } item_arg = alloc_arg(); if (!item_arg) { - do_warning("%s: not enough memory!", __func__); + do_warning_event(event, "%s: not enough memory!", + __func__); goto out_free; } @@ -2721,7 +2734,8 @@ process_func_handler(struct event_format *event, struct pevent_function_handler for (i = 0; i < func->nr_args; i++) { farg = alloc_arg(); if (!farg) { - do_warning("%s: not enough memory!", __func__); + do_warning_event(event, "%s: not enough memory!", + __func__); return EVENT_ERROR; } @@ -2792,7 +2806,7 @@ process_function(struct event_format *event, struct print_arg *arg, return process_func_handler(event, func, arg, tok); } - do_warning("function %s not defined", token); + do_warning_event(event, "function %s not defined", token); free_token(token); return EVENT_ERROR; } @@ -2878,7 +2892,7 @@ process_arg_token(struct event_format *event, struct print_arg *arg, case EVENT_ERROR ... EVENT_NEWLINE: default: - do_warning("unexpected type %d", type); + do_warning_event(event, "unexpected type %d", type); return EVENT_ERROR; } *tok = token; @@ -2901,7 +2915,8 @@ static int event_read_print_args(struct event_format *event, struct print_arg ** arg = alloc_arg(); if (!arg) { - do_warning("%s: not enough memory!", __func__); + do_warning_event(event, "%s: not enough memory!", + __func__); return -1; } @@ -3481,11 +3496,12 @@ eval_num_arg(void *data, int size, struct event_format *event, struct print_arg return val; out_warning_op: - do_warning("%s: unknown op '%s'", __func__, arg->op.op); + do_warning_event(event, "%s: unknown op '%s'", __func__, arg->op.op); return 0; out_warning_field: - do_warning("%s: field %s not found", __func__, arg->field.name); + do_warning_event(event, "%s: field %s not found", + __func__, arg->field.name); return 0; } @@ -3591,7 +3607,8 @@ static void print_str_arg(struct trace_seq *s, void *data, int size, } str = malloc(len + 1); if (!str) { - do_warning("%s: not enough memory!", __func__); + do_warning_event(event, "%s: not enough memory!", + __func__); return; } memcpy(str, data + field->offset, len); @@ -3697,7 +3714,8 @@ static void print_str_arg(struct trace_seq *s, void *data, int size, return; out_warning_field: - do_warning("%s: field %s not found", __func__, arg->field.name); + do_warning_event(event, "%s: field %s not found", + __func__, arg->field.name); } static unsigned long long @@ -3742,14 +3760,16 @@ process_defined_func(struct trace_seq *s, void *data, int size, trace_seq_terminate(&str); string = malloc(sizeof(*string)); if (!string) { - do_warning("%s(%d): malloc str", __func__, __LINE__); + do_warning_event(event, "%s(%d): malloc str", + __func__, __LINE__); goto out_free; } string->next = strings; string->str = strdup(str.buffer); if (!string->str) { free(string); - do_warning("%s(%d): malloc str", __func__, __LINE__); + do_warning_event(event, "%s(%d): malloc str", + __func__, __LINE__); goto out_free; } args[i] = (uintptr_t)string->str; @@ -3761,7 +3781,7 @@ process_defined_func(struct trace_seq *s, void *data, int size, * Something went totally wrong, this is not * an input error, something in this code broke. */ - do_warning("Unexpected end of arguments\n"); + do_warning_event(event, "Unexpected end of arguments\n"); goto out_free; } farg = farg->next; @@ -3811,12 +3831,12 @@ static struct print_arg *make_bprint_args(char *fmt, void *data, int size, struc if (!field) { field = pevent_find_field(event, "buf"); if (!field) { - do_warning("can't find buffer field for binary printk"); + do_warning_event(event, "can't find buffer field for binary printk"); return NULL; } ip_field = pevent_find_field(event, "ip"); if (!ip_field) { - do_warning("can't find ip field for binary printk"); + do_warning_event(event, "can't find ip field for binary printk"); return NULL; } pevent->bprint_buf_field = field; @@ -3830,7 +3850,8 @@ static struct print_arg *make_bprint_args(char *fmt, void *data, int size, struc */ args = alloc_arg(); if (!args) { - do_warning("%s(%d): not enough memory!", __func__, __LINE__); + do_warning_event(event, "%s(%d): not enough memory!", + __func__, __LINE__); return NULL; } arg = args; @@ -3896,7 +3917,7 @@ static struct print_arg *make_bprint_args(char *fmt, void *data, int size, struc bptr += vsize; arg = alloc_arg(); if (!arg) { - do_warning("%s(%d): not enough memory!", + do_warning_event(event, "%s(%d): not enough memory!", __func__, __LINE__); goto out_free; } @@ -3919,7 +3940,7 @@ static struct print_arg *make_bprint_args(char *fmt, void *data, int size, struc case 's': arg = alloc_arg(); if (!arg) { - do_warning("%s(%d): not enough memory!", + do_warning_event(event, "%s(%d): not enough memory!", __func__, __LINE__); goto out_free; } @@ -3959,7 +3980,7 @@ get_bprint_format(void *data, int size __maybe_unused, if (!field) { field = pevent_find_field(event, "fmt"); if (!field) { - do_warning("can't find format field for binary printk"); + do_warning_event(event, "can't find format field for binary printk"); return NULL; } pevent->bprint_fmt_field = field; @@ -4003,8 +4024,8 @@ static void print_mac_arg(struct trace_seq *s, int mac, void *data, int size, arg->field.field = pevent_find_any_field(event, arg->field.name); if (!arg->field.field) { - do_warning("%s: field %s not found", - __func__, arg->field.name); + do_warning_event(event, "%s: field %s not found", + __func__, arg->field.name); return; } } @@ -4176,7 +4197,7 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct event case '*': /* The argument is the length. */ if (!arg) { - do_warning("no argument match"); + do_warning_event(event, "no argument match"); event->flags |= EVENT_FL_FAILED; goto out_failed; } @@ -4213,7 +4234,7 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct event case 'X': case 'u': if (!arg) { - do_warning("no argument match"); + do_warning_event(event, "no argument match"); event->flags |= EVENT_FL_FAILED; goto out_failed; } @@ -4223,7 +4244,7 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct event /* should never happen */ if (len > 31) { - do_warning("bad format!"); + do_warning_event(event, "bad format!"); event->flags |= EVENT_FL_FAILED; len = 31; } @@ -4290,13 +4311,13 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct event trace_seq_printf(s, format, (long long)val); break; default: - do_warning("bad count (%d)", ls); + do_warning_event(event, "bad count (%d)", ls); event->flags |= EVENT_FL_FAILED; } break; case 's': if (!arg) { - do_warning("no matching argument"); + do_warning_event(event, "no matching argument"); event->flags |= EVENT_FL_FAILED; goto out_failed; } @@ -4306,7 +4327,7 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct event /* should never happen */ if (len > 31) { - do_warning("bad format!"); + do_warning_event(event, "bad format!"); event->flags |= EVENT_FL_FAILED; len = 31; } -- 1.8.3.1 ^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 04/10] tools lib traceevent: Do not call warning() directly 2014-04-08 18:00 [GIT PULL 00/10] perf/core improvements and fixes Jiri Olsa ` (2 preceding siblings ...) 2014-04-08 18:01 ` [PATCH 03/10] tools lib traceevent: Print event name when show warning if possible Jiri Olsa @ 2014-04-08 18:01 ` Jiri Olsa 2014-04-08 18:01 ` [PATCH 05/10] perf callchains: Disable unwind libraries when libelf isn't found Jiri Olsa ` (7 subsequent siblings) 11 siblings, 0 replies; 13+ messages in thread From: Jiri Olsa @ 2014-04-08 18:01 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Frederic Weisbecker, Jiri Olsa, Namhyung Kim, Peter Zijlstra, Steven Rostedt From: Namhyung Kim <namhyung@kernel.org> The patch 3a3ffa2e82205 ("tools lib traceevent: Report better error message on bad function args") added the error message but it seems there's no reason to call warning() directly. So change it to do_warning_event() to provide event information too. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Acked-by: Steven Rostedt <rostedt@goodmis.org> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung.kim@lge.com> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/r/1395192174-26273-2-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Jiri Olsa <jolsa@redhat.com> --- tools/lib/traceevent/event-parse.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c index 33803c0b9..baec7d8 100644 --- a/tools/lib/traceevent/event-parse.c +++ b/tools/lib/traceevent/event-parse.c @@ -2742,14 +2742,16 @@ process_func_handler(struct event_format *event, struct pevent_function_handler type = process_arg(event, farg, &token); if (i < (func->nr_args - 1)) { if (type != EVENT_DELIM || strcmp(token, ",") != 0) { - warning("Error: function '%s()' expects %d arguments but event %s only uses %d", + do_warning_event(event, + "Error: function '%s()' expects %d arguments but event %s only uses %d", func->name, func->nr_args, event->name, i + 1); goto err; } } else { if (type != EVENT_DELIM || strcmp(token, ")") != 0) { - warning("Error: function '%s()' only expects %d arguments but event %s has more", + do_warning_event(event, + "Error: function '%s()' only expects %d arguments but event %s has more", func->name, func->nr_args, event->name); goto err; } -- 1.8.3.1 ^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 05/10] perf callchains: Disable unwind libraries when libelf isn't found 2014-04-08 18:00 [GIT PULL 00/10] perf/core improvements and fixes Jiri Olsa ` (3 preceding siblings ...) 2014-04-08 18:01 ` [PATCH 04/10] tools lib traceevent: Do not call warning() directly Jiri Olsa @ 2014-04-08 18:01 ` Jiri Olsa 2014-04-08 18:01 ` [PATCH 06/10] perf kmem: Introduce --list-cmds for use by scripts Jiri Olsa ` (6 subsequent siblings) 11 siblings, 0 replies; 13+ messages in thread From: Jiri Olsa @ 2014-04-08 18:01 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Adrian Hunter, David Ahern, Don Zickus, Frederic Weisbecker, Jiri Olsa, Mike Galbraith, Namhyung Kim, Paul Mackerras, Peter Zijlstra, Stephane Eranian From: Arnaldo Carvalho de Melo <acme@redhat.com> I.e. do the same as when NO_LIBELF is explicitely passed in the 'make' command line, fixing this: Auto-detecting system features: ... dwarf: [ OFF ] ... glibc: [ on ] ... gtk2: [ OFF ] ... libaudit: [ OFF ] ... libbfd: [ OFF ] ... libelf: [ OFF ] ... libunwind: [ OFF ] ... libdw-dwarf-unwind: [ OFF ] ... DWARF post unwind library: libdw <SNIP> CC /tmp/build/perf/util/symbol-minimal.o CC /tmp/build/perf/util/unwind-libdw.o arch/x86/util/unwind-libdw.c:1:30: fatal error: elfutils/libdwfl.h: No such file or directory compilation terminated. CC /tmp/build/perf/tests/keep-tracking.o util/unwind-libdw.c:2:28: fatal error: elfutils/libdw.h: No such file or directory compilation terminated. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Don Zickus <dzickus@redhat.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-e39j1yxanltjx4t0msse63ax@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Jiri Olsa <jolsa@redhat.com> --- tools/perf/config/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile index c234182..5a3c452 100644 --- a/tools/perf/config/Makefile +++ b/tools/perf/config/Makefile @@ -278,6 +278,8 @@ else NO_LIBELF := 1 NO_DWARF := 1 NO_DEMANGLE := 1 + NO_LIBUNWIND := 1 + NO_LIBDW_DWARF_UNWIND := 1 else msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]/glibc-static); endif -- 1.8.3.1 ^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 06/10] perf kmem: Introduce --list-cmds for use by scripts 2014-04-08 18:00 [GIT PULL 00/10] perf/core improvements and fixes Jiri Olsa ` (4 preceding siblings ...) 2014-04-08 18:01 ` [PATCH 05/10] perf callchains: Disable unwind libraries when libelf isn't found Jiri Olsa @ 2014-04-08 18:01 ` Jiri Olsa 2014-04-08 18:01 ` [PATCH 07/10] perf mem: " Jiri Olsa ` (5 subsequent siblings) 11 siblings, 0 replies; 13+ messages in thread From: Jiri Olsa @ 2014-04-08 18:01 UTC (permalink / raw) To: Ingo Molnar; +Cc: linux-kernel, Jiri Olsa From: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Acked-by: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Link: http://lkml.kernel.org/r/1394853474-31019-2-git-send-email-artagnon@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Jiri Olsa <jolsa@redhat.com> --- tools/perf/builtin-kmem.c | 8 +++++--- tools/perf/perf-completion.sh | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/tools/perf/builtin-kmem.c b/tools/perf/builtin-kmem.c index 929462a..bd91de0 100644 --- a/tools/perf/builtin-kmem.c +++ b/tools/perf/builtin-kmem.c @@ -756,11 +756,13 @@ int cmd_kmem(int argc, const char **argv, const char *prefix __maybe_unused) OPT_BOOLEAN(0, "raw-ip", &raw_ip, "show raw ip instead of symbol"), OPT_END() }; - const char * const kmem_usage[] = { - "perf kmem [<options>] {record|stat}", + const char *const kmem_subcommands[] = { "record", "stat", NULL }; + const char *kmem_usage[] = { + NULL, NULL }; - argc = parse_options(argc, argv, kmem_options, kmem_usage, 0); + argc = parse_options_subcommand(argc, argv, kmem_options, + kmem_subcommands, kmem_usage, 0); if (!argc) usage_with_options(kmem_usage, kmem_options); diff --git a/tools/perf/perf-completion.sh b/tools/perf/perf-completion.sh index ae3a576..0ef59dd 100644 --- a/tools/perf/perf-completion.sh +++ b/tools/perf/perf-completion.sh @@ -121,8 +121,8 @@ __perf_main () elif [[ $prev == "-e" && "${words[1]}" == @(record|stat|top) ]]; then evts=$($cmd list --raw-dump) __perfcomp_colon "$evts" "$cur" - # List subcommands for 'perf kvm' - elif [[ $prev == "kvm" ]]; then + # List subcommands for perf commands + elif [[ $prev == @(kvm|kmem) ]]; then subcmds=$($cmd $prev --list-cmds) __perfcomp_colon "$subcmds" "$cur" # List long option names -- 1.8.3.1 ^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 07/10] perf mem: Introduce --list-cmds for use by scripts 2014-04-08 18:00 [GIT PULL 00/10] perf/core improvements and fixes Jiri Olsa ` (5 preceding siblings ...) 2014-04-08 18:01 ` [PATCH 06/10] perf kmem: Introduce --list-cmds for use by scripts Jiri Olsa @ 2014-04-08 18:01 ` Jiri Olsa 2014-04-08 18:01 ` [PATCH 08/10] perf lock: " Jiri Olsa ` (4 subsequent siblings) 11 siblings, 0 replies; 13+ messages in thread From: Jiri Olsa @ 2014-04-08 18:01 UTC (permalink / raw) To: Ingo Molnar; +Cc: linux-kernel, David Ahern, Jiri Olsa From: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Acked-by: David Ahern <dsahern@gmail.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Link: http://lkml.kernel.org/r/1394853474-31019-3-git-send-email-artagnon@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Jiri Olsa <jolsa@redhat.com> --- tools/perf/builtin-mem.c | 15 ++++++++------- tools/perf/perf-completion.sh | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/tools/perf/builtin-mem.c b/tools/perf/builtin-mem.c index 2e3ade69..4a1a6c9 100644 --- a/tools/perf/builtin-mem.c +++ b/tools/perf/builtin-mem.c @@ -21,11 +21,6 @@ struct perf_mem { DECLARE_BITMAP(cpu_bitmap, MAX_NR_CPUS); }; -static const char * const mem_usage[] = { - "perf mem [<options>] {record <command> |report}", - NULL -}; - static int __cmd_record(int argc, const char **argv) { int rec_argc, i = 0, j; @@ -220,9 +215,15 @@ int cmd_mem(int argc, const char **argv, const char *prefix __maybe_unused) " between columns '.' is reserved."), OPT_END() }; + const char *const mem_subcommands[] = { "record", "report", NULL }; + const char *mem_usage[] = { + NULL, + NULL + }; + - argc = parse_options(argc, argv, mem_options, mem_usage, - PARSE_OPT_STOP_AT_NON_OPTION); + argc = parse_options_subcommand(argc, argv, mem_options, mem_subcommands, + mem_usage, PARSE_OPT_STOP_AT_NON_OPTION); if (!argc || !(strncmp(argv[0], "rec", 3) || mem_operation)) usage_with_options(mem_usage, mem_options); diff --git a/tools/perf/perf-completion.sh b/tools/perf/perf-completion.sh index 0ef59dd..f44c04b 100644 --- a/tools/perf/perf-completion.sh +++ b/tools/perf/perf-completion.sh @@ -122,7 +122,7 @@ __perf_main () evts=$($cmd list --raw-dump) __perfcomp_colon "$evts" "$cur" # List subcommands for perf commands - elif [[ $prev == @(kvm|kmem) ]]; then + elif [[ $prev == @(kvm|kmem|mem) ]]; then subcmds=$($cmd $prev --list-cmds) __perfcomp_colon "$subcmds" "$cur" # List long option names -- 1.8.3.1 ^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 08/10] perf lock: Introduce --list-cmds for use by scripts 2014-04-08 18:00 [GIT PULL 00/10] perf/core improvements and fixes Jiri Olsa ` (6 preceding siblings ...) 2014-04-08 18:01 ` [PATCH 07/10] perf mem: " Jiri Olsa @ 2014-04-08 18:01 ` Jiri Olsa 2014-04-08 18:01 ` [PATCH 09/10] perf sched: " Jiri Olsa ` (3 subsequent siblings) 11 siblings, 0 replies; 13+ messages in thread From: Jiri Olsa @ 2014-04-08 18:01 UTC (permalink / raw) To: Ingo Molnar; +Cc: linux-kernel, David Ahern, Jiri Olsa From: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Acked-by: David Ahern <dsahern@gmail.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Link: http://lkml.kernel.org/r/1394853474-31019-4-git-send-email-artagnon@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Jiri Olsa <jolsa@redhat.com> --- tools/perf/builtin-lock.c | 10 ++++++---- tools/perf/perf-completion.sh | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/tools/perf/builtin-lock.c b/tools/perf/builtin-lock.c index c852c7a..6148afc 100644 --- a/tools/perf/builtin-lock.c +++ b/tools/perf/builtin-lock.c @@ -961,8 +961,10 @@ int cmd_lock(int argc, const char **argv, const char *prefix __maybe_unused) "perf lock info [<options>]", NULL }; - const char * const lock_usage[] = { - "perf lock [<options>] {record|report|script|info}", + const char *const lock_subcommands[] = { "record", "report", "script", + "info", NULL }; + const char *lock_usage[] = { + NULL, NULL }; const char * const report_usage[] = { @@ -976,8 +978,8 @@ int cmd_lock(int argc, const char **argv, const char *prefix __maybe_unused) for (i = 0; i < LOCKHASH_SIZE; i++) INIT_LIST_HEAD(lockhash_table + i); - argc = parse_options(argc, argv, lock_options, lock_usage, - PARSE_OPT_STOP_AT_NON_OPTION); + argc = parse_options_subcommand(argc, argv, lock_options, lock_subcommands, + lock_usage, PARSE_OPT_STOP_AT_NON_OPTION); if (!argc) usage_with_options(lock_usage, lock_options); diff --git a/tools/perf/perf-completion.sh b/tools/perf/perf-completion.sh index f44c04b..ecedab6 100644 --- a/tools/perf/perf-completion.sh +++ b/tools/perf/perf-completion.sh @@ -122,7 +122,7 @@ __perf_main () evts=$($cmd list --raw-dump) __perfcomp_colon "$evts" "$cur" # List subcommands for perf commands - elif [[ $prev == @(kvm|kmem|mem) ]]; then + elif [[ $prev == @(kvm|kmem|mem|lock) ]]; then subcmds=$($cmd $prev --list-cmds) __perfcomp_colon "$subcmds" "$cur" # List long option names -- 1.8.3.1 ^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 09/10] perf sched: Introduce --list-cmds for use by scripts 2014-04-08 18:00 [GIT PULL 00/10] perf/core improvements and fixes Jiri Olsa ` (7 preceding siblings ...) 2014-04-08 18:01 ` [PATCH 08/10] perf lock: " Jiri Olsa @ 2014-04-08 18:01 ` Jiri Olsa 2014-04-08 18:01 ` [PATCH 10/10] MAINTAINERS: Change e-mail to kernel.org one Jiri Olsa ` (2 subsequent siblings) 11 siblings, 0 replies; 13+ messages in thread From: Jiri Olsa @ 2014-04-08 18:01 UTC (permalink / raw) To: Ingo Molnar; +Cc: linux-kernel, David Ahern, Jiri Olsa From: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Acked-by: David Ahern <dsahern@gmail.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Link: http://lkml.kernel.org/r/1394853474-31019-5-git-send-email-artagnon@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Jiri Olsa <jolsa@redhat.com> --- tools/perf/builtin-sched.c | 10 ++++++---- tools/perf/perf-completion.sh | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c index 9ac0a49..d3fb0ed 100644 --- a/tools/perf/builtin-sched.c +++ b/tools/perf/builtin-sched.c @@ -1713,8 +1713,10 @@ int cmd_sched(int argc, const char **argv, const char *prefix __maybe_unused) "perf sched replay [<options>]", NULL }; - const char * const sched_usage[] = { - "perf sched [<options>] {record|latency|map|replay|script}", + const char *const sched_subcommands[] = { "record", "latency", "map", + "replay", "script", NULL }; + const char *sched_usage[] = { + NULL, NULL }; struct trace_sched_handler lat_ops = { @@ -1736,8 +1738,8 @@ int cmd_sched(int argc, const char **argv, const char *prefix __maybe_unused) for (i = 0; i < ARRAY_SIZE(sched.curr_pid); i++) sched.curr_pid[i] = -1; - argc = parse_options(argc, argv, sched_options, sched_usage, - PARSE_OPT_STOP_AT_NON_OPTION); + argc = parse_options_subcommand(argc, argv, sched_options, sched_subcommands, + sched_usage, PARSE_OPT_STOP_AT_NON_OPTION); if (!argc) usage_with_options(sched_usage, sched_options); diff --git a/tools/perf/perf-completion.sh b/tools/perf/perf-completion.sh index ecedab6..3356984 100644 --- a/tools/perf/perf-completion.sh +++ b/tools/perf/perf-completion.sh @@ -122,7 +122,7 @@ __perf_main () evts=$($cmd list --raw-dump) __perfcomp_colon "$evts" "$cur" # List subcommands for perf commands - elif [[ $prev == @(kvm|kmem|mem|lock) ]]; then + elif [[ $prev == @(kvm|kmem|mem|lock|sched) ]]; then subcmds=$($cmd $prev --list-cmds) __perfcomp_colon "$subcmds" "$cur" # List long option names -- 1.8.3.1 ^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 10/10] MAINTAINERS: Change e-mail to kernel.org one 2014-04-08 18:00 [GIT PULL 00/10] perf/core improvements and fixes Jiri Olsa ` (8 preceding siblings ...) 2014-04-08 18:01 ` [PATCH 09/10] perf sched: " Jiri Olsa @ 2014-04-08 18:01 ` Jiri Olsa [not found] ` <8738hnk3dg.fsf@tassilo.jf.intel.com> 2014-04-10 7:36 ` [GIT PULL v2] " Jiri Olsa 11 siblings, 0 replies; 13+ messages in thread From: Jiri Olsa @ 2014-04-08 18:01 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Adrian Hunter, David Ahern, Don Zickus, Frederic Weisbecker, Jiri Olsa, Mike Galbraith, Namhyung Kim, Paul Mackerras, Peter Zijlstra, Stephane Eranian From: Arnaldo Carvalho de Melo <acme@redhat.com> Leaving ghostprotocols.net for old networking stuff. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Don Zickus <dzickus@redhat.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-jott6d40nkjjc3vvh3vw53lp@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Jiri Olsa <jolsa@redhat.com> --- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 1ecfde1..b06a9a8 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -6678,7 +6678,7 @@ PERFORMANCE EVENTS SUBSYSTEM M: Peter Zijlstra <a.p.zijlstra@chello.nl> M: Paul Mackerras <paulus@samba.org> M: Ingo Molnar <mingo@redhat.com> -M: Arnaldo Carvalho de Melo <acme@ghostprotocols.net> +M: Arnaldo Carvalho de Melo <acme@kernel.org> L: linux-kernel@vger.kernel.org T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git perf/core S: Supported -- 1.8.3.1 ^ permalink raw reply [flat|nested] 13+ messages in thread
[parent not found: <8738hnk3dg.fsf@tassilo.jf.intel.com>]
[parent not found: <CAM9d7ciP4tLUmR-soEKH3nf6=XC5evKGfuQW1fUGA8Z42U3xCg@mail.gmail.com>]
* Re: [GIT PULL 00/10] perf/core improvements and fixes [not found] ` <CAM9d7ciP4tLUmR-soEKH3nf6=XC5evKGfuQW1fUGA8Z42U3xCg@mail.gmail.com> @ 2014-04-09 5:31 ` Ingo Molnar 0 siblings, 0 replies; 13+ messages in thread From: Ingo Molnar @ 2014-04-09 5:31 UTC (permalink / raw) To: Namhyung Kim Cc: Andi Kleen, Jiri Olsa, Peter Zijlstra, Stephane Eranian, Don Zickus, linux-kernel, Thomas Gleixner * Namhyung Kim <namhyung@kernel.org> wrote: > Hi Andi, > > On Wed, Apr 9, 2014 at 4:50 AM, Andi Kleen <andi@firstfloor.org> wrote: > > Jiri Olsa <jolsa@redhat.com> writes: > > > >> hi Ingo, > >> please consider pulling > > > > So who actually maintains perf user space now? > > > > I have at least 4 perf user patchkits/bug fixes pending, but > > Arnaldo hasn't answered any email for weeks. So a bit of background: sloppy, abusive contributors not willing to change get ignored after some time. For example Andi got such a bad track record in the x86 and perf space with me that all your mails go to /dev/null currently. (I only saw this one because Namhyung replied to it.) Andi, as I explained it to you previously, if you want me to merge patches from you then you need to 1) improve the way you work 2) send it to someone who is willing to deal with you and sign off on it and forward it to me. Seems like you managed to burn up your goodwill with Arnaldo as well. You need to find someone else willing to pay the expense of dealing with your passive-aggressive style. Just a quick example of your abuse: for example you know it perfectly well that perf is well maintained, a simple 'git log tools/perf/' will tell you that there's a steady stream of patches going in and that perf contributors are busy. Yet in this mail you actually lie about that: you pretend that you don't know that most Linux maintainers have trouble working with you, you pretend that perf is "unmaintained", you pretend that you don't know who is maintaining it, just to create unfair pressure on Arnaldo ... That kind of approach really sucks, and if you run out of people's patience with petty office tactics like that then you should not fault them, you should fault yourself. Thanks, Ingo ^ permalink raw reply [flat|nested] 13+ messages in thread
* [GIT PULL v2] perf/core improvements and fixes 2014-04-08 18:00 [GIT PULL 00/10] perf/core improvements and fixes Jiri Olsa ` (10 preceding siblings ...) [not found] ` <8738hnk3dg.fsf@tassilo.jf.intel.com> @ 2014-04-10 7:36 ` Jiri Olsa 11 siblings, 0 replies; 13+ messages in thread From: Jiri Olsa @ 2014-04-10 7:36 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Adrian Hunter, Corey Ashford, David Ahern, Don Zickus, Frederic Weisbecker, Mike Galbraith, Namhyung Kim, Paul Mackerras, Peter Zijlstra, Ramkumar Ramachandra, Stephane Eranian, Steven Rostedt hi Ingo, please consider pulling. v2 has fixed SOB chain for following patch: Jiri Olsa (1): perf tests: Add thread maps lookup automated tests no functional change, so not including all patches thanks, jirka The following changes since commit 538592ff0b008237ae88f5ce5fb1247127dc3ce5: Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2014-03-19 08:05:47 +0100) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git tags/perf-core-for-mingo for you to fetch changes up to 5c9313860657577d6f6b3489a04bb097faa0184a: MAINTAINERS: Change e-mail to kernel.org one (2014-04-09 16:55:37 +0200) ---------------------------------------------------------------- perf/core improvements and fixes: Documentation: . Fix documentation of invalid 'perf top -s' option (Namhyung Kim) . Change e-mail to kernel.org one in MAINTAINERS file (Arnaldo Carvalho de Melo) Developer stuff: . Disable unwind libraries when libelf isn't found (Arnaldo Carvalho de Melo) . Add thread maps lookup automated tests (Jiri Olsa) . Print event name when showing libtraceevent warnings if possible (Namhyung Kim) . Add --list-cmds to 'kmem', 'mem', 'lock' and 'sched', for use by completion scripts (Ramkumar +Ramachandra) ---------------------------------------------------------------- Arnaldo Carvalho de Melo (2): perf callchains: Disable unwind libraries when libelf isn't found MAINTAINERS: Change e-mail to kernel.org one Jiri Olsa (1): perf tests: Add thread maps lookup automated tests Namhyung Kim (3): perf top: Fix documentation of invalid -s option tools lib traceevent: Print event name when show warning if possible tools lib traceevent: Do not call warning() directly Ramkumar Ramachandra (4): perf kmem: Introduce --list-cmds for use by scripts perf mem: Introduce --list-cmds for use by scripts perf lock: Introduce --list-cmds for use by scripts perf sched: Introduce --list-cmds for use by scripts MAINTAINERS | 2 +- tools/lib/traceevent/event-parse.c | 109 +++++++++------- tools/perf/Documentation/perf-top.txt | 1 - tools/perf/Makefile.perf | 1 + tools/perf/builtin-kmem.c | 8 +- tools/perf/builtin-lock.c | 10 +- tools/perf/builtin-mem.c | 15 ++- tools/perf/builtin-sched.c | 10 +- tools/perf/config/Makefile | 2 + tools/perf/perf-completion.sh | 4 +- tools/perf/perf.h | 6 + tools/perf/tests/builtin-test.c | 4 + tools/perf/tests/mmap-thread-lookup.c | 233 ++++++++++++++++++++++++++++++++++ tools/perf/tests/tests.h | 1 + 14 files changed, 341 insertions(+), 65 deletions(-) create mode 100644 tools/perf/tests/mmap-thread-lookup.c ^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2014-04-10 7:36 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-08 18:00 [GIT PULL 00/10] perf/core improvements and fixes Jiri Olsa
2014-04-08 18:00 ` [PATCH 01/10] perf tests: Add thread maps lookup automated tests Jiri Olsa
2014-04-08 18:01 ` [PATCH 02/10] perf top: Fix documentation of invalid -s option Jiri Olsa
2014-04-08 18:01 ` [PATCH 03/10] tools lib traceevent: Print event name when show warning if possible Jiri Olsa
2014-04-08 18:01 ` [PATCH 04/10] tools lib traceevent: Do not call warning() directly Jiri Olsa
2014-04-08 18:01 ` [PATCH 05/10] perf callchains: Disable unwind libraries when libelf isn't found Jiri Olsa
2014-04-08 18:01 ` [PATCH 06/10] perf kmem: Introduce --list-cmds for use by scripts Jiri Olsa
2014-04-08 18:01 ` [PATCH 07/10] perf mem: " Jiri Olsa
2014-04-08 18:01 ` [PATCH 08/10] perf lock: " Jiri Olsa
2014-04-08 18:01 ` [PATCH 09/10] perf sched: " Jiri Olsa
2014-04-08 18:01 ` [PATCH 10/10] MAINTAINERS: Change e-mail to kernel.org one Jiri Olsa
[not found] ` <8738hnk3dg.fsf@tassilo.jf.intel.com>
[not found] ` <CAM9d7ciP4tLUmR-soEKH3nf6=XC5evKGfuQW1fUGA8Z42U3xCg@mail.gmail.com>
2014-04-09 5:31 ` [GIT PULL 00/10] perf/core improvements and fixes Ingo Molnar
2014-04-10 7:36 ` [GIT PULL v2] " Jiri Olsa
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox
Powered by JetHome