Re: [RFC PATCH 0/4] perf: Correlating user process data to samples

2024-04-11 Thread Ian Rogers
On Thu, Apr 11, 2024 at 5:17 PM Beau Belgrave wrote: > > In the Open Telemetry profiling SIG [1], we are trying to find a way to > grab a tracing association quickly on a per-sample basis. The team at > Elastic has a bespoke way to do this [2], however, I'd like to see a > more general way to

Re: [PATCH v1 0/4] perf parse-regs: Cleanup config and building

2024-02-14 Thread Ian Rogers
build perf register functions > perf parse-regs: Introduce a weak function arch__sample_reg_masks() > perf build: Cleanup perf register configuration Thanks Leo, this is great cleanup! Series: Reviewed-by: Ian Rogers Ian > tools/perf/Makefile.config| 25 -

[PATCH] perf arm64: Fix off-by-one directory paths.

2021-04-16 Thread Ian Rogers
Relative path include works in the regular build due to -I paths but may break in other situations. Signed-off-by: Ian Rogers --- tools/perf/arch/arm64/util/kvm-stat.c | 4 ++-- tools/perf/arch/arm64/util/pmu.c | 4 ++-- tools/perf/arch/arm64/util/unwind-libunwind.c | 4

Re: [RFC] Improve workload error in 'perf record'

2021-04-14 Thread Ian Rogers
On Wed, Apr 14, 2021 at 6:16 AM Arnaldo Carvalho de Melo wrote: > > Hi, > > Please take a look, > > Best regards, Acked-by: Ian Rogers Having been confused by this for a case in the past, thanks! It'd be nice for code coverage's sake to have a shell test on

[PATCH] perf arm-spe: Avoid potential buffer overrun.

2021-04-07 Thread Ian Rogers
SPE extended headers are >1 byte so ensure the buffer contains at least this before reading. This issue was detected by fuzzing. Signed-off-by: Ian Rogers --- tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/p

Re: [PATCH v2 1/6] perf metricgroup: Make find_metric() public with name change

2021-04-01 Thread Ian Rogers
On Thu, Mar 25, 2021 at 3:38 AM John Garry wrote: > > Function find_metric() is required for the metric processing in the > pmu-events testcase, so make it public. Also change the name to include > "metricgroup". Would it make more sense as "pmu_events_map__find_metric" ? Thanks, Ian >

Re: [PATCH v3 04/21] x86/insn: Add an insn_decode() API

2021-03-24 Thread Ian Rogers
On Wed, Mar 24, 2021 at 6:54 AM Borislav Petkov wrote: > > On Wed, Mar 24, 2021 at 10:43:20AM -0300, Arnaldo Carvalho de Melo wrote: > > Borislav, was this addressed? Ian? > > Yap: > > https://git.kernel.org/tip/0705ef64d1ff52b817e278ca6e28095585ff31e1 Tested on PPC and ARM64 fwiw. Thanks, Ian

Re: [PATCH RFC v2 8/8] selftests/perf: Add kselftest for remove_on_exec

2021-03-22 Thread Ian Rogers
On Mon, Mar 22, 2021 at 6:24 AM Marco Elver wrote: > > On Wed, Mar 10, 2021 at 11:41AM +0100, Marco Elver wrote: > > Add kselftest to test that remove_on_exec removes inherited events from > > child tasks. > > > > Signed-off-by: Marco Elver > > To make compatible with more recent libc, we'll

Re: linux-next: build failure after merge of the tip tree

2021-03-17 Thread Ian Rogers
| ^~~~ > > Restore the relative include paths so that the compiler can find the > headers. > > Fixes: 93281c4a9657 ("x86/insn: Add an insn_decode() API") > Reported-by: Ian Rogers > Reported-by: Stephen Rothwell > NOT-Signed-off-by: Bori

Re: [PATCH v3 04/21] x86/insn: Add an insn_decode() API

2021-03-16 Thread Ian Rogers
On Thu, Mar 4, 2021 at 9:56 AM Borislav Petkov wrote: > > From: Borislav Petkov > > Users of the instruction decoder should use this to decode instruction > bytes. For that, have insn*() helpers return an int value to denote > success/failure. When there's an error fetching the next insn byte

[PATCH v2 1/3] perf test: Remove unused argument

2021-03-16 Thread Ian Rogers
Remove unused argument from daemon_exit. Signed-off-by: Ian Rogers --- tools/perf/tests/shell/daemon.sh | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/tools/perf/tests/shell/daemon.sh b/tools/perf/tests/shell/daemon.sh index 5ad3ca8d681b..66ad56b4e0a5 100755

[PATCH v2 2/3] perf test: Cleanup daemon if test is interrupted.

2021-03-16 Thread Ian Rogers
Reorder daemon_start and daemon_exit as the trap handler is added in daemon_start referencing daemon_exit. Signed-off-by: Ian Rogers --- tools/perf/tests/shell/daemon.sh | 34 +++- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/tools/perf/tests/shell

[PATCH v2 3/3] perf test: Add 30s timeout for wait for daemon start.

2021-03-16 Thread Ian Rogers
Retry the ping loop upto 600 times, or approximately 30 seconds, to make sure the test does hang at start up. Signed-off-by: Ian Rogers --- tools/perf/tests/shell/daemon.sh | 7 +++ 1 file changed, 7 insertions(+) diff --git a/tools/perf/tests/shell/daemon.sh b/tools/perf/tests/shell

Re: [PATCH 2/3] perf test: Cleanup daemon if test is interrupted.

2021-03-11 Thread Ian Rogers
On Thu, Mar 11, 2021 at 2:38 AM Jiri Olsa wrote: > > On Wed, Mar 10, 2021 at 12:41:17PM -0800, Ian Rogers wrote: > > Reorder daemon_start and daemon_exit as the trap handler is added in > > daemon_start referencing daemon_exit. > > makes sense, minor comments below >

[PATCH 3/3] perf test: Add 30s timeout for wait for daemon start.

2021-03-10 Thread Ian Rogers
Retry the ping loop upto 600 times, or approximately 30 seconds, to make sure the test does hang at start up. Signed-off-by: Ian Rogers --- tools/perf/tests/shell/daemon.sh | 7 +++ 1 file changed, 7 insertions(+) diff --git a/tools/perf/tests/shell/daemon.sh b/tools/perf/tests/shell

[PATCH 1/3] perf test: Remove unused argument

2021-03-10 Thread Ian Rogers
Remove unused argument from daemon_exit. Signed-off-by: Ian Rogers --- tools/perf/tests/shell/daemon.sh | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/tools/perf/tests/shell/daemon.sh b/tools/perf/tests/shell/daemon.sh index 5ad3ca8d681b..66ad56b4e0a5 100755

[PATCH 2/3] perf test: Cleanup daemon if test is interrupted.

2021-03-10 Thread Ian Rogers
Reorder daemon_start and daemon_exit as the trap handler is added in daemon_start referencing daemon_exit. Signed-off-by: Ian Rogers --- tools/perf/tests/shell/daemon.sh | 34 +++- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/tools/perf/tests/shell

[PATCH] perf synthetic events: Avoid write of uninitialized memory.

2021-03-09 Thread Ian Rogers
Account for alignment bytes in the zero-ing memset. Signed-off-by: Ian Rogers --- tools/perf/util/synthetic-events.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/perf/util/synthetic-events.c b/tools/perf/util/synthetic-events.c index b698046ec2db

[PATCH] tools include: Add __sum16 and __wsum definitions.

2021-03-07 Thread Ian Rogers
/types.h then I say it is preferred. Signed-off-by: Ian Rogers --- tools/include/linux/types.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/include/linux/types.h b/tools/include/linux/types.h index e9c5a215837d..6e14a533ab4e 100644 --- a/tools/include/linux/types.h +++ b/tools

[PATCH 1/3] perf skel: Remove some unused variables.

2021-03-06 Thread Ian Rogers
Fixes -Wall warnings. Signed-off-by: Ian Rogers --- tools/perf/util/bpf_skel/bpf_prog_profiler.bpf.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/perf/util/bpf_skel/bpf_prog_profiler.bpf.c b/tools/perf/util/bpf_skel/bpf_prog_profiler.bpf.c index c7cec92d0236

[PATCH 2/3] perf tool: Enable warnings when compiling BPF programs

2021-03-06 Thread Ian Rogers
Add -Wall -Werror when compiling BPF skeletons. Signed-off-by: Ian Rogers --- tools/perf/Makefile.perf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index 5345ac70cd83..f43d2551f3de 100644 --- a/tools/perf/Makefile.perf

[PATCH 3/3] perf bpf: Minor whitespace cleanup.

2021-03-06 Thread Ian Rogers
Missed space after #include. Signed-off-by: Ian Rogers --- tools/perf/util/bpf_counter.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/bpf_counter.h b/tools/perf/util/bpf_counter.h index 2eca210e5dc1..cb9c532e0a07 100644 --- a/tools/perf/util/bpf_counter.h

[PATCH] perf trace: Ensure read cmdlines are null terminated.

2021-02-26 Thread Ian Rogers
Issue detected by address sanitizer. Fixes: cd4ceb63438e (perf util: Save pid-cmdline mapping into tracing header) Signed-off-by: Ian Rogers --- tools/perf/util/trace-event-read.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/perf/util/trace-event-read.c b/tools/perf/util/trace

[PATCH] perf tools: Fix documentation of verbose options

2021-02-26 Thread Ian Rogers
Option doesn't take a value, make sure the man pages agree. For example: $ perf evlist --verbose=1 Error: option `verbose' takes no value Signed-off-by: Ian Rogers --- tools/perf/Documentation/perf-evlist.txt | 2 +- tools/perf/Documentation/perf-ftrace.txt | 4 ++-- tools/perf

Re: [PATCH v2] perf docs: Add man pages to see also

2021-02-22 Thread Ian Rogers
On Thu, Nov 19, 2020 at 10:30 PM Ian Rogers wrote: > > Add all other man pages to the "see also" list except for > perf-script-perl and perf-script-python that are linked to from > perf-script. > > v2. Fix accidentally listing perf-top twice. > > Signed-

[PATCH] perf libperf: Remove unused xyarray.c

2021-02-11 Thread Ian Rogers
Migrated to libperf in: commit 4b247fa7314c ("libperf: Adopt xyarray class from perf") Signed-off-by: Ian Rogers --- tools/perf/util/xyarray.c | 33 - 1 file changed, 33 deletions(-) delete mode 100644 tools/perf/util/xyarray.c diff --git a/tools

[PATCH] perf env: Remove unneeded internal/cpumap inclusions

2021-02-11 Thread Ian Rogers
Minor cleanup. Signed-off-by: Ian Rogers --- tools/perf/bench/epoll-ctl.c | 1 - tools/perf/bench/epoll-wait.c | 1 - tools/perf/bench/futex-hash.c | 1 - tools/perf/bench/futex-lock-pi.c | 1 - tools/perf/bench/futex-requeue.c | 1

Re: [PATCH 2/2] perf parse-events: Break out tracepoint and printing.

2021-02-03 Thread Ian Rogers
On Wed, Feb 3, 2021 at 4:58 PM Arnaldo Carvalho de Melo wrote: > > Em Wed, Feb 03, 2021 at 05:50:24PM -0300, Arnaldo Carvalho de Melo escreveu: > > Em Wed, Feb 03, 2021 at 10:38:41AM -0800, Ian Rogers escreveu: > > > On Wed, Feb 3, 2021 at 8:21 AM Arnaldo Carvalho

Re: [PATCH 2/2] perf parse-events: Break out tracepoint and printing.

2021-02-03 Thread Ian Rogers
On Wed, Feb 3, 2021 at 8:21 AM Arnaldo Carvalho de Melo wrote: > > Em Tue, Feb 02, 2021 at 09:26:59PM -0800, Ian Rogers escreveu: > > Move print_*_events functions out of parse-events.c into a new > > print-events.c. Move tracepoint code into tracepoint.c or > > trace

[PATCH 2/2] perf parse-events: Break out tracepoint and printing.

2021-02-02 Thread Ian Rogers
from parse-events.h. Fix a checkpatch.pl warning on using unsigned rather than unsigned int. Signed-off-by: Ian Rogers --- tools/perf/builtin-list.c | 2 +- tools/perf/builtin-lock.c | 1 + tools/perf/builtin-timechart.c | 1 + tools/perf/builtin-trace.c | 1

[PATCH 1/2] perf trace-event-info: Rename for_each_event.

2021-02-02 Thread Ian Rogers
Avoid a naming conflict with for_each_event with similar code in parse-events.c, rename to for_each_event_tps. Signed-off-by: Ian Rogers --- tools/perf/util/trace-event-info.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/perf/util/trace-event-info.c b

[PATCH] perf parse-events: Remove unnecessary #includes

2021-01-27 Thread Ian Rogers
Minor cleanup motivated by trying to separately fuzz test parse-events. Signed-off-by: Ian Rogers --- tools/perf/util/parse-events.c | 2 -- tools/perf/util/parse-events.l | 1 - 2 files changed, 3 deletions(-) diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index

[PATCH] libperf tests: Avoid uninitialized variable warning.

2021-01-14 Thread Ian Rogers
The variable bf is read (for a write call) without being initialized triggering a memory sanitizer warning. Use bf in the read and switch the write to reading from a string. Signed-off-by: Ian Rogers --- tools/lib/perf/tests/test-evlist.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions

[PATCH 2/2] libperf tests: Fail when failing to get a tracepoint id

2021-01-14 Thread Ian Rogers
Permissions are necessary to get a tracepoint id. Fail the test when the read fails. Signed-off-by: Ian Rogers --- tools/lib/perf/tests/test-evlist.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/lib/perf/tests/test-evlist.c b/tools/lib/perf/tests/test-evlist.c index d913241d4135

[PATCH 1/2] libperf tests: If a test fails return non-zero

2021-01-14 Thread Ian Rogers
If a test fails return -1 rather than 0. This is consistent with the return value in test-cpumap.c Signed-off-by: Ian Rogers --- tools/lib/perf/tests/test-cpumap.c| 2 +- tools/lib/perf/tests/test-evlist.c| 2 +- tools/lib/perf/tests/test-evsel.c | 2 +- tools/lib/perf/tests/test

[PATCH 2/2] tools/bpftool: Add -Wall when building BPF programs

2021-01-13 Thread Ian Rogers
No additional warnings are generated by enabling this, but having it enabled will help avoid regressions. Signed-off-by: Ian Rogers --- tools/bpf/bpftool/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile index

[PATCH 1/2] bpf, libbpf: Avoid unused function warning on bpf_tail_call_static

2021-01-13 Thread Ian Rogers
Add inline to __always_inline making it match the linux/compiler.h. Adding this avoids an unused function warning on bpf_tail_call_static when compining with -Wall. Signed-off-by: Ian Rogers --- tools/lib/bpf/bpf_helpers.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH v7 5/5] perf metric: Don't compute unused events.

2021-01-12 Thread Ian Rogers
the result will be either IDS1 or IDS2 depending on CONST (which may be evaluated from an entire expression), and so IDS1 or IDS2 may be discarded avoiding events from being programmed. - The ids at the end of parsing are added to the context. Signed-off-by: Ian Rogers --- tools/perf/tests/ex

[PATCH v7 3/5] perf metric: Rename expr__find_other.

2021-01-12 Thread Ian Rogers
A later change will remove the notion of other, rename the function to expr__find_ids as this is what it populates. Signed-off-by: Ian Rogers --- tools/perf/tests/expr.c | 26 +- tools/perf/tests/pmu-events.c | 9 - tools/perf/util/expr.c| 4

[PATCH v7 4/5] perf metric: Add utilities to work on ids map.

2021-01-12 Thread Ian Rogers
-off-by: Ian Rogers --- tools/perf/tests/expr.c | 47 ++ tools/perf/util/expr.c | 87 +++-- tools/perf/util/expr.h | 13 ++ 3 files changed, 143 insertions(+), 4 deletions(-) diff --git a/tools/perf/tests/expr.c b/tools/perf/tests

[PATCH v7 2/5] perf metric: Use NAN for missing event IDs.

2021-01-12 Thread Ian Rogers
If during computing a metric an event (id) is missing the parsing aborts. A later patch will make it so that events that aren't used in the output are deliberately omitted, in which case we don't want the abort. Modify the missing ID case to report NAN for these cases. Signed-off-by: Ian Rogers

[PATCH v7 1/5] perf metric: Restructure struct expr_parse_ctx.

2021-01-12 Thread Ian Rogers
and expr__ctx_free to manage expr_parse_ctx memory. Adjust use of struct expr_parse_ctx accordingly. Signed-off-by: Ian Rogers --- tools/perf/tests/expr.c | 81 ++- tools/perf/tests/pmu-events.c | 37 +--- tools/perf/util/expr.c| 39

[PATCH v7 0/5] Don't compute events that won't be used in a metric.

2021-01-12 Thread Ian Rogers
are identical, as we don't need to evaluate the IF condition. v2. is a rebase. Ian Rogers (5): perf metric: Restructure struct expr_parse_ctx. perf metric: Use NAN for missing event IDs. perf metric: Rename expr__find_other. perf metric: Add utilities to work on ids map. perf metric: Don't

[PATCH v6 0/5] Don't compute events that won't be used in a metric.

2021-01-12 Thread Ian Rogers
the IF condition. v2. is a rebase. Ian Rogers (5): perf metric: Restructure struct expr_parse_ctx. perf metric: Use NAN for missing event IDs. perf metric: Rename expr__find_other. perf metric: Add utilities to work on ids map. perf metric: Don't compute unused events. tools/perf/tests/expr.c

[PATCH v6 1/5] perf metric: Restructure struct expr_parse_ctx.

2021-01-12 Thread Ian Rogers
and expr__ctx_free to manage expr_parse_ctx memory. Adjust use of struct expr_parse_ctx accordingly. Signed-off-by: Ian Rogers --- tools/perf/tests/expr.c | 81 ++- tools/perf/tests/pmu-events.c | 37 +--- tools/perf/util/expr.c| 38

[PATCH v6 5/5] perf metric: Don't compute unused events.

2021-01-12 Thread Ian Rogers
the result will be either IDS1 or IDS2 depending on CONST (which may be evaluated from an entire expression), and so IDS1 or IDS2 may be discarded avoiding events from being programmed. - The ids at the end of parsing are added to the context. Signed-off-by: Ian Rogers --- tools/perf/tests/ex

[PATCH v6 3/5] perf metric: Rename expr__find_other.

2021-01-12 Thread Ian Rogers
A later change will remove the notion of other, rename the function to expr__find_ids as this is what it populates. Signed-off-by: Ian Rogers --- tools/perf/tests/expr.c | 26 +- tools/perf/tests/pmu-events.c | 9 - tools/perf/util/expr.c| 4

[PATCH v6 2/5] perf metric: Use NAN for missing event IDs.

2021-01-12 Thread Ian Rogers
If during computing a metric an event (id) is missing the parsing aborts. A later patch will make it so that events that aren't used in the output are deliberately omitted, in which case we don't want the abort. Modify the missing ID case to report NAN for these cases. Signed-off-by: Ian Rogers

[PATCH v6 4/5] perf metric: Add utilities to work on ids map.

2021-01-12 Thread Ian Rogers
-off-by: Ian Rogers --- tools/perf/tests/expr.c | 47 ++ tools/perf/util/expr.c | 87 +++-- tools/perf/util/expr.h | 13 ++ 3 files changed, 143 insertions(+), 4 deletions(-) diff --git a/tools/perf/tests/expr.c b/tools/perf/tests

[PATCH v5 4/5] perf metric: Add utilities to work on ids map.

2020-12-01 Thread Ian Rogers
-off-by: Ian Rogers --- tools/perf/tests/expr.c | 47 ++ tools/perf/util/expr.c | 87 +++-- tools/perf/util/expr.h | 9 + 3 files changed, 139 insertions(+), 4 deletions(-) diff --git a/tools/perf/tests/expr.c b/tools/perf/tests

[PATCH v5 5/5] perf metric: Don't compute unused events.

2020-12-01 Thread Ian Rogers
the result will be either IDS1 or IDS2 depending on CONST (which may be evaluated from an entire expression), and so IDS1 or IDS2 may be discarded avoiding events from being programmed. - The ids at the end of parsing are added to the context. Signed-off-by: Ian Rogers --- tools/perf/tests/ex

[PATCH v5 2/5] perf metric: Use NAN for missing event IDs.

2020-12-01 Thread Ian Rogers
If during computing a metric an event (id) is missing the parsing aborts. A later patch will make it so that events that aren't used in the output are deliberately omitted, in which case we don't want the abort. Modify the missing ID case to report NAN for these cases. Signed-off-by: Ian Rogers

[PATCH v5 1/5] perf metric: Restructure struct expr_parse_ctx.

2020-12-01 Thread Ian Rogers
and expr__ctx_free to manage expr_parse_ctx memory. Adjust use of struct expr_parse_ctx accordingly. Signed-off-by: Ian Rogers --- tools/perf/tests/expr.c | 81 ++- tools/perf/tests/pmu-events.c | 37 +--- tools/perf/util/expr.c| 38

[PATCH v5 3/5] perf metric: Rename expr__find_other.

2020-12-01 Thread Ian Rogers
A later change will remove the notion of other, rename the function to expr__find_ids as this is what it populates. Signed-off-by: Ian Rogers --- tools/perf/tests/expr.c | 26 +- tools/perf/tests/pmu-events.c | 9 - tools/perf/util/expr.c| 4

[PATCH v5 0/5] Don't compute events that won't be used in a metric.

2020-12-01 Thread Ian Rogers
are added and useless frees are replaced by asserts. A new peephole optimization is added for the case CONST IF expr ELSE CONST, where the the constants are identical, as we don't need to evaluate the IF condition. v2. is a rebase. Ian Rogers (5): perf metric: Restructure struct expr_parse_ctx

[PATCH v4 1/5] perf metric: Restructure struct expr_parse_ctx.

2020-12-01 Thread Ian Rogers
and expr__ctx_free to manage expr_parse_ctx memory. Adjust use of struct expr_parse_ctx accordingly. Signed-off-by: Ian Rogers --- tools/perf/tests/expr.c | 81 ++- tools/perf/tests/pmu-events.c | 37 +--- tools/perf/util/expr.c| 38

[PATCH v4 5/5] perf metric: Don't compute unused events.

2020-12-01 Thread Ian Rogers
the result will be either IDS1 or IDS2 depending on CONST (which may be evaluated from an entire expression), and so IDS1 or IDS2 may be discarded avoiding events from being programmed. - The ids at the end of parsing are added to the context. Signed-off-by: Ian Rogers --- tools/perf/tests/ex

[PATCH v4 3/5] perf metric: Rename expr__find_other.

2020-12-01 Thread Ian Rogers
A later change will remove the notion of other, rename the function to expr__find_ids as this is what it populates. Signed-off-by: Ian Rogers --- tools/perf/tests/expr.c | 26 +- tools/perf/tests/pmu-events.c | 9 - tools/perf/util/expr.c| 4

[PATCH v4 4/5] perf metric: Add utilities to work on ids map.

2020-12-01 Thread Ian Rogers
-off-by: Ian Rogers --- tools/perf/tests/expr.c | 47 ++ tools/perf/util/expr.c | 87 +++-- tools/perf/util/expr.h | 9 + 3 files changed, 139 insertions(+), 4 deletions(-) diff --git a/tools/perf/tests/expr.c b/tools/perf/tests

[PATCH v4 2/5] perf metric: Use NAN for missing event IDs.

2020-12-01 Thread Ian Rogers
If during computing a metric an event (id) is missing the parsing aborts. A later patch will make it so that events that aren't used in the output are deliberately omitted, in which case we don't want the abort. Modify the missing ID case to report NAN for these cases. Signed-off-by: Ian Rogers

[PATCH v4 0/5] Don't compute events that won't be used in a metric.

2020-12-01 Thread Ian Rogers
is added for the case CONST IF expr ELSE CONST, where the the constants are identical, as we don't need to evaluate the IF condition. v2. is a rebase. Ian Rogers (5): perf metric: Restructure struct expr_parse_ctx. perf metric: Use NAN for missing event IDs. perf metric: Rename

[PATCH v3 4/5] perf metric: Add utilities to work on ids map.

2020-11-20 Thread Ian Rogers
-off-by: Ian Rogers --- tools/perf/tests/expr.c | 47 ++ tools/perf/util/expr.c | 87 +++-- tools/perf/util/expr.h | 9 + 3 files changed, 139 insertions(+), 4 deletions(-) diff --git a/tools/perf/tests/expr.c b/tools/perf/tests

[PATCH v3 5/5] perf metric: Don't compute unused events.

2020-11-20 Thread Ian Rogers
S1 or IDS2 depending on CONST (which may be evaluated from an entire expression), and so IDS1 or IDS2 may be discarded avoiding events from being programmed. - The ids at the end of parsing are added to the context. Signed-off-by: Ian Rogers --- tools/perf/tests/expr.c | 17 ++ tools/perf/u

[PATCH v3 3/5] perf metric: Rename expr__find_other.

2020-11-20 Thread Ian Rogers
A later change will remove the notion of other, rename the function to expr__find_ids as this is what it populates. Signed-off-by: Ian Rogers --- tools/perf/tests/expr.c | 26 +- tools/perf/tests/pmu-events.c | 9 - tools/perf/util/expr.c| 4

[PATCH v3 2/5] perf metric: Use NAN for missing event IDs.

2020-11-20 Thread Ian Rogers
If during computing a metric an event (id) is missing the parsing aborts. A later patch will make it so that events that aren't used in the output are deliberately omitted, in which case we don't want the abort. Modify the missing ID case to report NAN for these cases. Signed-off-by: Ian Rogers

[PATCH v3 1/5] perf metric: Restructure struct expr_parse_ctx.

2020-11-20 Thread Ian Rogers
and expr__ctx_free to manage expr_parse_ctx memory. Adjust use of struct expr_parse_ctx accordingly. Signed-off-by: Ian Rogers --- tools/perf/tests/expr.c | 81 ++- tools/perf/tests/pmu-events.c | 37 +--- tools/perf/util/expr.c| 38

[PATCH v3 0/5] Don't compute events that won't be used in a metric.

2020-11-20 Thread Ian Rogers
an assignment in patch 2/5. In patch 5/5 additional comments are added and useless frees are replaced by asserts. A new peephole optimization is added for the case CONST IF expr ELSE CONST, where the the constants are identical, as we don't need to evaluate the IF condition. v2. is a rebase. Ian

[PATCH v2] perf docs: Add man pages to see also

2020-11-19 Thread Ian Rogers
Add all other man pages to the "see also" list except for perf-script-perl and perf-script-python that are linked to from perf-script. v2. Fix accidentally listing perf-top twice. Signed-off-by: Ian Rogers --- tools/perf/Documentation/perf.txt | 12 1 file changed, 12

[PATCH] perf docs: Add man pages to see also

2020-11-19 Thread Ian Rogers
Add all other man pages to the "see also" list except for perf-script-perl and perf-script-python that are linked to from perf-script. Signed-off-by: Ian Rogers --- tools/perf/Documentation/perf.txt | 12 1 file changed, 12 insertions(+) diff --git a/tools/perf/Doc

[PATCH v2 1/5] perf metric: Restructure struct expr_parse_ctx.

2020-11-17 Thread Ian Rogers
and expr__ctx_free to manage expr_parse_ctx memory. Adjust use of struct expr_parse_ctx accordingly. Signed-off-by: Ian Rogers --- tools/perf/tests/expr.c | 81 ++- tools/perf/tests/pmu-events.c | 37 +--- tools/perf/util/expr.c| 38

[PATCH v2 5/5] perf metric: Don't compute unused events.

2020-11-17 Thread Ian Rogers
S1 or IDS2 depending on CONST which may be evaluated from an entire expression. - The ids at the end of parsing are added to the context. Signed-off-by: Ian Rogers --- tools/perf/tests/expr.c | 10 ++ tools/perf/util/expr.c | 9 +- tools/perf/util/expr.h | 1 - tools/perf/util/expr.l | 9

[PATCH v2 3/5] perf metric: Rename expr__find_other.

2020-11-17 Thread Ian Rogers
A later change will remove the notion of other, rename the function to expr__find_ids as this is what it populated. Signed-off-by: Ian Rogers --- tools/perf/tests/expr.c | 8 tools/perf/tests/pmu-events.c | 9 - tools/perf/util/expr.c| 4 ++-- tools/perf/util

[PATCH v2 4/5] perf metric: Add utilities to work on ids map.

2020-11-17 Thread Ian Rogers
-off-by: Ian Rogers --- tools/perf/tests/expr.c | 47 ++ tools/perf/util/expr.c | 87 +++-- tools/perf/util/expr.h | 9 + 3 files changed, 139 insertions(+), 4 deletions(-) diff --git a/tools/perf/tests/expr.c b/tools/perf/tests

[PATCH v2 2/5] perf metric: Use NAN for missing event IDs.

2020-11-17 Thread Ian Rogers
If during computing a metric an event (id) is missing the parsing aborts. A later patch will make it so that events that aren't used in the output are deliberately omitted, in which case we don't want the abort. Modify the missing ID case to report NAN for these cases. Signed-off-by: Ian Rogers

[PATCH v2 0/5] Don't compute events that won't be used in a metric.

2020-11-17 Thread Ian Rogers
. is a rebase. Ian Rogers (5): perf metric: Restructure struct expr_parse_ctx. perf metric: Use NAN for missing event IDs. perf metric: Rename expr__find_other. perf metric: Add utilities to work on ids map. perf metric: Don't compute unused events. tools/perf/tests/expr.c | 148

[PATCH] perf test: Fix dwarf unwind for optimized builds.

2020-11-13 Thread Ian Rogers
To ensure the stack frames are on the stack tail calls optimizations need to be inhibited. If your compiler supports an attribute use it, otherwise use an asm volatile barrier. The barrier fix was suggested here: https://lore.kernel.org/lkml/20201028081123.gt2...@hirez.programming.kicks-ass.net/

[PATCH] perf test: Avoid an msan warning in a copied stack.

2020-11-13 Thread Ian Rogers
/libdwfl/frame_unwind.c:648:8 in handle_cfi Signed-off-by: Ian Rogers --- tools/perf/arch/x86/tests/dwarf-unwind.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/tools/perf/arch/x86/tests/dwarf-unwind.c b/tools/perf/arch/x86/tests/dwarf-unwind.c index 4e40402a4f81..478078fb0f22 100644

[PATCH 3/5] perf metric: Rename expr__find_other.

2020-11-12 Thread Ian Rogers
A later change will remove the notion of other, rename the function to expr__find_ids as this is what it populated. Signed-off-by: Ian Rogers --- tools/perf/tests/expr.c | 8 tools/perf/tests/pmu-events.c | 9 - tools/perf/util/expr.c| 4 ++-- tools/perf/util

[PATCH 2/5] perf metric: Use NAN for missing event IDs.

2020-11-12 Thread Ian Rogers
If during computing a metric an event (id) is missing the parsing aborts. A later patch will make it so that events that aren't used in the output are deliberately omitted, in which case we don't want the abort. Modify the missing ID case to report NAN for these cases. Signed-off-by: Ian Rogers

[PATCH 0/5] Don't compute events that won't be used in a metric.

2020-11-12 Thread Ian Rogers
to multiplexing as discussed in this thread: https://lore.kernel.org/lkml/20201110100346.2527031-1-irog...@google.com/ This change modifies expression parsing so that constants are considered when building the set of ids (events) and only events not contributing to a constant value are measured. Ian Rogers

[PATCH 5/5] perf metric: Don't compute unused events.

2020-11-12 Thread Ian Rogers
S1 or IDS2 depending on CONST which may be evaluated from an entire expression. - The ids at the end of parsing are added to the context. Signed-off-by: Ian Rogers --- tools/perf/tests/expr.c | 10 ++ tools/perf/util/expr.c | 9 +- tools/perf/util/expr.h | 1 - tools/perf/util/expr.l | 9

[PATCH 4/5] perf metric: Add utilities to work on ids map.

2020-11-12 Thread Ian Rogers
-off-by: Ian Rogers --- tools/perf/tests/expr.c | 47 ++ tools/perf/util/expr.c | 87 +++-- tools/perf/util/expr.h | 9 + 3 files changed, 139 insertions(+), 4 deletions(-) diff --git a/tools/perf/tests/expr.c b/tools/perf/tests

[PATCH 1/5] perf metric: Restructure struct expr_parse_ctx.

2020-11-12 Thread Ian Rogers
and expr__ctx_free to manage expr_parse_ctx memory. Adjust use of struct expr_parse_ctx accordingly. Signed-off-by: Ian Rogers --- tools/perf/tests/expr.c | 81 ++- tools/perf/tests/pmu-events.c | 37 +--- tools/perf/util/expr.c| 38

[RFC PATCH 03/12] perf topdown-paser: Add a CSV file reader.

2020-11-10 Thread Ian Rogers
From: Sandeep Dasgupta Read a CSV file info a two dimensional vector of vectors. Open parentheses are counted so that expressions like "min(a,b)" aren't split. Escape characters and quotations aren't handled. Co-authored-by: Ian Rogers Signed-off-by: Ian Rogers Signed-off-by: Sandee

[RFC PATCH 09/12] perf topdown-paser: Add code generation API.

2020-11-10 Thread Ian Rogers
From: Sandeep Dasgupta Add API that is called to generate code using all registered targets. Co-authored-by: Stephane Eranian Signed-off-by: Ian Rogers Signed-off-by: Sandeep Dasgupta --- .../topdown-parser/code_gen_target.cpp| 51 .../topdown-parser/code_gen_target.h

[RFC PATCH 07/12] perf topdown-parser: Metric expression parser.

2020-11-10 Thread Ian Rogers
From: Sandeep Dasgupta A parser capable of processing metrics found in TMA_Metrics.csv. Co-authored-by: Ian Rogers Signed-off-by: Ian Rogers Signed-off-by: Sandeep Dasgupta --- .../pmu-events/topdown-parser/expr_parser.y | 224 ++ 1 file changed, 224 insertions(+) create

[RFC PATCH 12/12] perf pmu-events: Topdown parser tool

2020-11-10 Thread Ian Rogers
,edge,any,inv/ (57.17%) 12,383,804,530 cpu/cpu_clk_unhalted.thread_any,edge,any,inv/ (57.12%) 10.159307832 seconds time elapsed Co-authored-by: Stephane Eranian Co-authored-by: Ian Rogers Signed-off-by: Ian

[RFC PATCH 08/12] perf topdown-parser: Add event interface.

2020-11-10 Thread Ian Rogers
From: Sandeep Dasgupta Add an ability to load then query events loaded from json files. Events may be loaded from a single json file, such as on download.01.org/perfmon, are from multiple json files within a directory. Co-authored-by: Ian Rogers Signed-off-by: Ian Rogers Signed-off

[RFC PATCH 10/12] perf topdown-parser: Add json metric code generation.

2020-11-10 Thread Ian Rogers
From: Sandeep Dasgupta Code generation from read in TMA_Metrics.csv to json metric encoding. Signed-off-by: Ian Rogers Signed-off-by: Sandeep Dasgupta --- .../code_gen_target_perf_json.cpp | 546 ++ .../code_gen_target_perf_json.h | 25 + 2 files

[RFC PATCH 02/12] perf topdown-parser: Add utility functions.

2020-11-10 Thread Ian Rogers
From: Sandeep Dasgupta Basic string, ostream and file functions. Co-authored-by: Ian Rogers Signed-off-by: Ian Rogers Signed-off-by: Sandeep Dasgupta --- .../topdown-parser/general_utils.cpp | 173 ++ .../pmu-events/topdown-parser/general_utils.h | 131

[RFC PATCH 11/12] perf topdown-parser: Main driver.

2020-11-10 Thread Ian Rogers
From: Sandeep Dasgupta Invoke the necessary configuration reading and parsing, then code generation. Handles command line arguments. Add a minor README. Co-authored-by: Stephane Eranian Co-authored-by: Ian Rogers Signed-off-by: Ian Rogers Signed-off-by: Sandeep Dasgupta --- tools/perf/pmu

[RFC PATCH 05/12] perf topdown-parser: Add a configuration.

2020-11-10 Thread Ian Rogers
From: Sandeep Dasgupta The configuration.json holds configuration data that will be read into the ConfigurationParameters class in configuration.h. Co-authored-by: Ian Rogers Signed-off-by: Ian Rogers Signed-off-by: Sandeep Dasgupta --- .../topdown-parser/configuration.cpp | 198

[RFC PATCH 04/12] perf topdown-parser: Add a json file reader.

2020-11-10 Thread Ian Rogers
From: Sandeep Dasgupta Wrap jsmn as a "C" library. Add some utilities for working with tokens and to read a vector of tokens. Co-authored-by: Ian Rogers Signed-off-by: Ian Rogers Signed-off-by: Sandeep Dasgupta --- .../pmu-events/topdown-parser/jsmn_extras

[RFC PATCH 06/12] perf topdown-parser: Interface for TMA_Metrics.csv.

2020-11-10 Thread Ian Rogers
From: Sandeep Dasgupta Reads the CSV file then creates an in memory model from the data. Co-authored-by: Stephane Eranian Signed-off-by: Ian Rogers Signed-off-by: Sandeep Dasgupta --- .../topdown-parser/dependence_dag_utils.cpp | 984 ++ .../topdown-parser

[RFC PATCH 00/12] Topdown parser

2020-11-10 Thread Ian Rogers
This RFC is for a new tool that reads TMA_Metrics.csv as found on download.01.org/perfmon and generates metrics and metric groups from it. To show the functionality the TMA_Metrics.csv is downloaded, but an accepted change would most likely include a copy of this file from Intel. With this tool

[RFC PATCH 01/12] perf topdown-parser: Add a simple logging API.

2020-11-10 Thread Ian Rogers
From: Sandeep Dasgupta A logging API that is simpler but inspired by that in abseil. Signed-off-by: Ian Rogers Signed-off-by: Sandeep Dasgupta --- .../perf/pmu-events/topdown-parser/logging.h | 25 +++ 1 file changed, 25 insertions(+) create mode 100644 tools/perf/pmu

Re: [perf metricgroup] fcc9c5243c: perf-sanity-tests.Parse_and_process_metrics.fail

2020-11-03 Thread Ian Rogers
On Tue, Nov 3, 2020 at 6:43 AM John Garry wrote: > > On 20/10/2020 17:53, Ian Rogers wrote: > >>> Thanks for taking a look John. If you want help you can send the > >>> output of "perf test 67 -vvv" to me. It is possible Broadwell has > >>&g

Re: [PATCH v3 9/9] perf mem: Document event type 'ldst'

2020-10-29 Thread Ian Rogers
On Tue, Oct 27, 2020 at 11:39 PM Leo Yan wrote: > > The event type 'ldst' is added for recording both load and store memory > operations, this patch documents for the new event type. > > Signed-off-by: Leo Yan > --- > tools/perf/Documentation/perf-mem.txt | 6 +- > 1 file changed, 5

Re: [PATCH v3 4/9] perf mem: Only initialize memory event for recording

2020-10-29 Thread Ian Rogers
t properly even the machine doesn't support > the memory events. > > Signed-off-by: Leo Yan Acked-by: Ian Rogers Thanks, Ian > --- > tools/perf/builtin-mem.c | 10 +- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/tools/perf/builtin-m

[PATCH v2] libbpf hashmap: Fix undefined behavior in hash_bits

2020-10-29 Thread Ian Rogers
_entry and hashmap__for_each_entry_safe. Suggested-by: Andrii Nakryiko , Signed-off-by: Ian Rogers --- tools/lib/bpf/hashmap.h | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tools/lib/bpf/hashmap.h b/tools/lib/bpf/hashmap.h index d9b385fe808c..10a4c4cd13cf 100644 --- a/tools/lib/bpf/has

  1   2   3   4   5   6   7   >