[PATCH v3 12/12] perf session: use reader functions to load perf data file

2020-11-16 Thread Alexey Budankov
Use the reader functions to load data file similar to loading of data directory files. Signed-off-by: Alexey Budankov --- tools/perf/util/session.c | 215 -- 1 file changed, 66 insertions(+), 149 deletions(-) diff --git a/tools/perf/util/session.c b/tools

[PATCH v3 09/12] perf record: document parallel data streaming mode

2020-11-16 Thread Alexey Budankov
specification masks. Signed-off-by: Alexey Budankov --- tools/perf/Documentation/perf-record.txt | 18 ++ tools/perf/builtin-record.c | 43 ++-- 2 files changed, 58 insertions(+), 3 deletions(-) diff --git a/tools/perf/Documentation/perf-record.txt b/tools/perf

[PATCH v3 11/12] perf session: load data directory files for analysis

2020-11-16 Thread Alexey Budankov
-by: Jiri Olsa Signed-off-by: Alexey Budankov --- tools/perf/util/session.c | 350 +- tools/perf/util/session.h | 4 + 2 files changed, 315 insertions(+), 39 deletions(-) diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index 3c2fafb3a04d

[PATCH v3 08/12] perf record: introduce --threads= command line option

2020-11-16 Thread Alexey Budankov
25450.21342-1-jo...@kernel.org/ Suggested-by: Jiri Olsa Suggested-by: Namhyung Kim Signed-off-by: Alexey Budankov --- tools/include/linux/bitmap.h | 11 ++ tools/lib/bitmap.c | 14 ++ tools/perf/builtin-record.c | 308 ++- tools/perf/util/record.h

[PATCH v3 10/12] perf report: output data file name in raw trace dump

2020-11-16 Thread Alexey Budankov
Print path and name of a data file into raw dump (-D) @. Print offset of PERF_RECORD_COMPRESSED record instead of zero for decompressed records: 0x22...@perf.data [0x30]: event: 9 or 0x15c...@perf.data/data.7 [0x30]: event: 9 Acked-by: Namhyung Kim Signed-off-by: Alexey Budankov

[PATCH v3 07/12] perf record: init data file at mmap buffer object

2020-11-16 Thread Alexey Budankov
Initialize data files located at mmap buffer objects so trace data can be written into several data file located at data directory. Signed-off-by: Alexey Budankov --- tools/perf/builtin-record.c | 41 ++--- tools/perf/util/record.h| 1 + 2 files changed

[PATCH v3 04/12] perf record: stop threads in the end of trace streaming

2020-11-16 Thread Alexey Budankov
Signal thread to terminate by closing write fd of comm.msg pipe. Receive THREAD_MSG__READY message as the confirmation of the thread's termination. Stop threads created for parallel trace streaming prior their stats processing. Signed-off-by: Alexey Budankov --- tools/perf/builtin-record.c

[PATCH v3 05/12] perf record: start threads in the beginning of trace streaming

2020-11-16 Thread Alexey Budankov
for the thread to run. Wait and sync on thread start using thread comm.ack pipe. Signed-off-by: Alexey Budankov --- tools/perf/builtin-record.c | 103 +++- 1 file changed, 102 insertions(+), 1 deletion(-) diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin

[PATCH v3 06/12] perf record: introduce data file at mmap buffer object

2020-11-16 Thread Alexey Budankov
of the introduced per mmap file, compressor and stats when they are initialized and available. Signed-off-by: Alexey Budankov --- tools/perf/builtin-record.c | 64 + tools/perf/util/mmap.c | 6 tools/perf/util/mmap.h | 6 3 files changed, 63

[PATCH v3 01/12] perf record: introduce thread affinity and mmap masks

2020-11-16 Thread Alexey Budankov
Introduce affinity and mmap thread masks. Thread affinity mask defines cpus that a thread is allowed to run on. Thread maps mask defines mmap data buffers the thread serves to stream profiling data from. Signed-off-by: Alexey Budankov --- tools/perf/builtin-record.c | 116

[PATCH v3 02/12] perf record: introduce thread specific data array

2020-11-16 Thread Alexey Budankov
by the main tool thread. Signed-off-by: Alexey Budankov --- tools/lib/api/fd/array.c| 17 tools/lib/api/fd/array.h| 1 + tools/perf/builtin-record.c | 191 +++- 3 files changed, 206 insertions(+), 3 deletions(-) diff --git a/tools/lib/api/fd/array.c b

[PATCH v3 03/12] perf record: introduce thread local variable

2020-11-16 Thread Alexey Budankov
Introduce thread local variable and use it for threaded trace streaming. Use thread affinity mask instead or record affinity mask in affinity modes. Introduce and use evlist__ctlfd_update() function to propogate external control commands to global evlist object. Signed-off-by: Alexey Budankov

[PATCH v3 00/12] Introduce threaded trace streaming for basic perf record operation

2020-11-16 Thread Alexey Budankov
data --call-graph=callee tools/perf/perf report -i prof.data --stdio --header tools/perf/perf report -i prof.data -D --header [1] git clone https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git -b perf/record_threads [2] https://lore.kernel.org/lkml/20180913125450.21342-1-jo...@kernel.org

Re: [PATCH v2 00/15] Introduce threaded trace streaming for basic perf record operation

2020-10-27 Thread Alexey Budankov
On 27.10.2020 15:10, Jiri Olsa wrote: > On Mon, Oct 26, 2020 at 08:59:01PM +0300, Alexey Budankov wrote: >> >> On 24.10.2020 18:43, Jiri Olsa wrote: >>> On Wed, Oct 21, 2020 at 06:52:43PM +0300, Alexey Budankov wrote: >>>> >>>> Changes in v2: >

Re: [PATCH v2 06/15] perf session: load data directory into tool process memory

2020-10-27 Thread Alexey Budankov
On 27.10.2020 15:21, Jiri Olsa wrote: > On Tue, Oct 27, 2020 at 10:37:58AM +0300, Alexey Budankov wrote: >> >> On 24.10.2020 18:43, Jiri Olsa wrote: >>> On Wed, Oct 21, 2020 at 07:01:19PM +0300, Alexey Budankov wrote: >>>> >>>> Read trace files lo

Re: [PATCH v2] perf_event_open.2: update the man page with CAP_PERFMON related information

2020-10-27 Thread Alexey Budankov
On 27.10.2020 19:57, Michael Kerrisk (man-pages) wrote: > Hello Alexey, > > On 10/27/20 5:48 PM, Alexey Budankov wrote: >> >> Extend perf_event_open 2 man page with the information about >> CAP_PERFMON capability designed to secure performance monitoring >

[PATCH v2] perf_event_open.2: update the man page with CAP_PERFMON related information

2020-10-27 Thread Alexey Budankov
/, posix_1003.1e-990310.pdf Signed-off-by: Alexey Budankov --- man2/perf_event_open.2 | 32 ++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/man2/perf_event_open.2 b/man2/perf_event_open.2 index 4827a359d..9810bc554 100644 --- a/man2/perf_event_open.2

Re: [PATCH v2 12/15] perf record: introduce thread local variable for trace streaming

2020-10-27 Thread Alexey Budankov
:43, Jiri Olsa wrote: >>>>> On Wed, Oct 21, 2020 at 07:07:00PM +0300, Alexey Budankov wrote: >>>>>> >>>>>> Introduce thread local variable and use it for threaded trace streaming. >>>>>> >>>>>> Signed-off-by

Re: [PATCH v2 00/15] Introduce threaded trace streaming for basic perf record operation

2020-10-27 Thread Alexey Budankov
On 27.10.2020 15:10, Jiri Olsa wrote: > On Mon, Oct 26, 2020 at 08:59:01PM +0300, Alexey Budankov wrote: >> >> On 24.10.2020 18:43, Jiri Olsa wrote: >>> On Wed, Oct 21, 2020 at 06:52:43PM +0300, Alexey Budankov wrote: >>>> >>>> Changes in v2: >

Re: [PATCH v2 06/15] perf session: load data directory into tool process memory

2020-10-27 Thread Alexey Budankov
On 27.10.2020 15:21, Jiri Olsa wrote: > On Tue, Oct 27, 2020 at 10:37:58AM +0300, Alexey Budankov wrote: >> >> On 24.10.2020 18:43, Jiri Olsa wrote: >>> On Wed, Oct 21, 2020 at 07:01:19PM +0300, Alexey Budankov wrote: >>>> >>>> Read trace files lo

Re: [PATCH v2 03/15] perf data: open data directory in read access mode

2020-10-27 Thread Alexey Budankov
On 27.10.2020 14:59, Jiri Olsa wrote: > On Mon, Oct 26, 2020 at 08:47:06PM +0300, Alexey Budankov wrote: >> >> On 24.10.2020 18:43, Jiri Olsa wrote: >>> On Wed, Oct 21, 2020 at 06:57:53PM +0300, Alexey Budankov wrote: >>>> >>>> Open files loc

Re: [PATCH v2 12/15] perf record: introduce thread local variable for trace streaming

2020-10-27 Thread Alexey Budankov
On 27.10.2020 15:01, Jiri Olsa wrote: > On Mon, Oct 26, 2020 at 05:11:30PM +0300, Alexei Budankov wrote: >> Why do you complain about per thread variable in this case? >> It looks like ideally fits these specific needs. > > I think there's misunderstanding.. I think we should move > samples to

Re: [PATCH v1] perf_event_open.2: update the man page with CAP_PERFMON related information

2020-10-27 Thread Alexey Budankov
On 27.10.2020 12:25, Michael Kerrisk (man-pages) wrote: > Hi Alexei, > > Would you be able to refresh this patch and resend please? Sure. Will do. Regards, Alexei

Re: [PATCH v2 06/15] perf session: load data directory into tool process memory

2020-10-27 Thread Alexey Budankov
On 24.10.2020 18:43, Jiri Olsa wrote: > On Wed, Oct 21, 2020 at 07:01:19PM +0300, Alexey Budankov wrote: >> >> Read trace files located in data directory into tool process memory. >> Basic analysis support of data directories is provided for report >> mode. Raw dump

Re: [PATCH v2 00/15] Introduce threaded trace streaming for basic perf record operation

2020-10-26 Thread Alexey Budankov
On 24.10.2020 18:43, Jiri Olsa wrote: > On Wed, Oct 21, 2020 at 06:52:43PM +0300, Alexey Budankov wrote: >> >> Changes in v2: >> - explicitly added credit tags to patches 6/15 and 15/15, >> additionally to cites [1], [2] >> - updated description of 3/15

Re: [PATCH v2 04/15] perf session: move reader object definition to header file

2020-10-26 Thread Alexey Budankov
On 24.10.2020 18:44, Jiri Olsa wrote: > On Wed, Oct 21, 2020 at 06:59:48PM +0300, Alexey Budankov wrote: >> >> Move definition of reader to session header file to be shared >> among different source files. Introduce reference to active >> reader object from sessi

Re: [PATCH v2 03/15] perf data: open data directory in read access mode

2020-10-26 Thread Alexey Budankov
On 24.10.2020 18:43, Jiri Olsa wrote: > On Wed, Oct 21, 2020 at 06:57:53PM +0300, Alexey Budankov wrote: >> >> Open files located at trace data directory in case read access >> mode is requested. File are opened and its fds assigned to >> perf_data dir files

Re: [PATCH v2 03/15] perf data: open data directory in read access mode

2020-10-22 Thread Alexey Budankov
On 22.10.2020 7:31, Namhyung Kim wrote: > On Thu, Oct 22, 2020 at 12:58 AM Alexey Budankov > wrote: >> >> >> Open files located at trace data directory in case read access >> mode is requested. File are opened and its fds assigned to >> perf_data d

Re: [PATCH v2 05/15] perf session: introduce decompressor into trace reader object

2020-10-22 Thread Alexey Budankov
On 22.10.2020 7:36, Namhyung Kim wrote: > On Thu, Oct 22, 2020 at 1:00 AM Alexey Budankov > wrote: >> >> >> Introduce decompressor to trace reader object so that decompression >> could be executed on per trace file basis separately for every >> trace file

[PATCH v2 15/15] perf record: introduce --threads command line option

2020-10-21 Thread Alexey Budankov
kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git -b perf/record_threads [2] https://lore.kernel.org/lkml/20180913125450.21342-1-jo...@kernel.org/ Suggested-by: Jiri Olsa Suggested-by: Namhyung Kim Signed-off-by: Alexey Budankov --- tools/perf/Documentation/perf-record.txt | 7 tools/pe

[PATCH v2 14/15] perf record: start threads in the beginning of trace streaming

2020-10-21 Thread Alexey Budankov
trace files located at data directory. Data buffers and threads are affined to local NUMA nodes and monitored CPUs according to system topology. --cpu option can be used to specify CPUs to be monitored. Signed-off-by: Alexey Budankov --- tools/perf/builtin-record.c | 128

[PATCH v2 13/15] perf record: stop threads in the end of trace streaming

2020-10-21 Thread Alexey Budankov
Close write fd of comm.msg pipe to signal thread to terminate and receive THREAD_MSG__READY confirmation on termination. Accumulate thread stats into global stats to be correctly calculated and displayed in perf tool output. Signed-off-by: Alexey Budankov --- tools/perf/builtin-record.c | 64

[PATCH v2 11/15] perf evlist: introduce evlist__ctlfd_update() to update ctl fd status

2020-10-21 Thread Alexey Budankov
Introduce evlist__ctlfd_update() to update ctl fd poll status in evlist pollfd array using other pollfd object. Signed-off-by: Alexey Budankov --- tools/perf/util/evlist.c | 16 tools/perf/util/evlist.h | 1 + 2 files changed, 17 insertions(+) diff --git a/tools/perf/util

[PATCH v2 12/15] perf record: introduce thread local variable for trace streaming

2020-10-21 Thread Alexey Budankov
Introduce thread local variable and use it for threaded trace streaming. Signed-off-by: Alexey Budankov --- tools/perf/builtin-record.c | 71 - 1 file changed, 62 insertions(+), 9 deletions(-) diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin

[PATCH v2 10/15] perf record: manage thread specific data array

2020-10-21 Thread Alexey Budankov
to thread's pollfd object. Deliver thread control commands to ctlfd_pos fd of thread 1+. Deliver tool external control commands via ctlfd_pos fd of thread 0. Signed-off-by: Alexey Budankov --- tools/perf/builtin-record.c | 101 ++-- 1 file changed, 98 insertions(+), 3

[PATCH v2 09/15] perf record: introduce thread specific objects for trace streaming

2020-10-21 Thread Alexey Budankov
Introduce thread local data object and its array to be used for threaded trace streaming. Signed-off-by: Alexey Budankov --- tools/perf/builtin-record.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index

[PATCH v2 08/15] perf record: write trace data into mmap trace files

2020-10-21 Thread Alexey Budankov
Write trace buffer data into per mmap trace files located at data directory. Streaming thread adjusts its affinity according to mask of the buffer being processed. Signed-off-by: Alexey Budankov --- tools/perf/builtin-record.c | 44 - tools/perf/util

[PATCH v2 07/15] perf record: introduce trace file, compressor and stats in mmap object

2020-10-21 Thread Alexey Budankov
of the introduced per mmap file, compressor and stats when they are initialized and available. Signed-off-by: Alexey Budankov --- tools/perf/builtin-record.c | 47 +++-- tools/perf/util/mmap.c | 6 + tools/perf/util/mmap.h | 5 3 files changed

[PATCH v2 06/15] perf session: load data directory into tool process memory

2020-10-21 Thread Alexey Budankov
-b perf/record_threads [2] https://lore.kernel.org/lkml/20180913125450.21342-1-jo...@kernel.org/ Suggested-by: Jiri Olsa Suggested-by: Namhyung Kim Signed-off-by: Alexey Budankov --- tools/perf/util/session.c | 48 +++ tools/perf/util/session.h | 1 + 2

[PATCH v2 05/15] perf session: introduce decompressor into trace reader object

2020-10-21 Thread Alexey Budankov
Introduce decompressor to trace reader object so that decompression could be executed on per trace file basis separately for every trace file located in trace directory. Signed-off-by: Alexey Budankov --- tools/perf/util/session.c | 4 +++- tools/perf/util/session.h | 1 + 2 files changed, 4

[PATCH v2 04/15] perf session: move reader object definition to header file

2020-10-21 Thread Alexey Budankov
Move definition of reader to session header file to be shared among different source files. Introduce reference to active reader object from session object. Signed-off-by: Alexey Budankov --- tools/perf/util/session.c | 27 --- tools/perf/util/session.h | 25

[PATCH v2 02/15] perf report: output trace file name in raw trace dump

2020-10-21 Thread Alexey Budankov
Print path and name of a trace file into raw dump (-D) @. Print offset of PERF_RECORD_COMPRESSED record instead of zero for decompressed records: 0x22...@perf.data [0x30]: event: 9 or 0x15c...@perf.data/data.7 [0x30]: event: 9 Signed-off-by: Alexey Budankov --- tools/perf/builtin-inject.c

[PATCH v2 03/15] perf data: open data directory in read access mode

2020-10-21 Thread Alexey Budankov
Open files located at trace data directory in case read access mode is requested. File are opened and its fds assigned to perf_data dir files especially for loading data directories content in perf report mode. Signed-off-by: Alexey Budankov --- tools/perf/util/data.c | 4 1 file changed

[PATCH v2 01/15] perf session: introduce trace file path to be shown in raw trace dump

2020-10-21 Thread Alexey Budankov
Extend reader, ordered_event and decomp objects to contain path of a trace file being displayed. Signed-off-by: Alexey Budankov --- tools/perf/util/ordered-events.h | 1 + tools/perf/util/session.c| 2 ++ tools/perf/util/session.h| 1 + 3 files changed, 4 insertions(+) diff

[PATCH v2 00/15] Introduce threaded trace streaming for basic perf record operation

2020-10-21 Thread Alexey Budankov
n examples below. [1] git clone https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git -b perf/record_threads [2] https://lore.kernel.org/lkml/20180913125450.21342-1-jo...@kernel.org/ --- Alexey Budankov (15): perf session: introduce trace file path to be shown in raw trace dump p

Re: [PATCH v1 06/15] perf session: load data directory into tool process memory

2020-10-21 Thread Alexey Budankov
On 21.10.2020 13:57, Namhyung Kim wrote: > On Wed, Oct 21, 2020 at 7:25 PM Alexey Budankov > wrote: >> >> >> On 21.10.2020 9:54, Namhyung Kim wrote: >>> Hi, >>> >>> On Tue, Oct 13, 2020 at 8:30 PM Alexey Budankov >>> wrote: >>

Re: [PATCH v1 08/15] perf record: write trace data into mmap trace files

2020-10-21 Thread Alexey Budankov
On 21.10.2020 10:34, Namhyung Kim wrote: > On Wed, Oct 14, 2020 at 9:09 PM Alexey Budankov > wrote: >> >> Hi, >> >> On 14.10.2020 13:52, Namhyung Kim wrote: >>> Hi, >>> >>> On Mon, Oct 12, 2020 at 6:01 PM Alexey Budankov >>>

Re: [PATCH v1 06/15] perf session: load data directory into tool process memory

2020-10-21 Thread Alexey Budankov
On 21.10.2020 9:54, Namhyung Kim wrote: > Hi, > > On Tue, Oct 13, 2020 at 8:30 PM Alexey Budankov > wrote: >> On 12.10.2020 19:49, Alexey Budankov wrote: >>> On 12.10.2020 19:09, Andi Kleen wrote: >>>> On Mon, Oct 12, 2020 at 11:58:58AM +0300, Alexey B

Re: [PATCH v1 02/15] perf report: output trace file name in raw trace dump

2020-10-20 Thread Alexey Budankov
On 20.10.2020 19:31, Alexey Budankov wrote: > > On 12.10.2020 20:06, Alexey Budankov wrote: >> >> On 12.10.2020 19:01, Andi Kleen wrote: >>> On Mon, Oct 12, 2020 at 11:54:24AM +0300, Alexey Budankov wrote: >>>> @@ -180,7 +183,8 @@ static i

Re: [PATCH v1 02/15] perf report: output trace file name in raw trace dump

2020-10-20 Thread Alexey Budankov
On 12.10.2020 20:06, Alexey Budankov wrote: > > On 12.10.2020 19:01, Andi Kleen wrote: >> On Mon, Oct 12, 2020 at 11:54:24AM +0300, Alexey Budankov wrote: >>> @@ -180,7 +183,8 @@ static int ordered_events__deliver_event(struct &

[PATCH v1 2/2] doc/admin-guide: document creation of CAP_PERFMON privileged shell

2020-10-19 Thread Alexey Budankov
Document steps to create CAP_PERFMON privileged shell to unblock Perf tool usage in cases when capabilities can't be assigned to an executable due to limitations of used file system. Suggested-by: Andi Kleen Signed-off-by: Alexey Budankov --- Documentation/admin-guide/perf-security.rst | 68

[PATCH v1 1/2] doc/admin-guide: note credentials consolidation under CAP_PERFMON

2020-10-19 Thread Alexey Budankov
Add note that starting from Linux v5.9 CAP_PERFMON Linux capability is enough to conduct performance monitoring and observability using perf_events API. Signed-off-by: Alexey Budankov --- Documentation/admin-guide/perf-security.rst | 13 - 1 file changed, 8 insertions(+), 5

[PATCH v1 0/2] doc/admin-guide: update perf-security.rst with CAP_PERFMON usage flows

2020-10-19 Thread Alexey Budankov
/man7/capabilities.7.html [2] https://man7.org/linux/man-pages/man7/xattr.7.html [3] https://man7.org/linux/man-pages/man8/mount.8.html [4] https://www.kernel.org/doc/html/latest/admin-guide/perf-security.html#privileged-perf-users-groups --- Alexey Budankov (2): doc/admin-guide: note

Re: [PATCH v1 00/15] Introduce threaded trace streaming for basic perf record operation

2020-10-15 Thread Alexey Budankov
On 14.10.2020 20:27, Ingo Molnar wrote: > > * Alexey Budankov wrote: > >> >> Patch set provides threaded trace streaming for base perf record >> operation. Provided streaming mode (--threads) mitigates profiling >> data losses and resolves scalability

Re: [PATCH v1 00/15] Introduce threaded trace streaming for basic perf record operation

2020-10-14 Thread Alexey Budankov
On 13.10.2020 19:20, Arnaldo Carvalho de Melo wrote: > Em Mon, Oct 12, 2020 at 11:50:29AM +0300, Alexey Budankov escreveu: >> >> Patch set provides threaded trace streaming for base perf record >> operation. Provided streaming mode (--threads) mitigates profiling >&g

Re: [PATCH v1 08/15] perf record: write trace data into mmap trace files

2020-10-14 Thread Alexey Budankov
Hi, On 14.10.2020 13:52, Namhyung Kim wrote: > Hi, > > On Mon, Oct 12, 2020 at 6:01 PM Alexey Budankov > wrote: >> >> >> Write trace data into per mmap trace files located >> at data directory. Streaming thread adjusts its affinity >> accor

Re: [PATCH v1 03/15] perf data: open data directory in read access mode

2020-10-14 Thread Alexey Budankov
On 13.10.2020 19:22, Arnaldo Carvalho de Melo wrote: > Em Mon, Oct 12, 2020 at 07:52:33PM +0300, Alexey Budankov escreveu: >> >> On 12.10.2020 19:03, Andi Kleen wrote: >>> On Mon, Oct 12, 2020 at 11:55:07AM +0300, Alexey Budankov wrote: >>>> >>>&

Re: [PATCH v1 02/15] perf report: output trace file name in raw trace dump

2020-10-13 Thread Alexey Budankov
Hi, On 13.10.2020 22:54, Jiri Olsa wrote: > On Mon, Oct 12, 2020 at 11:54:24AM +0300, Alexey Budankov wrote: >> >> Output path of a trace file into raw dump (-D) @. >> Print offset of PERF_RECORD_COMPRESSED record instead of zero for >> decompressed records: >>

Re: [PATCH v1 06/15] perf session: load data directory into tool process memory

2020-10-13 Thread Alexey Budankov
On 12.10.2020 19:49, Alexey Budankov wrote: > > On 12.10.2020 19:09, Andi Kleen wrote: >> On Mon, Oct 12, 2020 at 11:58:58AM +0300, Alexey Budankov wrote: >>> >>> Read trace files located at data directory into tool process memory. >>> Basic analysis

Re: [PATCH v1 02/15] perf report: output trace file name in raw trace dump

2020-10-12 Thread Alexey Budankov
On 12.10.2020 19:01, Andi Kleen wrote: > On Mon, Oct 12, 2020 at 11:54:24AM +0300, Alexey Budankov wrote: >> @@ -180,7 +183,8 @@ static int ordered_events__deliver_event(struct >> ordered_events *oe, >> ordered_events)

Re: [PATCH v1 03/15] perf data: open data directory in read access mode

2020-10-12 Thread Alexey Budankov
On 12.10.2020 19:03, Andi Kleen wrote: > On Mon, Oct 12, 2020 at 11:55:07AM +0300, Alexey Budankov wrote: >> >> Open files located at data directory in case of read access mode. > > Need some rationale. Is this a bug fix? Did the case not matter > before? This is not a

Re: [PATCH v1 05/15] perf session: introduce decompressor into trace reader object

2020-10-12 Thread Alexey Budankov
On 12.10.2020 19:05, Andi Kleen wrote: > On Mon, Oct 12, 2020 at 11:57:00AM +0300, Alexey Budankov wrote: >> diff --git a/tools/perf/util/session.h b/tools/perf/util/session.h >> index abdb8518a81f..4fc9ccdf7970 100644 >> --- a/tools/perf/util/session.h >> +++

Re: [PATCH v1 06/15] perf session: load data directory into tool process memory

2020-10-12 Thread Alexey Budankov
On 12.10.2020 19:09, Andi Kleen wrote: > On Mon, Oct 12, 2020 at 11:58:58AM +0300, Alexey Budankov wrote: >> >> Read trace files located at data directory into tool process memory. >> Basic analysis support of data directories is provided for report >> mode. Raw dump

[PATCH v1 15/15] perf record: introduce --threads command line option

2020-10-12 Thread Alexey Budankov
exclusive to the exposed threaded streaming mode. [1] git clone https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git -b perf/record_threads [2] https://lore.kernel.org/lkml/20180913125450.21342-1-jo...@kernel.org/ Signed-off-by: Alexey Budankov --- tools/perf/Documentation/perf-record.txt | 7 +

[PATCH v1 14/15] perf record: start threads in the beginning of trace streaming

2020-10-12 Thread Alexey Budankov
trace files located at data directory. Data buffers and threads are affined to local NUMA nodes and monitored CPUs according to system topology. --cpu option can be used to specify exact CPUs to be monitored. Signed-off-by: Alexey Budankov --- tools/perf/builtin-record.c | 128

[PATCH v1 13/15] perf record: stop threads in the end of trace streaming

2020-10-12 Thread Alexey Budankov
Close write fd of comm.msg pipe to signal thread to terminate and receive THREAD_MSG__READY confirmation on termination. Accumulate thread stats into global stats to be correctly calculated and displayed in perf tool output. Signed-off-by: Alexey Budankov --- tools/perf/builtin-record.c | 64

[PATCH v1 12/15] perf record: introduce thread local variable for trace streaming

2020-10-12 Thread Alexey Budankov
Introduce thread local variable and use it for threaded trace streaming. Signed-off-by: Alexey Budankov --- tools/perf/builtin-record.c | 71 - 1 file changed, 62 insertions(+), 9 deletions(-) diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin

[PATCH v1 11/15] perf evlist: introduce evlist__ctlfd_update() to update ctl fd status

2020-10-12 Thread Alexey Budankov
Introduce evlist__ctlfd_update() to update ctl fd poll status in evlist pollfd array using other pollfd object. Signed-off-by: Alexey Budankov --- tools/perf/util/evlist.c | 16 tools/perf/util/evlist.h | 1 + 2 files changed, 17 insertions(+) diff --git a/tools/perf/util

[PATCH v1 10/15] perf record: manage thread specific data array

2020-10-12 Thread Alexey Budankov
to thread's pollfd object. Deliver thread control commands to ctlfd_pos fd of thread 1+. Deliver tool external control commands via ctlfd_pos fd of thread 0. Signed-off-by: Alexey Budankov --- tools/perf/builtin-record.c | 101 ++-- 1 file changed, 98 insertions(+), 3

[PATCH v1 09/15] perf record: introduce thread specific objects for trace streaming

2020-10-12 Thread Alexey Budankov
Introduce thread local data object and its array to be used for threaded trace streaming. Signed-off-by: Alexey Budankov --- tools/perf/builtin-record.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index

[PATCH v1 08/15] perf record: write trace data into mmap trace files

2020-10-12 Thread Alexey Budankov
Write trace data into per mmap trace files located at data directory. Streaming thread adjusts its affinity according to mask of the buffer being processed. Signed-off-by: Alexey Budankov --- tools/perf/builtin-record.c | 44 - tools/perf/util/record.h

[PATCH v1 07/15] perf record: introduce trace file, compressor and stats in mmap object

2020-10-12 Thread Alexey Budankov
of the introduced per mmap file, compressor and stats when they are initialized and available. Signed-off-by: Alexey Budankov --- tools/perf/builtin-record.c | 47 +++-- tools/perf/util/mmap.c | 6 + tools/perf/util/mmap.h | 5 3 files changed

[PATCH v1 06/15] perf session: load data directory into tool process memory

2020-10-12 Thread Alexey Budankov
-b perf/record_threads [2] https://lore.kernel.org/lkml/20180913125450.21342-1-jo...@kernel.org/ Signed-off-by: Alexey Budankov --- tools/perf/util/session.c | 48 +++ tools/perf/util/session.h | 1 + 2 files changed, 49 insertions(+) diff --git a/tools

[PATCH v1 05/15] perf session: introduce decompressor into trace reader object

2020-10-12 Thread Alexey Budankov
Introduce decompressor to trace reader object so that decompression could be executed on per trace file basis separately for every trace file located at data directory. Signed-off-by: Alexey Budankov --- tools/perf/util/session.c | 4 +++- tools/perf/util/session.h | 1 + 2 files changed, 4

[PATCH v1 04/15] perf session: move reader object definition to header file

2020-10-12 Thread Alexey Budankov
Move definition of reader to session header file to be shared among different source files. Introduce reference to active reader object from session object. Signed-off-by: Alexey Budankov --- tools/perf/util/session.c | 27 --- tools/perf/util/session.h | 25

[PATCH v1 03/15] perf data: open data directory in read access mode

2020-10-12 Thread Alexey Budankov
Open files located at data directory in case of read access mode. Signed-off-by: Alexey Budankov --- tools/perf/util/data.c | 4 1 file changed, 4 insertions(+) diff --git a/tools/perf/util/data.c b/tools/perf/util/data.c index c47aa34fdc0a..6ad61ac6ba67 100644 --- a/tools/perf/util

[PATCH v1 02/15] perf report: output trace file name in raw trace dump

2020-10-12 Thread Alexey Budankov
Output path of a trace file into raw dump (-D) @. Print offset of PERF_RECORD_COMPRESSED record instead of zero for decompressed records: 0x22...@perf.data [0x30]: event: 9 or 0x15c...@perf.data/data.7 [0x30]: event: 9 Signed-off-by: Alexey Budankov --- tools/perf/util/session.c | 75

[PATCH v1 01/15] perf session: introduce trace file path to be shown in raw trace dump

2020-10-12 Thread Alexey Budankov
Extend reader, ordered_event and decomp objects to contain path of a trace file being displayed. Signed-off-by: Alexey Budankov --- tools/perf/util/ordered-events.h | 1 + tools/perf/util/session.c| 2 ++ tools/perf/util/session.h| 1 + 3 files changed, 4 insertions(+) diff

[PATCH v1 00/15] Introduce threaded trace streaming for basic perf record operation

2020-10-12 Thread Alexey Budankov
t -b perf/record_threads [2] https://lore.kernel.org/lkml/20180913125450.21342-1-jo...@kernel.org/ --- Alexey Budankov (15): perf session: introduce trace file path to be shown in raw trace dump perf report: output trace file name in raw trace dump perf data: open data directory in read a

Re: [PATCH 3/3] platform/x86: Intel PMT Crashlog capability driver

2020-09-21 Thread Alexey Budankov
On 21.09.2020 20:33, Alexander Duyck wrote: > On Mon, Sep 21, 2020 at 9:07 AM Alexey Budankov > wrote: >> >> >> On 21.09.2020 16:36, Alexander Duyck wrote: >>> On Sat, Sep 19, 2020 at 1:01 AM Alexey Budankov >>> wrote: >>>> >>>>

Re: [PATCH 3/3] platform/x86: Intel PMT Crashlog capability driver

2020-09-19 Thread Alexey Budankov
Hi, Thanks for the patches. On 11.09.2020 22:45, David E. Box wrote: > From: Alexander Duyck > > Add support for the Intel Platform Monitoring Technology crashlog > interface. This interface provides a few sysfs values to allow for > controlling the crashlog telemetry interface as well as a

Re: [PATCH] tools feature: Add missing -lzstd to the fast path feature detection

2020-09-05 Thread Alexey Budankov
w I need an entry to 'perf test' to make sure that > /tmp/build/perf/feature/test-all.make.output is empty... > > Fixes: 3b1c5d9659718263 ("tools build: Implement libzstd feature check, > LIBZSTD_DIR and NO_LIBZSTD defines") > Cc: Adrian Hunter > Cc: Alexey Buda

Re: [PATCH V3 4/6] perf tools: Add FIFO file names as alternative options to --control

2020-09-02 Thread Alexey Budankov
On 02.09.2020 13:57, Adrian Hunter wrote: > Enable the --control option to accept file names as an alternative to > file descriptors. > > Example: > > $ mkfifo perf.control > $ mkfifo perf.ack > $ cat perf.ack & > [1] 6808 > $ perf record --control fifo:perf.control,perf.ack -- sleep 300

Re: [PATCH V2 5/6] perf record: Add 'snapshot' control command

2020-09-02 Thread Alexey Budankov
On 01.09.2020 12:37, Adrian Hunter wrote: > Add 'snapshot' control command to create an AUX area tracing snapshot the > same as if sending SIGUSR2. The advantage of the FIFO is that access is > governed by access to the FIFO. > > Example: > > $ mkfifo perf.control > $ mkfifo perf.ack > $

Re: [PATCH V2 6/6] perf intel-pt: Document snapshot control command

2020-09-02 Thread Alexey Budankov
On 01.09.2020 12:37, Adrian Hunter wrote: > The documentation descibes snapshot mode. Update it to include the new > snapshot control command. > > Signed-off-by: Adrian Hunter > --- > tools/perf/Documentation/perf-intel-pt.txt | 23 +++--- > 1 file changed, 20 insertions(+),

Re: [PATCH V2 3/6] perf tools: Use AsciiDoc formatting for --control option documentation

2020-09-02 Thread Alexey Budankov
On 01.09.2020 12:37, Adrian Hunter wrote: > The --control option does not display well in man pages unless AsciiDoc > formatting is used. > > Signed-off-by: Adrian Hunter > --- > tools/perf/Documentation/perf-record.txt | 46 > tools/perf/Documentation/perf-stat.txt

Re: [PATCH V2 2/6] perf tools: Handle read errors from ctl_fd

2020-09-02 Thread Alexey Budankov
On 01.09.2020 12:37, Adrian Hunter wrote: > Handle read errors from ctl_fd such as EINTR, EAGAIN and EWOULDBLOCK. > > Signed-off-by: Adrian Hunter > --- > tools/perf/util/evlist.c | 16 +++- > 1 file changed, 11 insertions(+), 5 deletions(-) Acked-by: Alexei Budankov Regards,

Re: [PATCH V2 1/6] perf tools: Consolidate --control option parsing into one function

2020-09-02 Thread Alexey Budankov
On 01.09.2020 12:37, Adrian Hunter wrote: > Consolidate --control option parsing into one function, in preparation for > adding FIFO file name options. > > Signed-off-by: Adrian Hunter > --- > tools/perf/builtin-record.c | 22 ++ > tools/perf/builtin-stat.c | 22

Re: [PATCH v1] perf_event_open.2: update the man page with CAP_PERFMON related information

2020-08-24 Thread Alexey Budankov
Hi Michael, On 23.08.2020 20:28, Michael Kerrisk (man-pages) wrote: > Hello Alexey, > > Could you look at the question below and update the patch. > > On 2/17/20 9:18 AM, Alexey Budankov wrote: >> >> Extend perf_event_open 2 man page with the information about >>

Re: [PATCH 1/2] perf: Add closing sibling events' file descriptors

2020-08-11 Thread Alexey Budankov
On 10.08.2020 23:36, Peter Zijlstra wrote: > On Mon, Aug 10, 2020 at 07:45:18AM -0700, Andi Kleen wrote: > >> Unfortunately we're kind of stuck with the old NFILE=1024 default >> even though it makes little sense on modern servers. > > Why can't that be changed? It seems to me all of userspace

[tip: perf/urgent] perf/core: Take over CAP_SYS_PTRACE creds to CAP_PERFMON capability

2020-08-06 Thread tip-bot2 for Alexey Budankov
The following commit has been merged into the perf/urgent branch of tip: Commit-ID: 45fd22da97c6125d8d0d35bd1791e7c0c4175279 Gitweb: https://git.kernel.org/tip/45fd22da97c6125d8d0d35bd1791e7c0c4175279 Author:Alexey Budankov AuthorDate:Wed, 05 Aug 2020 10:56:56 +03:00

[PATCH v1] perf/core: take over CAP_SYS_PTRACE creds to CAP_PERFMON cap

2020-08-05 Thread Alexey Budankov
/7776fa40-6c65-2aa6-1322-eb3a01201...@linux.intel.com/ Signed-off-by: Alexey Budankov --- kernel/events/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/events/core.c b/kernel/events/core.c index 856d98c36f56..f50d528af444 100644 --- a/kernel/events/core.c +++ b

[PATCH v1] perf: extend message to mention CAP_SYS_PTRACE and perf security doc link

2020-08-05 Thread Alexey Budankov
/ Signed-off-by: Alexey Budankov --- tools/perf/util/evsel.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index 9aa51a65593d..e241ee773ccb 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -2500,8

Re: [PATCH 2/6] perf tools: Store clock references for -k/--clockid option

2020-07-31 Thread Alexey Budankov
On 31.07.2020 0:39, Jiri Olsa wrote: > Adding new CLOCK_DATA feature that stores reference times > when -k/--clockid option is specified. > > It contains clock id and its reference time together with > wall clock time taken at the 'same time', both values are > in nanoseconds. > > The format

Re: [PATCH v12 11/15] perf stat: implement control commands handling

2020-07-22 Thread Alexey Budankov
On 22.07.2020 15:56, Arnaldo Carvalho de Melo wrote: > Em Fri, Jul 17, 2020 at 10:05:06AM +0300, Alexey Budankov escreveu: >> >> Implement handling of 'enable' and 'disable' control commands coming >> from control file descriptor. If poll event splits initiate

Re: [PATCH v12 05/15] perf evlist: implement control command handling functions

2020-07-22 Thread Alexey Budankov
On 22.07.2020 15:34, Arnaldo Carvalho de Melo wrote: > Em Wed, Jul 22, 2020 at 09:27:34AM -0300, Arnaldo Carvalho de Melo escreveu: >> Em Fri, Jul 17, 2020 at 10:01:33AM +0300, Alexey Budankov escreveu: >>> >>> Implement functions of initialization, finalization an

Re: [PATCH v8 00/12] Introduce CAP_PERFMON to secure system performance monitoring and observability

2020-07-21 Thread Alexey Budankov
On 13.07.2020 21:51, Arnaldo Carvalho de Melo wrote: > Em Mon, Jul 13, 2020 at 03:37:51PM +0300, Alexey Budankov escreveu: >> >> On 13.07.2020 15:17, Arnaldo Carvalho de Melo wrote: >>> Em Mon, Jul 13, 2020 at 12:48:25PM +0300, Alexey Budankov escreveu: >>>&g

[PATCH v12 15/15] perf record: introduce --control fd:ctl-fd[,ack-fd] options

2020-07-17 Thread Alexey Budankov
shell script. Signed-off-by: Alexey Budankov Acked-by: Jiri Olsa Acked-by: Namhyung Kim --- tools/perf/Documentation/perf-record.txt | 39 tools/perf/builtin-record.c | 37 ++ tools/perf/util/record.h | 2 ++ 3 files

[PATCH v12 14/15] perf record: implement control commands handling

2020-07-17 Thread Alexey Budankov
Implement handling of 'enable' and 'disable' control commands coming from control file descriptor. Signed-off-by: Alexey Budankov Acked-by: Jiri Olsa Acked-by: Namhyung Kim --- tools/perf/builtin-record.c | 16 1 file changed, 16 insertions(+) diff --git a/tools/perf

[PATCH v12 13/15] perf record: extend -D,--delay option with -1 value

2020-07-17 Thread Alexey Budankov
Extend -D,--delay option with -1 to start collection with events disabled to be enabled later by 'enable' command provided via control file descriptor. Signed-off-by: Alexey Budankov Acked-by: Jiri Olsa Acked-by: Namhyung Kim --- tools/perf/Documentation/perf-record.txt | 5 +++-- tools

  1   2   3   4   5   6   7   8   9   10   >