[PATCH 093/107] libperf: Add perf_cpu_map__for_each_cpu() macro

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Jiri Olsa Add the following macro to libperf: perf_cpu_map__for_each_cpu() And its related functions: perf_cpu_map__cpu() perf_cpu_map__nr() That will allow hiding how it is implemented. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Alexey Budankov Cc: Andi Kleen Cc:

[PATCH 091/107] libperf: Adopt perf_evsel__read() function from tools/perf

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Jiri Olsa Move the perf_evsel__read() function to libperf as a public interface together with struct perf_counts_values for returning counter values. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Alexey Budankov Cc: Andi Kleen Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter

[PATCH 092/107] libperf: Adopt perf_evsel__enable()/disable()/apply_filter() functions

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Jiri Olsa Move the following functions: evsel__enable() evsel__disable() evsel__apply_filter() to libperf with the following names: perf_evsel__enable() perf_evsel__disable() perf_evsel__apply_filter() Export only perf_evsel__enable()/disable(), keeping the

[PATCH 087/107] libperf: Adopt the readn()/writen() functions from tools/perf

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Jiri Olsa Move the readn()/writen() functions into libperf. Keep those non-namespaced names because they will be shared only between perf and libperf. Again, these are not exported functions. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Alexey Budankov Cc: Andi Kleen Cc:

[PATCH 088/107] libperf: Adopt perf_evsel__alloc_fd() function from tools/perf

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Jiri Olsa Move the perf_evsel__alloc_fd() function from perf to libperf. It's not exported. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Alexey Budankov Cc: Andi Kleen Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link:

[PATCH 089/107] libperf: Adopt simplified perf_evsel__open() function from tools/perf

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Jiri Olsa Add a perf_evsel__open() function to libperf. It's a simplified version of evsel__open() without the fallback mechanism. We can try to merge it in the future to libperf, but it has many details, lets start simple, requiring the latest kernel, perf should continue using its

[PATCH 085/107] libperf: Move fd array from perf's evsel to lobperf's perf_evsel class

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Jiri Olsa Move the fd array from perf's evsel to libperf's perf_evsel class. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Alexey Budankov Cc: Andi Kleen Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link:

[PATCH 086/107] libperf: Move nr_members from perf's evsel to libperf's perf_evsel

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Jiri Olsa Move the nr_members member from perf's evsel to libperf's perf_evsel. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Alexey Budankov Cc: Andi Kleen Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link:

[PATCH 078/107] libperf: Add own_cpus to struct perf_evsel

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Jiri Olsa Move own_cpus from tools/perf's evsel to libbpf's perf_evsel. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Alexey Budankov Cc: Andi Kleen Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20190721112506.12306-52-jo...@kernel.org

[PATCH 083/107] libperf: Add perf_evlist__set_maps() function

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Jiri Olsa Move the evlist__set_maps() function from tools/perf to libperf. Committer notes: Fix up reject due to earlier inversion in calling perf_evlist__init(). Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Alexey Budankov Cc: Andi Kleen Cc: Michael Petlan Cc: Namhyung Kim

[PATCH 081/107] libperf: Add cpus to struct perf_evlist

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Jiri Olsa Move cpus from tools/perf's evlist to libperf's perf_evlist struct. Committer notes: Fixed up this one: tools/perf/arch/arm/util/cs-etm.c Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Alexey Budankov Cc: Andi Kleen Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter

[PATCH 074/107] libperf: Add perf_evlist__for_each_evsel() iterator

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Jiri Olsa Add a perf_evlist__for_each_evsel() macro to iterate perf_evsel objects in evlist. Introduce the perf_evlist__next() function to do that without exposing 'struct perf_evlist' internals. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Alexey Budankov Cc: Andi Kleen Cc:

[PATCH 080/107] libperf: Add has_user_cpus to struct perf_evlist

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Jiri Olsa Move has_user_cpus from tools/perf's evlist to libbperf's perf_evlist struct. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Alexey Budankov Cc: Andi Kleen Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link:

[PATCH 076/107] libperf: Add perf_evsel__delete() function

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Jiri Olsa Add the perf_evsel__delete() function to delete a perf_evsel instance. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Alexey Budankov Cc: Andi Kleen Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link:

[PATCH 082/107] libperf: Add threads to struct perf_evlist

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Jiri Olsa Move threads from tools/perf's evlist to libperf's perf_evlist struct. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Alexey Budankov Cc: Andi Kleen Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link:

[PATCH 079/107] libperf: Add threads to struct perf_evsel

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Jiri Olsa Move 'threads' from tools/perf's evsel to libperf's perf_evsel struct. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Alexey Budankov Cc: Andi Kleen Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link:

[PATCH 068/107] libperf: Add nr_entries to struct perf_evlist

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Jiri Olsa Move nr_entries count from 'struct perf' to into perf_evlist struct. Committer notes: Fix tools/perf/arch/s390/util/auxtrace.c case. And also the comment in tools/perf/util/annotate.h. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Alexey Budankov Cc: Andi Kleen Cc:

[PATCH 070/107] libperf: Add perf_cpu_map__new()/perf_cpu_map__read() functions

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Jiri Olsa Moving the following functions from tools/perf: cpu_map__new() cpu_map__read() to libperf with the following names: perf_cpu_map__new() perf_cpu_map__read() Committer notes: Fixed up this one: tools/perf/arch/arm/util/cs-etm.c Signed-off-by: Jiri Olsa Cc:

[PATCH 066/107] libperf: Add perf_evlist__add() function

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Jiri Olsa Add the perf_evlist__add() function to add a perf_evsel in a perf_evlist struct. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Alexey Budankov Cc: Andi Kleen Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link:

[PATCH 067/107] libperf: Add perf_evlist__remove() function

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Jiri Olsa Adding perf_evlist__remove() function to remove a perf_evsel from a perf_evlist struct. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Alexey Budankov Cc: Andi Kleen Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link:

[PATCH 073/107] libperf: Add perf_evsel__new() function

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Jiri Olsa Add a perf_evsel__new() function to create and init a perf_evsel struct dynamicaly. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Alexey Budankov Cc: Andi Kleen Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link:

[PATCH 059/107] libperf: Add perf_thread_map__new_dummy() function

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Jiri Olsa Moving the following functions: thread_map__new_dummy() thread_map__realloc() thread_map__set_pid() to libperf with the following names: perf_thread_map__new_dummy() perf_thread_map__realloc() perf_thread_map__set_pid() the other 2 functions are dependencies of

[PATCH 062/107] libperf: Include perf_evsel in evsel object

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Jiri Olsa Including perf_evsel in evsel object, will continue to move other generic things into libperf's perf_evsel struct. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Alexey Budankov Cc: Andi Kleen Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link:

[PATCH 056/107] libperf: Add perf_cpu_map__dummy_new() function

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Jiri Olsa Move cpu_map__dummy_new() to libperf as perf_cpu_map__dummy_new() function. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Alexey Budankov Cc: Andi Kleen Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link:

[PATCH 058/107] libperf: Add perf_thread_map struct

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Jiri Olsa Add perf_thread_map struct to libperf. It's added as a declaration into into: include/perf/threadmap.h which will be included by users. The perf_thread_map struct definition is added into: include/internal/threadmap.h which is not to be included by users, but shared

[PATCH 060/107] libperf: Add perf_thread_map__get()/perf_thread_map__put()

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Jiri Olsa Move the following functions: thread_map__get() thread_map__put() thread_map__comm() to libperf with the following names: perf_thread_map__get() perf_thread_map__put() perf_thread_map__comm() Add the perf_thread_map__comm() function for it to work/compile.

[PATCH 061/107] libperf: Add perf_evlist and perf_evsel structs

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Jiri Olsa Add the perf_evlist and perf_evsel structs to libperf. It's added as a declarations into: include/perf/evlist.h include/perf/evsel.h which will be included by users. The definitions are added into: include/internal/evlist.h include/internal/evsel.h which is not to

[PATCH 063/107] libperf: Include perf_evlist in evlist object

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Jiri Olsa Include perf_evlist in the evlist object, will continue to move other generic things into libperf's perf_evlist. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Alexey Budankov Cc: Andi Kleen Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link:

[PATCH 054/107] libperf: Add debug output support

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Jiri Olsa Add the perf_set_print() function to allow setting an output function for warn/info/debug messages. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Alexey Budankov Cc: Andi Kleen Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link:

[PATCH 057/107] libperf: Add perf_cpu_map__get()/perf_cpu_map__put()

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Jiri Olsa Moving the following functions: cpu_map__get() cpu_map__put() to libperf with following names: perf_cpu_map__get() perf_cpu_map__put() Committer notes: Added fixes for arm/arm64 Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Alexey Budankov Cc: Andi Kleen

[PATCH 055/107] libperf: Add perf_cpu_map struct

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Jiri Olsa Add perf_cpu_map struct to libperf. It's added as a declaration into: include/perf/cpumap.h which will be included by users. The perf_cpu_map struct definition is added into: include/internal/cpumap.h which is not to be included by users, but shared within perf and

[PATCH 050/107] libperf: Make libperf.a part of the perf build

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Jiri Olsa Add an empty libperf.a under tools/perf/lib and link it with perf. It can also be built separately with: $ cd tools/perf/lib && make CC core.o LD libperf-in.o AR libperf.a LINK libperf.so Committer testing: $ make O=/tmp/build/perf -C

[PATCH 048/107] perf evlist: Rename perf_evlist__enable() to evlist__enable()

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Jiri Olsa Rename perf_evlist__enable() to evlist__enable(), so we don't have a name clash when we add perf_evlist__enable() in libperf. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Alexey Budankov Cc: Andi Kleen Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link:

[PATCH 051/107] libperf: Add build version support

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Jiri Olsa Add a shared library version, generating the following files: $ ll tools/perf/lib/libperf.so* libperf.so -> libperf.so.0.0.1 libperf.so.0 -> libperf.so.0.0.1 libperf.so.0.0.1 Committer testing: One has to build just libbperf to get this, building perf so far doesn't

[PATCH 049/107] perf evlist: Rename perf_evlist__disable() to evlist__disable()

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Jiri Olsa Rename perf_evlist__disable() to evlist__disable(), so we don't have a name clash when we add perf_evlist__disable() in libperf. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Alexey Budankov Cc: Andi Kleen Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link:

[PATCH 052/107] libperf: Add libperf to the python.so build

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Jiri Olsa Link libperf.a with python.so. Committer testing: Continues to work: # perf test python 18: 'import perf' in python : Ok # Signed-off-by: Jiri Olsa Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Alexey Budankov Cc: Andi

[PATCH 053/107] libperf: Add perf/core.h header

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Jiri Olsa Add perf/core.h header to be used in header files coming in the following patches. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Alexey Budankov Cc: Andi Kleen Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link:

[PATCH 044/107] perf evsel: Rename perf_evsel__apply_filter() to evsel__apply_filter()

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Jiri Olsa Rename perf_evsel__apply_filter() to evsel__apply_filter(), so we don't have a name clash when we add perf_evsel__apply_filter() in libperf. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Alexey Budankov Cc: Andi Kleen Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter

[PATCH 045/107] perf evsel: Rename perf_evsel__cpus() to evsel__cpus()

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Jiri Olsa Rename perf_evsel__cpus() to evsel__cpus(), so we don't have a name clash when we add perf_evsel__cpus() in libperf. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Alexey Budankov Cc: Andi Kleen Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link:

[PATCH 040/107] perf evlist: Rename perf_evlist__remove() to evlist__remove()

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Jiri Olsa Rename perf_evlist__remove() to evlist__remove(), so we don't have a name clash when we add perf_evlist__remove() in libperf. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Alexey Budankov Cc: Andi Kleen Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link:

[PATCH 039/107] perf evlist: Rename perf_evlist__add() to evlist__add()

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Jiri Olsa Rename perf_evlist__add() to evlist__add(), so we don't have a name clash when we add perf_evlist__add() in libperf. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Alexey Budankov Cc: Andi Kleen Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link:

[PATCH 038/107] perf evsel: Rename perf_evsel__new() to evsel__new()

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Jiri Olsa Rename perf_evsel__new() to evsel__new(), so we don't have a name clash when we add perf_evsel__new() in libperf. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Alexey Budankov Cc: Andi Kleen Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link:

[PATCH 033/107] perf evsel: Rename perf_evsel__init() to evsel__init()

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Jiri Olsa Rename perf_evsel__init() to evsel__init(), so we don't have a name clash when we add perf_evsel__init() in libperf. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Alexey Budankov Cc: Andi Kleen Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link:

[PATCH 047/107] perf evlist: Rename perf_evlist__close() to evlist__close()

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Jiri Olsa Rename perf_evlist__close() to evlist__close(), so we don't have a name clash when we add perf_evlist__close() in libperf. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Alexey Budankov Cc: Andi Kleen Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link:

[PATCH 043/107] perf evsel: Rename perf_evsel__disable() to evsel__disable()

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Jiri Olsa Renaming perf_evsel__disable() to evsel__disable(), so we don't have a name clash when we add perf_evsel__disable() in libperf. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Alexey Budankov Cc: Andi Kleen Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link:

[PATCH 034/107] perf evlist: Rename perf_evlist__init() to evlist__init()

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Jiri Olsa Rename perf_evlist__init() to evlist__init(), so we don't have a name clash when we add perf_evlist__init() in libperf. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Alexey Budankov Cc: Andi Kleen Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link:

[PATCH 037/107] perf evsel: Rename perf_evsel__delete() to evsel__delete()

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Jiri Olsa Remame perf_evsel__delete() to evsel__delete(), so we don't have a name clash when we add perf_evsel__delete() in libperf. Also renaming perf_evsel__delete_priv() to evsel__delete_priv(). Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Alexey Budankov Cc: Andi Kleen Cc:

[PATCH 041/107] perf evsel: Rename perf_evsel__open() to evsel__open()

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Jiri Olsa Rename perf_evsel__open() to evsel__open(), so we don't have a name clash when we add perf_evsel__open() in libperf. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Alexey Budankov Cc: Andi Kleen Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link:

[PATCH 036/107] perf evlist: Rename perf_evlist__delete() to evlist__delete()

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Jiri Olsa Rename perf_evlist__delete() to evlist__delete(), so we don't have a name clash when we add perf_evlist__delete() in libperf. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Alexey Budankov Cc: Andi Kleen Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link:

[PATCH 024/107] perf trace: Mark syscall ids that are not allocated to avoid unnecessary error messages

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Arnaldo Carvalho de Melo There are holes in syscall tables with IDs not associated with any syscall, mark those when trying to read information for syscalls, which could happen when iterating thru all syscalls from 0 to the highest numbered syscall id. Cc: Adrian Hunter Cc: Jiri Olsa

[PATCH 025/107] perf trace: Preallocate the syscall table

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Arnaldo Carvalho de Melo We'll continue reading its details from tracefs as we need it, but preallocate the whole thing otherwise we may realloc and end up with pointers to the previous buffer. I.e. in an upcoming algorithm we'll look for syscalls that have function signatures that are

[PATCH 027/107] perf trace: Add "sendfile64" alias to the "sendfile" syscall

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Arnaldo Carvalho de Melo We were looking in tracefs for: /sys/kernel/debug/tracing/events/syscalls/sys_enter_sendfile/format when what is there is just /sys/kernel/debug/tracing/events/syscalls/sys_enter_sendfile/format Its the same id, 40 in x86_64, so just add an alias and let

[PATCH 022/107] perf trace beauty: Add BPF augmenter for the 'rename' syscall

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Arnaldo Carvalho de Melo I.e. two strings: # perf trace -e rename systemd/1 rename("/run/systemd/units/.#invocation:dnf-makecache.service970761b7f2840dcc", "/run/systemd/units/invocation:dnf-makecache.service") = 0 systemd-journa/715

[PATCH 029/107] perf cpu_map: Rename struct cpu_map to struct perf_cpu_map

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Jiri Olsa Rename struct cpu_map to struct perf_cpu_map, so it could be part of libperf. Committer notes: Added fixes for arm64, provided by Jiri. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Alexey Budankov Cc: Andi Kleen Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter

[PATCH 030/107] perf tools: Rename struct thread_map to struct perf_thread_map

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Jiri Olsa Rename struct thread_map to struct perf_thread_map, so it could be part of libperf. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Alexey Budankov Cc: Andi Kleen Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link:

[PATCH 019/107] perf trace beauty: Do not try to use the fd->pathname beautifier for bind/connect fd arg

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Arnaldo Carvalho de Melo Doesn't make sense and also we now beautify the sockaddr, which provides enough info: # trace -e close,socket,connec* ssh www.bla.com close(5)= 0 socket(PF_INET, SOCK_DGRAM|CLOEXEC|NONBLOCK, IPPROTO_IP) = 5 connect(5, {

[PATCH 018/107] perf trace beauty: Disable fd->pathname when close() not enabled

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Arnaldo Carvalho de Melo As we invalidate the fd->pathname table in the SCA_CLOSE_FD beautifier, if we don't have it we may end up keeping an fd->pathname association that then gets misprinted. The previous behaviour continues when the close() syscall is enabled, which may still be a a

[PATCH 028/107] perf stat: Move loaded out of struct perf_counts_values

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Jiri Olsa Because we will make struct perf_counts_values public in following patches and 'loaded' is implementation related. No functional change is expected. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Alexey Budankov Cc: Andi Kleen Cc: Michael Petlan Cc: Namhyung Kim Cc:

[PATCH 020/107] perf trace beauty: Beautify 'sendto's sockaddr arg

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Arnaldo Carvalho de Melo By just writing the collector in the augmented_raw_syscalls.c BPF program: # perf trace -e sendto ping/23492 sendto(3, 0x56253bbef700, 64, NONE, { .family: PF_INET, port: 0, addr: 10.10.161.32 }, 0x10) = 64 ping/23492 sendto(3, 0x56253bbef700, 64, NONE,

[PATCH 026/107] perf trace: Reuse BPF augmenters from syscalls with similar args signature

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Arnaldo Carvalho de Melo We have an augmenter for the "open" syscall, which has just one pointer, in the first argument, a "const char *", so any other syscall that has just one pointer and that is the first can reuse the "open" BPF augmenter program. Even more, syscalls that get two

[PATCH 016/107] perf augmented_raw_syscalls: Augment sockaddr arg in 'connect'

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Arnaldo Carvalho de Melo We already had a beautifier for an augmented sockaddr payload, but that was when we were hooking on each syscalls:sys_enter_foo tracepoints, since now we're almost doing that by doing a tail call from raw_syscalls:sys_enter, its almost the same, we can reuse it

[PATCH 021/107] perf trace beauty: Beautify bind's sockaddr arg

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Arnaldo Carvalho de Melo By reusing the "connect" BPF collector. Testing it system wide and stopping/starting sshd: # perf trace -e bind LLVM: dumping /home/acme/git/perf/tools/perf/examples/bpf/augmented_raw_syscalls.o DNS Res~er #18/15132 bind(243, { .family: PF_NETLINK }, 12)

[PATCH 014/107] perf trace: Look for default name for entries in the syscalls prog array

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Arnaldo Carvalho de Melo I.e. just look for "!syscalls:sys_enter_" or "exit_" plus the syscall name, that way we need just to add entries to the augmented_raw_syscalls.c BPF source to add handlers. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Luis Cláudio Gonçalves Cc: Namhyung Kim Link:

[PATCH 023/107] perf trace: Forward error codes when trying to read syscall info

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Arnaldo Carvalho de Melo We iterate thru the syscall table produced from the kernel syscall tables reading info, propagate the error and add to the debug message. This helps in fixing further bugs, such as failing to read the "sendfile" syscall info when it really should try the aliasm

[PATCH 007/107] perf trace: Add BPF handler for unaugmented syscalls

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Arnaldo Carvalho de Melo Will be used to assign to syscalls that don't need augmentation, i.e. those with just integer args. All syscalls will be in a BPF_MAP_TYPE_PROG_ARRAY, and the bpf_tail_call() keyed by the syscall id will either find nothing in place, which means the syscall is

[PATCH 012/107] perf augmented_raw_syscalls: Switch to using BPF_MAP_TYPE_PROG_ARRAY

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Arnaldo Carvalho de Melo Trying to control what arguments to copy, which ones were strings, etc all from userspace via maps went nowhere, lots of difficulties to get the verifier satisfied, so use what the fine BPF guys designed for such a syscall handling mechanism: bpf_tail_call +

[PATCH 009/107] perf trace: Put the per-syscall entry/exit prog_array BPF map infrastructure in place

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Arnaldo Carvalho de Melo I.e. look for "syscalls_sys_enter" and "syscalls_sys_exit" BPF maps of type PROG_ARRAY and populate it with the handlers as specified per syscall, for now only 'open' is wiring it to something, in time all syscalls that need to copy arguments entering a syscall or

[PATCH 005/107] perf trace: Look up maps just on the __augmented_syscalls__ BPF object

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Arnaldo Carvalho de Melo We can conceivably have multiple BPF object files for other purposes, so better look just on the BPF object containing the __augmented_syscalls__ map for all things augmented_syscalls related. Cc: Adrian Hunter Cc: Brendan Gregg Cc: Jiri Olsa Cc: Luis Cláudio

[PATCH 002/107] perf bpf: Do not attach a BPF prog to a tracepoint if its name starts with !

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Arnaldo Carvalho de Melo With BPF_MAP_TYPE_PROG_ARRAY + bpf_tail_call() we want to have BPF programs, i.e. functions in a object file that perf's BPF loader shouldn't try to attach to anything, i.e. "!syscalls:sys_enter_open" should just stay there, not be attached to a tracepoint with

[PATCH 011/107] perf augmented_raw_syscalls: Add handler for "openat"

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Arnaldo Carvalho de Melo I.e. for a syscall that has its second argument being a string, its difficult these days to find 'open' being used in the wild :-) Cc: Adrian Hunter Cc: Jiri Olsa Cc: Luis Cláudio Gonçalves Cc: Namhyung Kim Link:

[PATCH 010/107] perf trace: Handle raw_syscalls:sys_enter just like the BPF_OUTPUT augmented event

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Arnaldo Carvalho de Melo So, we use a PERF_COUNT_SW_BPF_OUTPUT to output the augmented sys_enter payload, i.e. to output more than just the raw syscall args, and if something goes wrong when handling an unfiltered syscall, we bail out and just return 1 in the bpf program associated with

[PATCH 008/107] perf trace: Allow specifying the bpf prog to augment specific syscalls

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Arnaldo Carvalho de Melo This is a step in the direction of being able to use a BPF_MAP_TYPE_PROG_ARRAY to handle syscalls that need to copy pointer payloads in addition to the raw tracepoint syscall args. There is a first example in tools/perf/examples/bpf/augmented_raw_syscalls.c for

[PATCH 001/107] perf include bpf: Add bpf_tail_call() prototype

2019-07-29 Thread Arnaldo Carvalho de Melo
From: Arnaldo Carvalho de Melo Will be used together with BPF_MAP_TYPE_PROG_ARRAY in tools/perf/examples/bpf/augmented_raw_syscalls.c. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Luis Cláudio Gonçalves Cc: Namhyung Kim Link: https://lkml.kernel.org/n/tip-pd1bpy8i31nta6jqwdex8...@git.kernel.org

[GIT PULL 000/107] perf/core improvements and fixes

2019-07-29 Thread Arnaldo Carvalho de Melo
Hi Ingo, Please consider pulling, Best regards, - Arnaldo Test results at the end of this message, as usual. The following changes since commit b3c303be4c35856945cb17ec639b94637447dae2: Merge tag 'perf-urgent-for-mingo-5.3-20190729' of git://git.kernel.org/pub/scm/linux/kernel/git

Re: [RFC PATCH 08/21] KVM: x86: Add kvm_x86_ops hook to short circuit emulation

2019-07-29 Thread Sean Christopherson
On Sat, Jul 27, 2019 at 10:38:03AM -0700, Andy Lutomirski wrote: > On Fri, Jul 26, 2019 at 10:52 PM Sean Christopherson > wrote: > > > > Similar to the existing AMD #NPF case where emulation of the current > > instruction is not possible due to lack of information, virtualization > > of Intel SGX

Re: [PATCH 1/4] watchdog device drivers:pc87413_wdt:Rewriting of pc87413_wdt driver to utilize common watchdog interface

2019-07-29 Thread Mark Balantzyan
Yes, each time I go through an edit I discover something I missed, apologies. Will be working on it for a bit, currently getting compile time errors. Just letting you know and it’s good we’re checking :-) Thank you, Mark

Re: [PATCH v4 0/3] Introduce Bandwidth OPPs for interconnects

2019-07-29 Thread Viresh Kumar
On 29-07-19, 13:16, Saravana Kannan wrote: > Sibi might be working on doing that for the SDM845 CPUfreq driver. > Georgi could also change his GPU driver use case to use this BW OPP > table and required-opps. > > The problem is that people don't want to start using this until we > decide on the

[PATCH v5] PM / wakeup: show wakeup sources stats in sysfs

2019-07-29 Thread Tri Vo
Userspace can use wakeup_sources debugfs node to plot history of suspend blocking wakeup sources over device's boot cycle. This information can then be used (1) for power-specific bug reporting and (2) towards attributing battery consumption to specific processes over a period of time. However,

[PATCH] ARM: Replace strncmp with str_has_prefix

2019-07-29 Thread Chuhong Yuan
In commit b6b2735514bc ("tracing: Use str_has_prefix() instead of using fixed sizes") the newly introduced str_has_prefix() was used to replace error-prone strncmp(str, const, len). Here fix codes with the same pattern. Signed-off-by: Chuhong Yuan --- arch/arm/kernel/module-plts.c| 2 +-

[PATCH] arm64: Replace strncmp with str_has_prefix

2019-07-29 Thread Chuhong Yuan
In commit b6b2735514bc ("tracing: Use str_has_prefix() instead of using fixed sizes") the newly introduced str_has_prefix() was used to replace error-prone strncmp(str, const, len). Here fix codes with the same pattern. Signed-off-by: Chuhong Yuan --- arch/arm64/kernel/module-plts.c | 2 +-

Re: [PATCH] cpufreq: ti-cpufreq: Mark expected switch fall-through

2019-07-29 Thread Viresh Kumar
On 29-07-19, 17:49, Gustavo A. R. Silva wrote: > Mark switch cases where we are expecting to fall through. > > This patch fixes the following warning (Building: arm): > > drivers/cpufreq/ti-cpufreq.c: In function ‘dra7_efuse_xlate’: > drivers/cpufreq/ti-cpufreq.c:79:20: warning: this statement

[PATCH net v2] net: ipv6: Fix a bug in ndisc_send_ns when netdev only has a global address

2019-07-29 Thread Su Yanjun
When the egress interface does not have a link local address, it can not communicate with other hosts. In RFC4861, 7.2.2 says "If the source address of the packet prompting the solicitation is the same as one of the addresses assigned to the outgoing interface, that address SHOULD be placed in

Re: [PATCH 1/4] watchdog device drivers:pc87413_wdt:Rewriting of pc87413_wdt driver to utilize common watchdog interface

2019-07-29 Thread Guenter Roeck
On 7/29/19 7:15 PM, Mark Balantzyan wrote: There is a potential for the variable swc_base_addr in the call chain of the driver initialization function (init) to be used before initialization. This brought up the need for, by rewriting the driver to use the common watchdog interface, ensuring to

Re: [PATCH 3/4] watchdog device drivers:pc87413_wdt: Tidying up conversion of pc87413_wdt driver to common watchdog interface, removal of some stray nowayout parameters

2019-07-29 Thread Guenter Roeck
On 7/29/19 7:15 PM, Mark Balantzyan wrote: There is a potential for the variable swc_base_addr in the call chain of the driver initialization function (init) to be used before initialization. This brought up the need for, by rewriting the driver to use the common watchdog interface, ensuring to

Re: [PATCH 4.19 000/113] 4.19.63-stable review

2019-07-29 Thread kernelci.org bot
stable-rc/linux-4.19.y boot: 111 boots: 1 failed, 70 passed with 40 offline (v4.19.62-114-g0c75526c53c7) Full Boot Summary: https://kernelci.org/boot/all/job/stable-rc/branch/linux-4.19.y/kernel/v4.19.62-114-g0c75526c53c7/ Full Build Summary:

Re: [PATCH 1/4] watchdog device drivers:pc87413_wdt:Rewriting of pc87413_wdt driver to utilize common watchdog interface

2019-07-29 Thread Guenter Roeck
On 7/29/19 7:15 PM, Mark Balantzyan wrote: There is a potential for the variable swc_base_addr in the call chain of the driver initialization function (init) to be used before initialization. This brought up the need for, by rewriting the driver to use the common watchdog interface, ensuring to

[PATCH v2] fs: xfs: Fix possible null-pointer dereferences in xchk_da_btree_block_check_sibling()

2019-07-29 Thread Jia-Ju Bai
In xchk_da_btree_block_check_sibling(), there is an if statement on line 274 to check whether ds->state->altpath.blk[level].bp is NULL: if (ds->state->altpath.blk[level].bp) When ds->state->altpath.blk[level].bp is NULL, it is used on line 281: xfs_trans_brelse(...,

[PATCH V3 2/5] thermal: qoriq: Fix error path of calling qoriq_tmu_register_tmu_zone fail

2019-07-29 Thread Anson . Huang
From: Anson Huang When registering tmu zone failed, the error path should be err_tmu instead of err_iomap, as iounmap() needs to be called. Signed-off-by: Anson Huang --- New patch. --- drivers/thermal/qoriq_thermal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

linux-next: build warnings after merge of the keys tree

2019-07-29 Thread Stephen Rothwell
Hi all, After merging the keys tree, today's linux-next build (x86_64 allmodconfig) produced these warnings: In file included from include/linux/keyctl.h:11, from include/linux/key.h:35, from include/linux/cred.h:13, from

[PATCH V3 5/5] dt-bindings: thermal: qoriq: Add optional clocks property

2019-07-29 Thread Anson . Huang
From: Anson Huang Some platforms like i.MX8M series SoCs have clock control for TMU, add optional clocks property to the binding doc. Signed-off-by: Anson Huang Reviewed-by: Rob Herring --- No changes, noted the i.MX8M series SoCs need this clock in commit log. ---

[PATCH V3 1/5] thermal: qoriq: Add clock operations

2019-07-29 Thread Anson . Huang
From: Anson Huang Some platforms like i.MX8MQ has clock control for this module, need to add clock operations to make sure the driver is working properly. Signed-off-by: Anson Huang Reviewed-by: Guido Günther --- Changes since V2: - move this patch as first patch in the series;

[PATCH V3 4/5] thermal: qoriq: Use __maybe_unused instead of #if CONFIG_PM_SLEEP

2019-07-29 Thread Anson . Huang
From: Anson Huang Use __maybe_unused for power management related functions instead of #if CONFIG_PM_SLEEP to simply the code. Signed-off-by: Anson Huang --- No changes. --- drivers/thermal/qoriq_thermal.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git

[PATCH V3 3/5] thermal: qoriq: Use devm_platform_ioremap_resource() instead of of_iomap()

2019-07-29 Thread Anson . Huang
From: Anson Huang Use devm_platform_ioremap_resource() instead of of_iomap() to save the iounmap() call in error handle path; Signed-off-by: Anson Huang --- No change, just adjust the patch sequence and handle the conflicts. --- drivers/thermal/qoriq_thermal.c | 18 ++ 1 file

Re: [PATCH 4/4] watchdog device drivers:pc87413_wdt: Continuing revision of conversion of pc87413_wdt to use common watchdog interface, removed undeclared identifiers

2019-07-29 Thread Guenter Roeck
On 7/29/19 7:15 PM, Mark Balantzyan wrote: There is a potential for the variable swc_base_addr in the call chain of the driver initialization function (init) to be used before initialization. This brought up the need for, by rewriting the driver to use the common watchdog interface, ensuring to

Re: [PATCH] net: phy: phy_led_triggers: Fix a possible null-pointer dereference in phy_led_trigger_change_speed()

2019-07-29 Thread Jia-Ju Bai
On 2019/7/29 21:45, Andrew Lunn wrote: On Mon, Jul 29, 2019 at 05:24:24PM +0800, Jia-Ju Bai wrote: In phy_led_trigger_change_speed(), there is an if statement on line 48 to check whether phy->last_triggered is NULL: if (!phy->last_triggered) When phy->last_triggered is NULL, it is used

Re: [PATCH 2/4] net: phy: Add mdio-aspeed

2019-07-29 Thread Andrew Jeffery
On Mon, 29 Jul 2019, at 23:03, Andrew Lunn wrote: > On Mon, Jul 29, 2019 at 02:09:24PM +0930, Andrew Jeffery wrote: > > The AST2600 design separates the MDIO controllers from the MAC, which is > > where they were placed in the AST2400 and AST2500. Further, the register > > interface is reworked

Re: [PATCH 4/5] pinctrl: uniphier: Add Pro5 PCIe pin-mux settings

2019-07-29 Thread Kunihiko Hayashi
Hello, On Mon, 29 Jul 2019 22:46:02 +0900 wrote: > On Tue, Jul 9, 2019 at 7:29 PM Kunihiko Hayashi > wrote: > > > > Pro5 PCIe interface uses the following pins: > > XPERST, XPEWAKE, XPECLKRQ > > > > Signed-off-by: Kunihiko Hayashi > > --- > >

Re: [PATCH 2/5] pinctrl: uniphier: Add another audio I/O pin-mux settings for LD20

2019-07-29 Thread Kunihiko Hayashi
Hello, On Mon, 29 Jul 2019 22:44:27 +0900 wrote: > On Tue, Jul 9, 2019 at 7:29 PM Kunihiko Hayashi > wrote: > > > > This adds support for pinmux settings of aout1b groups. This group includes > > aout1 signals derived from xirq pins. > > > > Signed-off-by: Kunihiko Hayashi > > --- > >

Re: [PATCH] watchdog device drivers:pc87413_wdt: Rewriting of pc87413_wdt driver to utilize common watchdog interface (fwd)

2019-07-29 Thread Mark Balantzyan
Hi all, Guenter, Sure, it'd be great to work on ib700, doing both, if we may. I feel it's worth a shot in case somebody out there has the hardware to test the pc87413_wdt driver, though I'm doing my best building the individual module and checking for compilation errors (as best I can). I

Re: [PATCH 1/5] pinctrl: uniphier: Separate modem group from UART ctsrts group

2019-07-29 Thread Kunihiko Hayashi
Hello, On Mon, 29 Jul 2019 22:45:01 +0900 wrote: > On Tue, Jul 9, 2019 at 7:29 PM Kunihiko Hayashi > wrote: > > > > It depends on the board implementation whether to have each pins of > > CTS/RTS, and others for modem. So it is necessary to divide current > > uart_ctsrts group into uart_ctsrts

<    1   2   3   4   5   6   7   8   9   10   >