Re: [PATCH v5 10/14] perf tools: Enable indices setting syntax for BPF maps

From: Jiri Olsa
Date: Wed Dec 16 2015 - 06:25:05 EST


On Mon, Dec 14, 2015 at 10:39:19AM +0000, Wang Nan wrote:

SNIP

> # cat /sys/kernel/debug/tracing/trace | grep usleep
> usleep-405 [004] d... 2745423.547822: : 101
> usleep-655 [006] d... 2745434.122814: : 102
> usleep-904 [006] d... 2745439.916264: : 103
> # ./perf record -e './test_bpf_map_3.c/maps:channel.value[all]=104/' usleep 99
> # cat /sys/kernel/debug/tracing/trace | grep usleep
> usleep-405 [004] d... 2745423.547822: : 101
> usleep-655 [006] d... 2745434.122814: : 102
> usleep-904 [006] d... 2745439.916264: : 103
> usleep-1537 [003] d... 2745538.053737: : 104
>
> Error case:
> # ./perf record -e './test_bpf_map_3.c/maps:channel.value[10...1000]=104/' usleep 99
> event syntax error: '..annel.value[10...1000]=104/'
> \___ Index too large
> Hint: Valid config terms:
> maps:[<arraymap>].value<indices>=[value]
> maps:[<eventmap>].event<indices>=[event]
>
> where <indices> is something like [0,3...5] or [all]
> (add -v to see detail)
> Run 'perf list' for a list of valid events
>
> Usage: perf record [<options>] [<command>]
> or: perf record [<options>] -- <command> [<options>]
>
> -e, --event <event> event selector. use 'perf list' to list available events
>
> Signed-off-by: Wang Nan <wangnan0@xxxxxxxxxx>
> Cc: Alexei Starovoitov <ast@xxxxxxxxxx>
> Cc: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
> Cc: Jiri Olsa <jolsa@xxxxxxxxxx>
> Cc: Masami Hiramatsu <masami.hiramatsu.pt@xxxxxxxxxxx>
> Cc: Namhyung Kim <namhyung@xxxxxxxxxx>
> Cc: Zefan Li <lizefan@xxxxxxxxxx>
> Cc: pi3orama@xxxxxxx
> ---
> tools/perf/util/parse-events.c | 5 ++-
> tools/perf/util/parse-events.l | 13 ++++++-
> tools/perf/util/parse-events.y | 85 ++++++++++++++++++++++++++++++++++++++++++

Acked-by: Jiri Olsa <jolsa@xxxxxxxxxx>

thanks,
jirka
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/