[PATCH] perf data: Add JSON export

2021-04-06 Thread Nicholas Fraser
This adds a feature to export perf data to JSON. It uses a minimal inline JSON encoding, no external dependencies. Currently it only outputs some headers and sample metadata but it's easily extensible. Use it like this: perf data convert --to-json out.json Signed-off-by: Nicholas F

Re: [PATCH] perf data: Add JSON export

2021-04-06 Thread Nicholas Fraser
Hi Jiri, Thanks again for the review. I've fixed the issues you mentioned. Some notes below: On 2021-04-01 8:15 a.m., Jiri Olsa wrote: > I recall you did not add support for walltime clock, > don't you need it to sync with other events? Not necessarily. As long as the perf recording and the GPU

[PATCH] perf data: Add JSON export

2021-03-31 Thread Nicholas Fraser
>From ddcfd620e7cad4100d0076090c4b39dba8aeead3 Mon Sep 17 00:00:00 2001 From: Nicholas Fraser Date: Wed, 31 Mar 2021 06:10:00 -0400 Subject: [PATCH] perf data: Add JSON export This adds a feature to export perf data to JSON. It uses a minimal inline JSON encoding, no external dependenc

Re: [PATCH] perf data: export to JSON

2021-03-31 Thread Nicholas Fraser
Hi Jiri, Thanks for the review. I've addressed your suggestions; some notes are below. I'll send a new patch. On 2021-03-24 2:20 p.m., Jiri Olsa wrote: > On Wed, Mar 24, 2021 at 09:06:50AM -0400, Nicholas Fraser wrote: >> [...] We use this to import the data into a tool

Re: [PATCH] perf data: export to JSON

2021-03-31 Thread Nicholas Fraser
Hi Arnaldo, Thanks for the review. I'll send a replacement patch with your suggestions. On 2021-03-24 9:30 a.m., Arnaldo Carvalho de Melo wrote: > Do you plan to output the headers too? I think we should, for > completeness. I've added the headers, at least the ones that seemed important or easy

[PATCH] perf data: export to JSON

2021-03-24 Thread Nicholas Fraser
uot;dso": "libc-2.33.so" }, { "ip": "0x7f1e0de0b71c", "symbol": "__wcsmbs_load_conv",

[PATCH] perf buildid-cache: Add test for PE executable

2021-02-24 Thread Nicholas Fraser
>From 9fd0b3889f00ad13662879767d833309d8a035b6 Mon Sep 17 00:00:00 2001 From: Nicholas Fraser Date: Thu, 18 Feb 2021 13:24:03 -0500 Subject: [PATCH] perf buildid-cache: Add test for PE executable This builds on the previous changes to tests/shell/buildid.sh, adding tests for a PE file. It a

Re: [PATCH 2/2] perf buildid-cache: Add test for PE executable

2021-02-24 Thread Nicholas Fraser
On 2021-02-24 8:43 a.m., Jiri Olsa wrote: > On Fri, Feb 19, 2021 at 11:10:34AM -0500, Nicholas Fraser wrote: >> +# the build id must be rearranged into a GUID >> +id=`objcopy -O binary --only-section=.buildid $1 /dev/stdout | \ >> +

[PATCH 2/2] perf buildid-cache: Add test for PE executable

2021-02-19 Thread Nicholas Fraser
an the sed command and anyway it's bash-specific. This uses a hardcoded .exe so we could also just hardcode its GUID but I'd worry about making the tests too inflexible.) Signed-off-by: Nicholas Fraser --- tools/perf/tests/shell/buildid.sh | 43 +++ 1 file ch

[PATCH 1/2] perf archive: Fix filtering of empty build-ids

2021-02-19 Thread Nicholas Fraser
rf buildid-list" never reports an all-zero hash anymore. This fixes "perf-archive" to skip missing build-ids by skipping lines that start with a padding space rather than with zeroes. Signed-off-by: Nicholas Fraser --- tools/perf/perf-archive.sh | 3 +-- 1 file changed, 1 insertion(

Re: [PATCH 1/2] perf report: Remove redundant libbfd checks

2021-02-18 Thread Nicholas Fraser
On 2021-02-18 2:39 p.m., Arnaldo Carvalho de Melo wrote: > you forgot the: > > Signed-off-by: Nicholas Fraser > > I'm adding it, ok? Ah yes sorry about that, to be explicit here it is: Signed-off-by: Nicholas Fraser > > I'm also addressing Jiri&#x

[PATCH] perf buildid-cache: Add test for PE executable

2021-02-18 Thread Nicholas Fraser
an the sed command and anyway it's bash-specific. This uses a hardcoded .exe so we could also just hardcode its GUID but I'd worry about making the tests too inflexible.) Signed-off-by: Nicholas Fraser --- tools/perf/tests/shell/buildid.sh | 43 +++ 1 file ch

[PATCH 2/2] perf buildid-cache: Add test for 16-byte build-id

2021-02-16 Thread Nicholas Fraser
This adds a test for it. Signed-off-by: Nicholas Fraser --- tools/perf/tests/shell/buildid.sh | 6 ++ 1 file changed, 6 insertions(+) diff --git a/tools/perf/tests/shell/buildid.sh b/tools/perf/tests/shell/buildid.sh index 4861a20edee2..de02a23b7c7b 100755 --- a/tools/perf/tests/shell/

[PATCH 1/2] perf report: Remove redundant libbfd checks

2021-02-16 Thread Nicholas Fraser
This removes the redundant checks bfd_check_format() and bfd_target_elf_flavour. They were previously checking different files. Signed-off-by: Nicholas Fraser --- tools/perf/util/symbol.c | 9 - 1 file changed, 9 deletions(-) diff --git a/tools/perf/util/symbol.c b/tools/perf/util

Re: [PATCH 2/2] perf buildid-cache: Add test for 16-byte build-id

2021-02-16 Thread Nicholas Fraser
Sorry, I just realized I forgot to run checkpatch.pl on these; they're missing the --signoff. I'll re-send. On 2021-02-16 3:38 p.m., Nicholas Fraser wrote: > tests/shell/buildid.sh added an ELF executable with an MD5 build-id to > the perf debug cache but did not check whethe

[PATCH 2/2] perf buildid-cache: Add test for 16-byte build-id

2021-02-16 Thread Nicholas Fraser
tests/shell/buildid.sh added an ELF executable with an MD5 build-id to the perf debug cache but did not check whether the object was printed by a subsequent call to "perf buildid-cache -l". It was being omitted from the list. A previous commit fixed the bug that left it out of the list. This adds

[PATCH 1/2] perf report: Remove redundant libbfd checks

2021-02-16 Thread Nicholas Fraser
This removes the redundant checks bfd_check_format() and bfd_target_elf_flavour. They were previously checking different files. --- tools/perf/util/symbol.c | 9 - 1 file changed, 9 deletions(-) diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index 492c873713cc..08f6f57c8

Re: [PATCH 1/4] perf buildid-cache: Don't skip 16-byte build-ids

2021-02-16 Thread Nicholas Fraser
stalled but it would take some pretty large changes to the script. Nick On 2021-02-15 9:31 a.m., Jiri Olsa wrote: > On Wed, Feb 10, 2021 at 02:17:25PM -0500, Nicholas Fraser wrote: >> lsdir_bid_tail_filter() ignored any build-id that wasn't exactly 20 >> bytes. This worked onl

Re: [PATCH 2/4] perf report: Load PE files from debug cache only

2021-02-16 Thread Nicholas Fraser
Oops, you are correct; it is doing these checks twice. Not sure how I missed that. I'll send another patch to fix it. Nick On 2021-02-15 9:36 a.m., Jiri Olsa wrote: > On Wed, Feb 10, 2021 at 02:17:38PM -0500, Nicholas Fraser wrote: >> dso__load_bfd_symbols() attempts to loa

Re: [PATCH 3/4] perf archive: Fix filtering of empty build-ids

2021-02-12 Thread Nicholas Fraser
:29 a.m., Arnaldo Carvalho de Melo wrote: > Em Wed, Feb 10, 2021 at 02:17:49PM -0500, Nicholas Fraser escreveu: >> A non-existent build-id used to be treated as all-zero SHA-1 hash. >> Build-ids are now variable width. A non-existent build-id is an empty >> string and &quo

Re: [PATCH 2/4] perf report: Load PE files from debug cache only

2021-02-12 Thread Nicholas Fraser
file ends up being used. Nick On 2021-02-12 7:28 a.m., Arnaldo Carvalho de Melo wrote: > Em Wed, Feb 10, 2021 at 02:17:38PM -0500, Nicholas Fraser escreveu: >> dso__load_bfd_symbols() attempts to load a DSO at its original path, >> then closes it and loads the file in the

[PATCH 0/4] perf: Fix archive/debugcache PE files

2021-02-10 Thread Nicholas Fraser
ve tried to make the minimal amount of changes to allow 16-byte build-ids to work with a debugcache from a perf archive. I'm new to kernel development so I apologize if I'm doing this incorrectly. Thanks, Nick Nicholas Fraser (4): perf buildid-cache: Don't skip 16-byte build

[PATCH 2/4] perf report: Load PE files from debug cache only

2021-02-10 Thread Nicholas Fraser
cache has been transferred to another machine via "perf archive". This fix makes it only load the file in the debug cache. Signed-off-by: Nicholas Fraser --- tools/perf/util/symbol.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/tools/perf/util/symbol.c b/

[PATCH 4/4] perf report: Fix return value when loading PE DSO

2021-02-10 Thread Nicholas Fraser
dso__load() to return 0 when successfully loading a DSO with libbfd. Signed-off-by: Nicholas Fraser --- tools/perf/util/symbol.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index aa9ae875b995..492c873713cc 100644 --- a

[PATCH 1/4] perf buildid-cache: Don't skip 16-byte build-ids

2021-02-10 Thread Nicholas Fraser
igned-off-by: Nicholas Fraser --- tools/perf/util/build-id.c | 5 +++-- tools/perf/util/build-id.h | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/perf/util/build-id.c b/tools/perf/util/build-id.c index 02df36b30ac5..e32e8f2ff3bd 100644 --- a/tools/perf/util/build

[PATCH 3/4] perf archive: Fix filtering of empty build-ids

2021-02-10 Thread Nicholas Fraser
with a padding space rather than with zeroes. Signed-off-by: Nicholas Fraser --- tools/perf/perf-archive.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/perf/perf-archive.sh b/tools/perf/perf-archive.sh index 0cfb3e2cefef..133f0eddbcc4 100644 --- a/tools/perf/perf-ar