linux-IllusionX/tools
Jiri Olsa f6fb0960f9 perf metric: Add recursion check when processing nested metrics
Keeping the stack of nested metrics via 'struct expr_id' objects
and checking if we are in recursion via already processed metric.

The stack is implemented as static array within the struct egroup
with 100 entries, which should be enough nesting depth for any
metric we have or plan to have at the moment.

Adding test that simulates the recursion and checks we can
detect it.

Committer notes:

Bumped RECURSION_ID_MAX to 1000 as per Jiri's reply to Paul Clark on the
patch series e-mail discussion.

Fixed these:

  tests/parse-metric.c:308:7: error: missing field 'val' initializer [-Werror,-Wmissing-field-initializers]
                  { 0 },
                      ^

  util/metricgroup.c:924:28: error: missing field 'parent' initializer [-Werror,-Wmissing-field-initializers]
          struct expr_ids ids = { 0 };
                                    ^
  util/metricgroup.c:924:26: error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces]
          struct expr_ids ids = { 0 };
                                  ^
                                  {}
  util/metricgroup.c:924:26: error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces]
          struct expr_ids ids = { 0 };
                                  ^
                                  {}
  util/metricgroup.c:924:28: error: missing field 'cnt' initializer [-Werror,-Wmissing-field-initializers]
          struct expr_ids ids = { 0 };
                                    ^

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Reviewed-by: Kajol Jain <kjain@linux.ibm.com>
Acked-by: Ian Rogers <irogers@google.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: John Garry <john.garry@huawei.com>
Cc: Michael Petlan <mpetlan@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Clarke <pc@us.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lore.kernel.org/lkml/20200719181320.785305-16-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2020-07-30 07:01:49 -03:00
..
accounting
arch tools arch: Update arch/x86/lib/memcpy_64.S copy used in 'perf bench mem memcpy' 2020-07-03 08:11:16 -03:00
bootconfig tools/bootconfig: Add testcase for show-command and quotes test 2020-06-16 21:21:03 -04:00
bpf tools, bpftool: Add ringbuf map type to map command docs 2020-06-17 17:52:30 +02:00
build perf build: Remove libaudit from the default feature checks 2020-05-29 16:51:13 -03:00
cgroup
debugging
edid
firewire
firmware
gpio
hv
iio
include perf tools: Add support for PERF_RECORD_KSYMBOL_TYPE_OOL 2020-07-10 08:30:25 -03:00
io_uring
kvm/kvm_stat
laptop
leds
lib libperf: Avoid counting of nonfilterable fdarray fds 2020-07-21 09:53:22 -03:00
memory-model
nfsd
objtool Peter Zijlstra says: 2020-06-28 10:16:15 -07:00
pci
pcmcia
perf perf metric: Add recursion check when processing nested metrics 2020-07-30 07:01:49 -03:00
power Merge branch 'acpica' 2020-06-10 17:27:28 +02:00
scripts
spi spi: tools: Make default_tx/rx and input_tx static 2020-06-11 16:27:24 +01:00
testing A series of fixes for x86: 2020-07-05 12:23:49 -07:00
thermal/tmon
time
usb
virtio tools/virtio: Use tools/include/list.h instead of stubs 2020-06-22 12:34:22 -04:00
vm tools/vm/page_owner_sort.c: filter out unneeded line 2020-06-03 20:09:49 -07:00
wmi
Makefile