[tip:perf/core] perf tools: Robustify detection of clang binary

2017-08-29 Thread tip-bot for David Carrillo-Cisneros
Commit-ID: 3866058ef15b6ae6f4ff48e088428b46bcc43fa1 Gitweb: http://git.kernel.org/tip/3866058ef15b6ae6f4ff48e088428b46bcc43fa1 Author: David Carrillo-Cisneros AuthorDate: Sun, 27 Aug 2017 00:54:40 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 28 Aug 2017 16:44:46 -0300

[tip:perf/core] perf tools: Pass full path of FEATURES_DUMP

2017-08-29 Thread tip-bot for David Carrillo-Cisneros
Commit-ID: 70ff7c6caa2f2cee4a7621f5cb3b73b0a38327f1 Gitweb: http://git.kernel.org/tip/70ff7c6caa2f2cee4a7621f5cb3b73b0a38327f1 Author: David Carrillo-Cisneros AuthorDate: Sun, 27 Aug 2017 00:54:42 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 28 Aug 2017 16:44:46 -0300

[tip:perf/core] tools lib: Allow external definition of CC, AR and LD

2017-08-29 Thread tip-bot for David Carrillo-Cisneros
Commit-ID: 12024aacb0170779cd0b976b06d2e9b1767cf142 Gitweb: http://git.kernel.org/tip/12024aacb0170779cd0b976b06d2e9b1767cf142 Author: David Carrillo-Cisneros AuthorDate: Sun, 27 Aug 2017 00:54:39 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 28 Aug 2017 16:44:45 -0300

[tip:perf/core] perf tools: Allow external definition of flex and bison binary names

2017-08-29 Thread tip-bot for David Carrillo-Cisneros
Commit-ID: 39a59f1e3ea541035637432db39158a461f29146 Gitweb: http://git.kernel.org/tip/39a59f1e3ea541035637432db39158a461f29146 Author: David Carrillo-Cisneros AuthorDate: Sun, 27 Aug 2017 00:54:38 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 28 Aug 2017 16:44:45 -0300

[tip:perf/core] tools build tests: Don't hardcode gcc name

2017-08-29 Thread tip-bot for David Carrillo-Cisneros
Commit-ID: ba5d1a48aab56a2677113d071b5b1446877b9a1a Gitweb: http://git.kernel.org/tip/ba5d1a48aab56a2677113d071b5b1446877b9a1a Author: David Carrillo-Cisneros AuthorDate: Sun, 27 Aug 2017 00:54:37 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 28 Aug 2017 16:44:44 -0300

Re: [PATCH 0/6] perf tools: Minor build fixes

2017-08-28 Thread David Carrillo-Cisneros
On Mon, Aug 28, 2017 at 7:16 AM, Arnaldo Carvalho de Melo wrote: > Em Mon, Aug 28, 2017 at 11:34:21AM +0200, Jiri Olsa escreveu: >> On Sun, Aug 27, 2017 at 12:54:36AM -0700, David Carrillo-Cisneros wrote: >> > Collection of minor fixes to compile with LLVM and >> &

[PATCH] perf tools: Remove BUG_ON char[] to bool implicit conversions

2017-08-28 Thread David Carrillo-Cisneros
error when possible. Signed-off-by: David Carrillo-Cisneros --- tools/perf/builtin-lock.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/tools/perf/builtin-lock.c b/tools/perf/builtin-lock.c index ff98652484a7..55d3997ce194 100644 --- a/tools/perf/builti

[PATCH 4/6] perf tools: Robustify detection of clang binary

2017-08-27 Thread David Carrillo-Cisneros
Prior to this patch, make scripts tested for CLANG with ifeq ($(CC), clang), failing to detect CLANG binaries with different names. Fix it by testing for the existence of __clang__ macro in the list of compiler defined macros. Signed-off-by: David Carrillo-Cisneros --- tools/lib/api/Makefile

[PATCH 2/6] perf tools: Allow external definition of flex and bison binary names

2017-08-27 Thread David Carrillo-Cisneros
Allow user to define flex and bison binary names by passing FLEX and BISON variables. Signed-off-by: David Carrillo-Cisneros --- tools/perf/Makefile.perf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index

[PATCH 6/6] perf tools: Pass full path of FEATURES_DUMP

2017-08-27 Thread David Carrillo-Cisneros
When building with an external FEATURES_DUMP, bpf complains that features dump file is not found. Fix it by passing full file path. Signed-off-by: David Carrillo-Cisneros --- tools/perf/Makefile.perf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/Makefile.perf b

[PATCH 3/6] tools lib: Allow external definition of CC, AR and LD

2017-08-27 Thread David Carrillo-Cisneros
Use already defined values for CC, AR and LD when available. Signed-off-by: David Carrillo-Cisneros --- tools/lib/api/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/lib/api/Makefile b/tools/lib/api/Makefile index eb6e0b36bfc1..2538675731c7 100644 --- a

[PATCH 5/6] perf tools: Remove BUG_ON char[] to bool implicit conversions

2017-08-27 Thread David Carrillo-Cisneros
t and use it instead. Signed-off-by: David Carrillo-Cisneros --- tools/include/linux/kernel.h | 2 ++ tools/perf/builtin-lock.c| 15 ++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/tools/include/linux/kernel.h b/tools/include/linux/kernel.h index 77d2e94ca5df.

[PATCH 0/6] perf tools: Minor build fixes

2017-08-27 Thread David Carrillo-Cisneros
Collection of minor fixes to compile with LLVM and non-standard tool names. David Carrillo-Cisneros (6): tools build tests: Don't hardcode gcc name perf tools: Allow external definition of flex and bison binary names tools lib: Allow external definition of CC, AR and LD perf

[PATCH 1/6] tools build tests: Don't hardcode gcc name

2017-08-27 Thread David Carrillo-Cisneros
Use $(CC) instead of harcoded gcc binary name. Signed-off-by: David Carrillo-Cisneros --- tools/build/tests/ex/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/build/tests/ex/Makefile b/tools/build/tests/ex/Makefile index c50d5782ad5a..027d6c8a58a7 100644 --- a

[tip:perf/core] perf tools: Add EXCLUDE_EXTLIBS and EXTRA_PERFLIBS to makefile

2017-07-26 Thread tip-bot for David Carrillo-Cisneros
Commit-ID: cb281fea4b0a326d2a2104f8ffae2b6895c561fd Gitweb: http://git.kernel.org/tip/cb281fea4b0a326d2a2104f8ffae2b6895c561fd Author: David Carrillo-Cisneros AuthorDate: Tue, 18 Jul 2017 18:18:37 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 25 Jul 2017 11:23:51 -0300

[tip:perf/core] perf annotate: Process tracing data in pipe mode

2017-07-26 Thread tip-bot for David Carrillo-Cisneros
Commit-ID: f4849599086c6462d65543637058c9b55f4803e4 Gitweb: http://git.kernel.org/tip/f4849599086c6462d65543637058c9b55f4803e4 Author: David Carrillo-Cisneros AuthorDate: Tue, 18 Jul 2017 18:18:38 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 25 Jul 2017 11:23:52 -0300

Re: [PATCH] perf tool sort: Use default sort if evlist is empty

2017-07-24 Thread David Carrillo-Cisneros
On Sat, Jul 22, 2017 at 4:09 PM, Namhyung Kim wrote: > On Fri, Jul 21, 2017 at 01:02:50PM -0700, David Carrillo-Cisneros wrote: >> On Fri, Jul 21, 2017 at 12:44 AM, Jiri Olsa wrote: >> > On Thu, Jul 20, 2017 at 10:11:57PM -0700, David Carrillo-Cisneros wrote: >> >&

Re: [PATCH] perf tool sort: Use default sort if evlist is empty

2017-07-21 Thread David Carrillo-Cisneros
On Fri, Jul 21, 2017 at 12:44 AM, Jiri Olsa wrote: > On Thu, Jul 20, 2017 at 10:11:57PM -0700, David Carrillo-Cisneros wrote: >> Fixes bug noted by Jiri in https://lkml.org/lkml/2017/6/13/755 and caused >> by commit d49dadea7862 ("perf tools: Make 'trace' or 't

[PATCH] perf tool sort: Use default sort if evlist is empty

2017-07-20 Thread David Carrillo-Cisneros
yms] [k] context_switch 2.34% sleeplibc-2.19.so [.] __GI___libc_nanosleep 0.11% perf [kernel.kallsyms] [k] __intel_pmu_enable_a Signed-off-by: David Carrillo-Cisneros --- tools/perf/util/evlist.h | 5 + tools/perf/util/sort.c | 2 +- 2 files changed, 6 insertions(+),

[tip:perf/core] perf header: Change FEAT_OP* macros

2017-07-20 Thread tip-bot for David Carrillo-Cisneros
Commit-ID: a4d8c9855a260359655f2a302ee2b231cad379ca Gitweb: http://git.kernel.org/tip/a4d8c9855a260359655f2a302ee2b231cad379ca Author: David Carrillo-Cisneros AuthorDate: Mon, 17 Jul 2017 21:25:46 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 18 Jul 2017 23:14:35 -0300

[tip:perf/core] perf header: Add event desc to pipe-mode header

2017-07-20 Thread tip-bot for David Carrillo-Cisneros
Commit-ID: f9ebdccf2b78e643d1ba2c979fa293c9d1e8ba86 Gitweb: http://git.kernel.org/tip/f9ebdccf2b78e643d1ba2c979fa293c9d1e8ba86 Author: David Carrillo-Cisneros AuthorDate: Mon, 17 Jul 2017 21:25:49 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 18 Jul 2017 23:14:37 -0300

[tip:perf/core] perf tools: Add feature header record to pipe-mode

2017-07-20 Thread tip-bot for David Carrillo-Cisneros
Commit-ID: e9def1b2e74e3d2134133f70d2a84c242446bbe7 Gitweb: http://git.kernel.org/tip/e9def1b2e74e3d2134133f70d2a84c242446bbe7 Author: David Carrillo-Cisneros AuthorDate: Mon, 17 Jul 2017 21:25:48 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 18 Jul 2017 23:14:36 -0300

[tip:perf/core] perf header: Add struct feat_fd for write

2017-07-20 Thread tip-bot for David Carrillo-Cisneros
Commit-ID: ccebbeb6b69e4e172450d32f1059fefd1659ad8c Gitweb: http://git.kernel.org/tip/ccebbeb6b69e4e172450d32f1059fefd1659ad8c Author: David Carrillo-Cisneros AuthorDate: Mon, 17 Jul 2017 21:25:39 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 18 Jul 2017 23:14:31 -0300

[tip:perf/core] perf tool: Add show_feature_header to perf_tool

2017-07-20 Thread tip-bot for David Carrillo-Cisneros
Commit-ID: 114f709e01e62760a6d03de1358188293dfefdda Gitweb: http://git.kernel.org/tip/114f709e01e62760a6d03de1358188293dfefdda Author: David Carrillo-Cisneros AuthorDate: Mon, 17 Jul 2017 21:25:47 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 18 Jul 2017 23:14:36 -0300

[tip:perf/core] perf header: Add a buffer to struct feat_fd

2017-07-20 Thread tip-bot for David Carrillo-Cisneros
Commit-ID: 0b3d34106c18e5d9ebba004f52a2ce8b264c493e Gitweb: http://git.kernel.org/tip/0b3d34106c18e5d9ebba004f52a2ce8b264c493e Author: David Carrillo-Cisneros AuthorDate: Mon, 17 Jul 2017 21:25:45 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 18 Jul 2017 23:14:34 -0300

[tip:perf/core] perf header: Make write_pmu_mappings pipe-mode friendly

2017-07-20 Thread tip-bot for David Carrillo-Cisneros
Commit-ID: a02c39595e40b4c506c78857e24fdb049096 Gitweb: http://git.kernel.org/tip/a02c39595e40b4c506c78857e24fdb049096 Author: David Carrillo-Cisneros AuthorDate: Mon, 17 Jul 2017 21:25:44 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 18 Jul 2017 23:14:34 -0300

[tip:perf/core] perf header: Use struct feat_fd in read header records

2017-07-20 Thread tip-bot for David Carrillo-Cisneros
Commit-ID: 48e5fcea386009fb2515158fdaf8586ce72d86ce Gitweb: http://git.kernel.org/tip/48e5fcea386009fb2515158fdaf8586ce72d86ce Author: David Carrillo-Cisneros AuthorDate: Mon, 17 Jul 2017 21:25:43 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 18 Jul 2017 23:14:33 -0300

[tip:perf/core] perf header: Use struct feat_fd for print

2017-07-20 Thread tip-bot for David Carrillo-Cisneros
Commit-ID: cfc654209e27ecaa36f550a0934f3c78f9c9179f Gitweb: http://git.kernel.org/tip/cfc654209e27ecaa36f550a0934f3c78f9c9179f Author: David Carrillo-Cisneros AuthorDate: Mon, 17 Jul 2017 21:25:40 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 18 Jul 2017 23:14:31 -0300

[tip:perf/core] perf header: Don't pass struct perf_file_section to process_##_feat

2017-07-20 Thread tip-bot for David Carrillo-Cisneros
Commit-ID: 625524572391326b83f906efe02abbaac9debce6 Gitweb: http://git.kernel.org/tip/625524572391326b83f906efe02abbaac9debce6 Author: David Carrillo-Cisneros AuthorDate: Mon, 17 Jul 2017 21:25:42 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 18 Jul 2017 23:14:33 -0300

[tip:perf/core] perf header: Use struct feat_fd to process header records

2017-07-20 Thread tip-bot for David Carrillo-Cisneros
Commit-ID: 1a22275449f4bd6255e24f0c5b6c7fa61b263417 Gitweb: http://git.kernel.org/tip/1a22275449f4bd6255e24f0c5b6c7fa61b263417 Author: David Carrillo-Cisneros AuthorDate: Mon, 17 Jul 2017 21:25:41 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 18 Jul 2017 23:14:32 -0300

[tip:perf/core] perf header: Revamp do_write()

2017-07-20 Thread tip-bot for David Carrillo-Cisneros
Commit-ID: 3b8f51a677ce574f69671e3f7822b4d8f8634ef3 Gitweb: http://git.kernel.org/tip/3b8f51a677ce574f69671e3f7822b4d8f8634ef3 Author: David Carrillo-Cisneros AuthorDate: Mon, 17 Jul 2017 21:25:38 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 18 Jul 2017 23:14:30 -0300

[tip:perf/core] perf header: Encapsulate read and swap

2017-07-20 Thread tip-bot for David Carrillo-Cisneros
Commit-ID: 6200e49423f8023eba54cf0b01076d6f8c0af6ae Gitweb: http://git.kernel.org/tip/6200e49423f8023eba54cf0b01076d6f8c0af6ae Author: David Carrillo-Cisneros AuthorDate: Mon, 17 Jul 2017 21:25:34 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 18 Jul 2017 23:14:27 -0300

[tip:perf/core] perf util: Add const modifier to buf in "writen" function

2017-07-20 Thread tip-bot for David Carrillo-Cisneros
Commit-ID: 7c72440506e2108494bab3b68a4118fa61a9dbf4 Gitweb: http://git.kernel.org/tip/7c72440506e2108494bab3b68a4118fa61a9dbf4 Author: David Carrillo-Cisneros AuthorDate: Mon, 17 Jul 2017 21:25:37 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 18 Jul 2017 23:14:29 -0300

[tip:perf/core] perf header: Fail on write_padded error

2017-07-20 Thread tip-bot for David Carrillo-Cisneros
Commit-ID: 2ff5365d75e164032f64133914046fd6be213d94 Gitweb: http://git.kernel.org/tip/2ff5365d75e164032f64133914046fd6be213d94 Author: David Carrillo-Cisneros AuthorDate: Mon, 17 Jul 2017 21:25:36 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 18 Jul 2017 23:14:29 -0300

[tip:perf/core] perf header: Add PROCESS_STR_FUN macro

2017-07-20 Thread tip-bot for David Carrillo-Cisneros
Commit-ID: dfaa1580efcfb6b9537043ba0447747d7179fb26 Gitweb: http://git.kernel.org/tip/dfaa1580efcfb6b9537043ba0447747d7179fb26 Author: David Carrillo-Cisneros AuthorDate: Mon, 17 Jul 2017 21:25:35 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 18 Jul 2017 23:14:28 -0300

[PATCH 4/4] tools: perf: Fix linker error when libelf config is disabled

2017-07-18 Thread David Carrillo-Cisneros
d. So this patch fixes the linker error by getting rid of unwanted libraries in the linker stage. Fixes: 209045adc2bb ("perf tools: add JVMTI agent library") Acked-by: Jiri Olsa Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Stephane Eranian Signed-off-by: Sudeep Holla Acked-by: Dav

[PATCH 2/4] perf tools: Add EXCLUDE_EXTLIBS and EXTRA_PERFLIBS to makefile

2017-07-18 Thread David Carrillo-Cisneros
libelf: EXCLUDE_EXTLIBS=-lelf EXTRA_PERFLIBS=path/libelf.a Signed-off-by: David Carrillo-Cisneros --- tools/perf/Makefile.perf | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index 5008f51a08a2..100a6c1670c8 100644

[PATCH 0/4] Resubmitted forgotten patches

2017-07-18 Thread David Carrillo-Cisneros
Pickup some small fixes that have been forgotten. David Carrillo-Cisneros (3): perf tool cgroup: Initialize cgroup refcnt with refcount_set perf tools: Add EXCLUDE_EXTLIBS and EXTRA_PERFLIBS to makefile perf annotate: Process tracing data in pipe mode Sudeep Holla (1): tools: perf: Fix

[PATCH 3/4] perf annotate: Process tracing data in pipe mode

2017-07-18 Thread David Carrillo-Cisneros
free sleep 2 | perf annotate -D --stdio ... 0x78 [0xc]: PERF_RECORD_TRACING_DATA: unhandled! ... Signed-off-by: David Carrillo-Cisneros --- tools/perf/builtin-annotate.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c index 52

[PATCH 1/4] perf tool cgroup: Initialize cgroup refcnt with refcount_set

2017-07-18 Thread David Carrillo-Cisneros
-e cycles -C 0 -G / Performance counter stats for 'CPU(s) 0': 17,516,664 cycles / Signed-off-by: David Carrillo-Cisneros Change-Id: I8f00f61aaecce876e7df448bd7f850b20db13ef1 --- tools/perf/util/cgroup.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-)

[PATCH 4/4] tools: perf: Fix linker error when libelf config is disabled

2017-07-18 Thread David Carrillo-Cisneros
d. So this patch fixes the linker error by getting rid of unwanted libraries in the linker stage. Fixes: 209045adc2bb ("perf tools: add JVMTI agent library") Acked-by: Jiri Olsa Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Stephane Eranian Signed-off-by: Sudeep Holla Acked-by: Dav

Re: [PATCH v5 00/16] perf tool: add meta-data header support for pipe-mode

2017-07-17 Thread David Carrillo-Cisneros
On Wed, Jul 12, 2017 at 7:31 AM, Jiri Olsa wrote: > On Tue, Jul 11, 2017 at 04:52:51PM -0700, David Carrillo-Cisneros wrote: >> v5: - Fix buffer leaking and size changes in >> perf_event__synthesize_features. >> - Remove unnecessary renaming. >>

Re: [PATCH v5 00/16] perf tool: add meta-data header support for pipe-mode

2017-07-17 Thread David Carrillo-Cisneros
On Tue, Jul 11, 2017 at 6:39 PM, David Ahern wrote: > On 7/11/17 5:52 PM, David Carrillo-Cisneros wrote: > ... >> (This is a rebased and updated version of Stephane Eranian's version >> in https://patchwork.kernel.org/patch/1499081/) > > ... >> With

Re: [PATCH v4 15/16] perf tools: add feature header record to pipe-mode

2017-07-17 Thread David Carrillo-Cisneros
On Wed, Jul 12, 2017 at 12:38 AM, Jiri Olsa wrote: > On Tue, Jul 11, 2017 at 05:32:40PM -0700, David Carrillo-Cisneros wrote: >> On Tue, Jun 13, 2017 at 11:54 AM, Jiri Olsa wrote: >> > On Mon, Jun 12, 2017 at 09:29:31PM -0700, David Carrillo-Cisneros wrote: >> > >&

[PATCH v6 03/16] perf header: fail on write_padded error

2017-07-17 Thread David Carrillo-Cisneros
Do not proceed if write_padded error failed. Also, add comments to remind that the return value of write_* functions in util/header.c is an erro code and not the number of bytes written. Signed-off-by: David Carrillo-Cisneros --- tools/perf/util/header.c | 6 +- 1 file changed, 5

[PATCH v6 04/16] perf util: add const modifier to buf in "writen" function

2017-07-17 Thread David Carrillo-Cisneros
ter with constant buf argument. Signed-off-by: David Carrillo-Cisneros --- tools/perf/util/util.c | 6 -- tools/perf/util/util.h | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c index 9e4ea852f636..4c360daa4e24 100644 --- a/tool

[PATCH v6 05/16] perf header: revamp do_write

2017-07-17 Thread David Carrillo-Cisneros
Now that writen takes a const buffer, use it in do_write instead of duplicating its functionality. Export do_write to use it consistently in header.c and build_id.c . Signed-off-by: David Carrillo-Cisneros --- tools/perf/util/build-id.c | 2 +- tools/perf/util/header.c | 14

[PATCH v6 06/16] perf header: add struct feat_fd for write

2017-07-17 Thread David Carrillo-Cisneros
Introduce struct feat_fd. This patch uses it as a wrapper around fd in write_* functions for feature headers. Next patches will extend its functionality to other feature header functions. This patch does not change behavior. Signed-off-by: David Carrillo-Cisneros --- tools/perf/util/build-id.c

[PATCH v6 01/16] perf header: encapsulate read and swap

2017-07-17 Thread David Carrillo-Cisneros
Most callers of readn in perf header read either a 32 or a 64 bits number, error check it and swap it, if necessary. Create do_read_u32 and do_read_u64 to simplify these use cases. Signed-off-by: David Carrillo-Cisneros --- tools/perf/util/header.c | 210

[PATCH v6 09/16] perf header: don't pass struct perf_file_section to process_##_feat

2017-07-17 Thread David Carrillo-Cisneros
er on, the same variables can be reused for pipe-mode. This patch does not change behavior. Signed-off-by: David Carrillo-Cisneros --- tools/perf/util/header.c | 58 1 file changed, 24 insertions(+), 34 deletions(-) diff --git a/tools/perf

[PATCH v6 08/16] perf header: use struct feat_fd to process header records

2017-07-17 Thread David Carrillo-Cisneros
As preparation for using header records in pipe-mode, replace int fd with struct feat_fd ff in process functions for all header record types. This patch does not change behavior. Signed-off-by: David Carrillo-Cisneros --- tools/perf/util/header.c | 164

[PATCH v6 11/16] perf header: make write_pmu_mappings pipe-mode friendly

2017-07-17 Thread David Carrillo-Cisneros
In pipe-mode, we will operate over a buffer instead of a file descriptor but write_pmu_mappings uses lseek to move over the perf.data file. Refactor write_pmu_mappings to avoid the usage of lseek and allow reusing the same logic in pipe-mode (next patch). Signed-off-by: David Carrillo-Cisneros

[PATCH v6 15/16] perf tools: add feature header record to pipe-mode

2017-07-17 Thread David Carrillo-Cisneros
= 33, uncore_ha_0 = 16, uncore_cbox [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.000 MB - ] ... Support added for the subcommands: report, inject, annotate and script. Signed-off-by: David Carrillo-Cisneros --- tools/perf/Documentation/perf.data-file-forma

[PATCH v6 10/16] perf header: use struct feat_fd in read header records

2017-07-17 Thread David Carrillo-Cisneros
As preparation for using header records in-pipe mode, replace int fd with struct feat_fd ff in read functions for all header record types. This patch does not change behavior. Signed-off-by: David Carrillo-Cisneros --- tools/perf/util/header.c | 101

[PATCH v6 13/16] perf header: change FEAT_OP* macros

2017-07-17 Thread David Carrillo-Cisneros
be NULLed individually. This allows to define two variations only: - FEAT_OPR: synthesizes auxiliar event record. - FEAT_OPN: doesn't synthesize an auxiliar event record. Signed-off-by: David Carrillo-Cisneros --- tools/perf/util/header.c | 72 +---

[PATCH v6 12/16] perf header: add a buffer to struct feat_fd

2017-07-17 Thread David Carrillo-Cisneros
ng if their functions are called in pipe-mode. Signed-off-by: David Carrillo-Cisneros --- tools/perf/util/header.c | 75 1 file changed, 70 insertions(+), 5 deletions(-) diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index d5359e3

[PATCH v6 07/16] perf header: use struct feat_fd for print

2017-07-17 Thread David Carrillo-Cisneros
As preparation for using header records in pipe mode, replace int fd with struct feat_fd ff in print functions for all header record types. Signed-off-by: David Carrillo-Cisneros --- tools/perf/util/header.c | 102 ++- 1 file changed, 47 insertions

[PATCH v6 16/16] perf header: add event desc to pipe-mode header

2017-07-17 Thread David Carrillo-Cisneros
, uncore_ha_1 = 15, uncore_ubox = 25 [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.000 MB (null) ] Prior to this patch, event was not printed. Signed-off-by: David Carrillo-Cisneros --- tools/perf/util/header.c | 19 +-- 1 file changed, 17

[PATCH v6 14/16] perf tool: add show_feature_header to perf_tool

2017-07-17 Thread David Carrillo-Cisneros
Add show_feat_hdr to control level of printed information of feature headers. Signed-off-by: David Carrillo-Cisneros --- tools/perf/builtin-report.c | 4 tools/perf/builtin-script.c | 3 +++ tools/perf/util/tool.h | 7 +++ 3 files changed, 14 insertions(+) diff --git a/tools/perf

[PATCH v6 02/16] perf header: add PROCESS_STR_FUN macro

2017-07-17 Thread David Carrillo-Cisneros
Simplify code by adding a macro to handle the common case of processing header features that are a simple string. Signed-off-by: David Carrillo-Cisneros --- tools/perf/util/header.c | 65 +--- 1 file changed, 17 insertions(+), 48 deletions(-) diff

[PATCH v6 00/16] perf tool: add meta-data header support for pipe-mode

2017-07-17 Thread David Carrillo-Cisneros
lay # pmu mappings: intel_bts = 6, cpu = 4, msr = 49, uncore_cbox_10 = 36, [SNIP] [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.000 MB - ] ... Only patches 14 to 16 affect user observed behavior. All other are preparatory changes or bug fixes. David C

[PATCH] perf tools probe: update show_line_range arguments

2017-07-16 Thread David Carrillo-Cisneros
commit 801bc8193463 ("perf probe: Allow placing uprobes in alternate namespaces.") did not add the new struct nsinfo argument to show_line_range for the case where HAVE_DWARF_SUPPORT is undefined, giving a compilation error when dwarf is not available. Fix it. Signed-off-by: Davi

Re: [PATCH v4 15/16] perf tools: add feature header record to pipe-mode

2017-07-11 Thread David Carrillo-Cisneros
On Tue, Jun 13, 2017 at 11:54 AM, Jiri Olsa wrote: > On Mon, Jun 12, 2017 at 09:29:31PM -0700, David Carrillo-Cisneros wrote: > > SNIP > >> >> void perf_event__print_totals(void); >> diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c >> ind

[PATCH v5 01/16] perf header: encapsulate read and swap

2017-07-11 Thread David Carrillo-Cisneros
Most callers of readn in perf header read either a 32 or a 64 bits number, error check it and swap it, if necessary. Create do_read_u32 and do_read_u64 to simplify these use cases. Signed-off-by: David Carrillo-Cisneros --- tools/perf/util/header.c | 210

[PATCH v5 04/16] perf util: add const modifier to buf in "writen" function

2017-07-11 Thread David Carrillo-Cisneros
ter with constant buf argument. Signed-off-by: David Carrillo-Cisneros --- tools/perf/util/util.c | 6 -- tools/perf/util/util.h | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c index 28c9f335006c..0d8d7b8b2949 100644 --- a/tool

[PATCH v5 07/16] perf header: use struct feat_fd for print

2017-07-11 Thread David Carrillo-Cisneros
As preparation for using header records in pipe mode, replace int fd with struct feat_fd ff in print functions for all header record types. Signed-off-by: David Carrillo-Cisneros --- tools/perf/util/header.c | 102 ++- 1 file changed, 47 insertions

[PATCH v5 02/16] perf header: add PROCESS_STR_FUN macro

2017-07-11 Thread David Carrillo-Cisneros
Simplify code by adding a macro to handle the common case of processing header features that are a simple string. Signed-off-by: David Carrillo-Cisneros --- tools/perf/util/header.c | 65 +--- 1 file changed, 17 insertions(+), 48 deletions(-) diff

[PATCH v5 09/16] perf header: don't pass struct perf_file_section to process_##_feat

2017-07-11 Thread David Carrillo-Cisneros
er on, the same variables can be reused for pipe-mode. This patch does not change behavior. Signed-off-by: David Carrillo-Cisneros --- tools/perf/util/header.c | 56 1 file changed, 23 insertions(+), 33 deletions(-) diff --git a/tools/perf

[PATCH v5 08/16] perf header: use struct feat_fd to process header records

2017-07-11 Thread David Carrillo-Cisneros
As preparation for using header records in pipe-mode, replace int fd with struct feat_fd ff in process functions for all header record types. This patch does not change behavior. Signed-off-by: David Carrillo-Cisneros --- tools/perf/util/header.c | 164

[PATCH v5 05/16] perf header: revamp do_write

2017-07-11 Thread David Carrillo-Cisneros
Now that writen takes a const buffer, use it in do_write instead of duplicating its functionality. Export do_write to use it consistently in header.c and build_id.c . Signed-off-by: David Carrillo-Cisneros --- tools/perf/util/build-id.c | 2 +- tools/perf/util/header.c | 14

[PATCH v5 06/16] perf header: add struct feat_fd for write

2017-07-11 Thread David Carrillo-Cisneros
Introduce struct feat_fd. This patch uses it as a wrapper around fd in write_* functions for feature headers. Next patches will extend its functionality to other feature header functions. This patch does not change behavior. Signed-off-by: David Carrillo-Cisneros --- tools/perf/util/build-id.c

[PATCH v5 10/16] perf header: use struct feat_fd in read header records

2017-07-11 Thread David Carrillo-Cisneros
As preparation for using header records in-pipe mode, replace int fd with struct feat_fd ff in read functions for all header record types. This patch does not change behavior. Signed-off-by: David Carrillo-Cisneros --- tools/perf/util/header.c | 101

[PATCH v5 03/16] perf header: fail on write_padded error

2017-07-11 Thread David Carrillo-Cisneros
Do not proceed if write_padded error failed. Also, add comments to remind that the return value of write_* functions in util/header.c is an erro code and not the number of bytes written. Signed-off-by: David Carrillo-Cisneros --- tools/perf/util/header.c | 6 +- 1 file changed, 5

[PATCH v5 11/16] perf header: make write_pmu_mappings pipe-mode friendly

2017-07-11 Thread David Carrillo-Cisneros
In pipe-mode, we will operate over a buffer instead of a file descriptor but write_pmu_mappings uses lseek to move over the perf.data file. Refactor write_pmu_mappings to avoid the usage of lseek and allow reusing the same logic in pipe-mode (next patch). Signed-off-by: David Carrillo-Cisneros

[PATCH v5 00/16] perf tool: add meta-data header support for pipe-mode

2017-07-11 Thread David Carrillo-Cisneros
[SNIP] [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.000 MB - ] ... Only patches 14 to 16 have a significant effect in user observed behavior. All other are transparent preparatory changes or bug fixes. David Carrillo-Cisneros (16): perf header: encap

Re: [PATCH v4 00/16] perf tool: add meta-data header support for pipe-mode

2017-06-14 Thread David Carrillo-Cisneros
On Wed, Jun 14, 2017 at 12:20 AM, Jiri Olsa wrote: > On Tue, Jun 13, 2017 at 11:51:43PM -0700, David Carrillo-Cisneros wrote: >> On Tue, Jun 13, 2017 at 11:55 AM, Jiri Olsa wrote: >> > On Mon, Jun 12, 2017 at 09:29:16PM -0700, David Carrillo-Cisneros wrote: >> >> v4

Re: [PATCH v4 00/16] perf tool: add meta-data header support for pipe-mode

2017-06-13 Thread David Carrillo-Cisneros
On Tue, Jun 13, 2017 at 11:55 AM, Jiri Olsa wrote: > On Mon, Jun 12, 2017 at 09:29:16PM -0700, David Carrillo-Cisneros wrote: >> v4: - Limit write_* functions to page_size. >> - Fixed bugs spotted by Jiri. >> - Add information about pipe-mode to some error messages

Re: [PATCH v4 00/16] perf tool: add meta-data header support for pipe-mode

2017-06-13 Thread David Carrillo-Cisneros
On Tue, Jun 13, 2017 at 11:54 AM, Jiri Olsa wrote: > On Mon, Jun 12, 2017 at 09:29:16PM -0700, David Carrillo-Cisneros wrote: >> v4: - Limit write_* functions to page_size. >> - Fixed bugs spotted by Jiri. >> - Add information about pipe-mode to some error messages. &

Re: [PATCH v4 12/16] perf header: add a buffer to struct feat_fd

2017-06-13 Thread David Carrillo-Cisneros
On Tue, Jun 13, 2017 at 11:54 AM, Jiri Olsa wrote: > On Mon, Jun 12, 2017 at 09:29:28PM -0700, David Carrillo-Cisneros wrote: > > SNIP > >> /* Return: 0 if succeded, -ERR if failed. */ >> int write_padded(struct feat_fd *ff, const void *bf, >>size

Re: [PATCH v4 09/16] perf header: don't pass struct perf_file_section to process_##_feat

2017-06-13 Thread David Carrillo-Cisneros
On Tue, Jun 13, 2017 at 11:54 AM, Jiri Olsa wrote: > On Mon, Jun 12, 2017 at 09:29:25PM -0700, David Carrillo-Cisneros wrote: > > SNIP > >> struct cpu_cache_level *caches; >> u32 cnt, i, version; >> @@ -2084,8 +2073,7 @@ static int process_cache(struct

[PATCH v4 01/16] perf header: encapsulate read and swap

2017-06-12 Thread David Carrillo-Cisneros
Most callers of readn in perf header read either a 32 or a 64 bits number, error check it and swap it, if necessary. Create do_read_u32 and do_read_u64 to simplify these use cases. Signed-off-by: David Carrillo-Cisneros --- tools/perf/util/header.c | 210

[PATCH v4 03/16] perf header: fail on write_padded error

2017-06-12 Thread David Carrillo-Cisneros
Do not proceed if write_padded error failed. Also, add comments to remind that the return value of write_* functions in util/header.c is an erro code and not the number of bytes written. Signed-off-by: David Carrillo-Cisneros --- tools/perf/util/header.c | 6 +- 1 file changed, 5

[PATCH v4 00/16] perf tool: add meta-data header support for pipe-mode

2017-06-12 Thread David Carrillo-Cisneros
n user observed behavior. All other are transparent preparatory changes or bug fixes. David Carrillo-Cisneros (16): perf header: encapsulate read and swap perf header: add PROCESS_STR_FUN macro perf header: fail on write_padded error perf util: add const modifier to buf in "writen&quo

[PATCH v4 04/16] perf util: add const modifier to buf in "writen" function

2017-06-12 Thread David Carrillo-Cisneros
ter with constant buf argument. Signed-off-by: David Carrillo-Cisneros --- tools/perf/util/util.c | 6 -- tools/perf/util/util.h | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c index 28c9f335006c..0d8d7b8b2949 100644 --- a/tool

[PATCH v4 06/16] perf header: add struct feat_fd for write

2017-06-12 Thread David Carrillo-Cisneros
Introduce struct feat_fd. This patch uses it as a wrapper around fd in write_* functions for feature headers. Next patches will extend its functionality to other feature header functions. This patch does not change behavior. Signed-off-by: David Carrillo-Cisneros --- tools/perf/util/build-id.c

[PATCH v4 07/16] perf header: use struct feat_fd for print

2017-06-12 Thread David Carrillo-Cisneros
As preparation for using header records in pipe mode, replace int fd with struct feat_fd ff in print functions for all header record types. Signed-off-by: David Carrillo-Cisneros --- tools/perf/util/header.c | 102 ++- 1 file changed, 47 insertions

[PATCH v4 11/16] perf header: make write_pmu_mappings pipe-mode friendly

2017-06-12 Thread David Carrillo-Cisneros
In pipe-mode, we will operate over a buffer instead of a file descriptor but write_pmu_mappings uses lseek to move over the perf.data file. Refactor write_pmu_mappings to avoid the usage of lseek and allow reusing the same logic in pipe-mode (next patch). Signed-off-by: David Carrillo-Cisneros

[PATCH v4 08/16] perf header: use struct feat_fd to process header records

2017-06-12 Thread David Carrillo-Cisneros
As preparation for using header records in pipe-mode, replace int fd with struct feat_fd ff in process functions for all header record types. This patch does not change behavior. Signed-off-by: David Carrillo-Cisneros --- tools/perf/util/header.c | 164

[PATCH v4 13/16] perf header: change FEAT_OP* macros

2017-06-12 Thread David Carrillo-Cisneros
be NULLed individually. This allows to define two variations only: - FEAT_OPR: synthesizes auxiliar event record. - FEAT_OPN: doesn't synthesize an auxiliar event record. Signed-off-by: David Carrillo-Cisneros --- tools/perf/util/header.c | 72 +---

[PATCH v4 16/16] perf header: add event desc to pipe-mode header

2017-06-12 Thread David Carrillo-Cisneros
, uncore_ha_1 = 15, uncore_ubox = 25 [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.000 MB (null) ] Prior to this patch, event was not printed. Signed-off-by: David Carrillo-Cisneros --- tools/perf/util/header.c | 19 +-- 1 file changed, 17

[PATCH v4 09/16] perf header: don't pass struct perf_file_section to process_##_feat

2017-06-12 Thread David Carrillo-Cisneros
er on, the same variables can be reused for pipe-mode. This patch does not change behavior. Signed-off-by: David Carrillo-Cisneros --- tools/perf/util/header.c | 58 1 file changed, 24 insertions(+), 34 deletions(-) diff --git a/tools/perf

[PATCH v4 14/16] perf tool: add show_feature_header to perf_tool

2017-06-12 Thread David Carrillo-Cisneros
Add show_feat_hdr to control level of printed information of feature headers. Signed-off-by: David Carrillo-Cisneros --- tools/perf/builtin-report.c | 11 --- tools/perf/builtin-script.c | 3 +++ tools/perf/util/tool.h | 7 +++ 3 files changed, 18 insertions(+), 3 deletions

[PATCH v4 12/16] perf header: add a buffer to struct feat_fd

2017-06-12 Thread David Carrillo-Cisneros
ng if their functions are called in pipe-mode. Signed-off-by: David Carrillo-Cisneros --- tools/perf/util/header.c | 73 ++-- 1 file changed, 65 insertions(+), 8 deletions(-) diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index deb0234

[PATCH v4 15/16] perf tools: add feature header record to pipe-mode

2017-06-12 Thread David Carrillo-Cisneros
= 33, uncore_ha_0 = 16, uncore_cbox [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.000 MB - ] ... Support added for the subcommands: report, inject, annotate and script. Signed-off-by: David Carrillo-Cisneros --- tools/perf/Documentation/perf.data-file-forma

[PATCH v4 10/16] perf header: use struct feat_fd in read header records

2017-06-12 Thread David Carrillo-Cisneros
As preparation for using header records in-pipe mode, replace int fd with struct feat_fd ff in read functions for all header record types. This patch does not change behavior. Signed-off-by: David Carrillo-Cisneros --- tools/perf/util/header.c | 101

[PATCH v4 05/16] perf header: revamp do_write

2017-06-12 Thread David Carrillo-Cisneros
Now that writen takes a const buffer, use it in do_write instead of duplicating its functionality. Export do_write to use it consistently in header.c and build_id.c . Signed-off-by: David Carrillo-Cisneros --- tools/perf/util/build-id.c | 2 +- tools/perf/util/header.c | 14

[PATCH v4 02/16] perf header: add PROCESS_STR_FUN macro

2017-06-12 Thread David Carrillo-Cisneros
Simplify code by adding a macro to handle the common case of processing header features that are a simple string. Signed-off-by: David Carrillo-Cisneros --- tools/perf/util/header.c | 65 +--- 1 file changed, 17 insertions(+), 48 deletions(-) diff

Re: [PATCH v3 00/15] perf tool: add meta-data header support for pipe-mode

2017-06-12 Thread David Carrillo-Cisneros
On Wed, Jun 7, 2017 at 8:02 AM, David Carrillo-Cisneros wrote: > On Wed, Jun 7, 2017 at 4:19 AM, Jiri Olsa wrote: >> On Tue, Jun 06, 2017 at 11:15:25AM -0700, David Carrillo-Cisneros wrote: >>> On Tue, Jun 6, 2017 at 5:35 AM, Jiri Olsa wrote: >>> > On Tue, Ju

Re: [PATCH v3 15/15] perf header: add event desc to pipe-mode header

2017-06-12 Thread David Carrillo-Cisneros
On Thu, Jun 8, 2017 at 4:54 AM, Jiri Olsa wrote: > On Tue, Jun 06, 2017 at 12:07:22AM -0700, David Carrillo-Cisneros wrote: > > SNIP > >> diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c >> index 6c1963e5bf10..c91acd5b0838 100644 >> --- a/tools/per

Re: [PATCH v3 08/15] perf header: use struct feat_fd to process header records

2017-06-12 Thread David Carrillo-Cisneros
Good catch. The logic hasnt broken, this change is wrong. Fixed in next version. On Thu, Jun 8, 2017 at 4:54 AM, Jiri Olsa wrote: > On Tue, Jun 06, 2017 at 12:07:15AM -0700, David Carrillo-Cisneros wrote: > > SNIP > >> +static int process_cpu_topology(struct feat_

  1   2   3   4   5   >