Arnaldo Carvalho de Melo
30f7c59124
perf evsel: Rename perf_evsel__exit() to evsel__exit()
...
As it is a 'struct evsel' method, not part of tools/lib/perf/, aka
libperf, to whom the perf_ prefix belongs.
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Namhyung Kim <namhyung@kernel.org >
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2020-05-05 16:35:30 -03:00
Arnaldo Carvalho de Melo
39453ed559
perf evsel: Rename perf_evsel__is_aux_event() to evsel__is_aux_event()
...
As it is a 'struct evsel' method, not part of tools/lib/perf/, aka
libperf, to whom the perf_ prefix belongs.
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Namhyung Kim <namhyung@kernel.org >
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2020-05-05 16:35:30 -03:00
Arnaldo Carvalho de Melo
e76026bdd5
perf evsel: Rename perf_evsel__find_pmu() to evsel__find_pmu()
...
As it is a 'struct evsel' method, not part of tools/lib/perf/, aka
libperf, to whom the perf_ prefix belongs.
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Namhyung Kim <namhyung@kernel.org >
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2020-05-05 16:35:30 -03:00
Arnaldo Carvalho de Melo
12f5261dac
perf evsel: Rename perf_evsel__compute_deltas() to evsel__compute_deltas()
...
As it is a 'struct evsel' method, not part of tools/lib/perf/, aka
libperf, to whom the perf_ prefix belongs.
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Namhyung Kim <namhyung@kernel.org >
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2020-05-05 16:35:30 -03:00
Arnaldo Carvalho de Melo
5eb88f0476
perf evsel: Rename perf_evsel__nr_cpus() to evsel__nr_cpus()
...
As it is a 'struct evsel' method, not part of tools/lib/perf/, aka
libperf, to whom the perf_ prefix belongs.
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Namhyung Kim <namhyung@kernel.org >
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2020-05-05 16:35:30 -03:00
Arnaldo Carvalho de Melo
65ddce3fd8
perf evsel: Rename 'struct perf_evsel__sb_cb_t' to 'struct evsel__sb_cb_t'
...
As the "perf_" prefix should be restricted to functions and types in
tools/lib/perf/, aka libperf, this way we reduce a bit the confusion for
types only in libperf or the ones in the more contained tools/perf/
project.
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Song Liu <songliubraving@fb.com >
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2020-05-05 16:35:30 -03:00
Adrian Hunter
6dd912cbad
perf intel-pt: Update documentation about using /proc/kcore
...
Update documentation to reflect the advent of the --kcore option for
'perf record'.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Jiri Olsa <jolsa@redhat.com >
Link: http://lore.kernel.org/lkml/20200429150751.12570-10-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2020-05-05 16:35:30 -03:00
Adrian Hunter
43358d9dfb
perf intel-pt: Update documentation about itrace G and L options
...
Provide a little more information about the new G and L options,
particularly the issue with large PEBs.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Jiri Olsa <jolsa@redhat.com >
Link: http://lore.kernel.org/lkml/20200429150751.12570-9-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2020-05-05 16:35:30 -03:00
Adrian Hunter
f0a0251cee
perf intel-pt: Add support for synthesizing branch stacks for regular events
...
Use the new thread_stack__br_sample_late() function to create a thread
stack for regular events.
Example:
# perf record --kcore --aux-sample -e '{intel_pt//,cycles:ppp}' -c 10000 uname
Linux
[ perf record: Woken up 2 times to write data ]
[ perf record: Captured and wrote 0.743 MB perf.data ]
# perf report --itrace=Le --stdio | head -30 | tail -18
# Samples: 11K of event 'cycles:ppp'
# Event count (approx.): 11648
#
# Overhead Command Source Shared Object Source Symbol Target Symbol Basic Block Cycles
# ........ ....... .................... ............................ ............................ ..................
#
5.49% uname libc-2.30.so [.] _dl_addr [.] _dl_addr -
2.41% uname ld-2.30.so [.] _dl_relocate_object [.] _dl_relocate_object -
2.31% uname ld-2.30.so [.] do_lookup_x [.] do_lookup_x -
2.17% uname [kernel.kallsyms] [k] unmap_page_range [k] unmap_page_range -
2.05% uname ld-2.30.so [k] _dl_start [k] _dl_start -
1.97% uname ld-2.30.so [.] _dl_lookup_symbol_x [.] _dl_lookup_symbol_x -
1.94% uname [kernel.kallsyms] [k] filemap_map_pages [k] filemap_map_pages -
1.60% uname [kernel.kallsyms] [k] __handle_mm_fault [k] __handle_mm_fault -
1.44% uname [kernel.kallsyms] [k] page_add_file_rmap [k] page_add_file_rmap -
1.12% uname [kernel.kallsyms] [k] vma_interval_tree_insert [k] vma_interval_tree_insert -
0.94% uname [kernel.kallsyms] [k] perf_iterate_ctx [k] perf_iterate_ctx -
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Jiri Olsa <jolsa@redhat.com >
Link: http://lore.kernel.org/lkml/20200429150751.12570-8-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2020-05-05 16:35:30 -03:00
Adrian Hunter
3749e0bbde
perf thread-stack: Add thread_stack__br_sample_late()
...
Add a thread stack function to create a branch stack for hardware events
where the sample records get created some time after the event occurred.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Jiri Olsa <jolsa@redhat.com >
Link: http://lore.kernel.org/lkml/20200429150751.12570-7-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2020-05-05 16:35:29 -03:00
Adrian Hunter
6cd2cbfc68
perf evsel: Add support for synthesized branch stack sample type
...
Allow for a synthesized branch stack to be added to samples. As with
synthesized call chains, the sample type cannot be changed because it is
needed to continue to parse events. So add and use helper function
evsel__has_br_stack() to indicate a branch stack, whether original or
synthesized.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Jiri Olsa <jolsa@redhat.com >
Link: http://lore.kernel.org/lkml/20200429150751.12570-6-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2020-05-05 16:35:29 -03:00
Adrian Hunter
ec90e42ce5
perf auxtrace: Add option to synthesize branch stack for regular events
...
There is an existing option to synthesize branch stacks for synthesized
events. Add a new option to synthesize branch stacks for regular events.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Jiri Olsa <jolsa@redhat.com >
Link: http://lore.kernel.org/lkml/20200429150751.12570-5-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2020-05-05 16:35:29 -03:00
Adrian Hunter
cf888e08a0
perf intel-pt: Change branch stack support to use thread-stacks
...
Change Intel PT's branch stack support to use thread stacks. The
advantages of using branch stack support from the thread-stack are:
1. the branches are accumulated separately for each thread
2. the branch stack is cleared only in between continuous traces
This helps pave the way for adding branch stacks to regular events, not
just synthesized events as at present.
While the 2 approaches are not identical, in simple cases the results
can be identical e.g.
Before:
# perf record --kcore -e intel_pt// uname
# perf script --itrace=i10usl -F+brstacksym,+addr,+flags > cmp1.txt
After:
# perf script --itrace=i10usl -F+brstacksym,+addr,+flags > cmp2.txt
# diff -s cmp1.txt cmp2.txt
Files cmp1.txt and cmp2.txt are identical
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Jiri Olsa <jolsa@redhat.com >
Link: http://lore.kernel.org/lkml/20200429150751.12570-4-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2020-05-05 16:35:29 -03:00
Adrian Hunter
1ef998ff18
perf intel-pt: Consolidate thread-stack use condition
...
The components of the condition do not change, so consolidate them in
one variable.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Jiri Olsa <jolsa@redhat.com >
Link: http://lore.kernel.org/lkml/20200429150751.12570-3-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2020-05-05 16:35:29 -03:00
Adrian Hunter
86d67180b9
perf thread-stack: Add branch stack support
...
Intel PT already has support for creating branch stacks for each context
(per-cpu or per-thread). In the more common per-cpu case, the branch stack
is not separated for different threads, instead being cleared in between
each sample.
That approach will not work very well for adding branch stacks to
regular events. The branch stacks really need to be accumulated
separately for each thread.
As a start to accomplishing that, this patch adds support for putting
branch stack support into the thread-stack. The advantages are:
1. the branches are accumulated separately for each thread
2. the branch stack is cleared only in between continuous traces
This helps pave the way for adding branch stacks to regular events, not
just synthesized events as at present.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Jiri Olsa <jolsa@redhat.com >
Link: http://lore.kernel.org/lkml/20200429150751.12570-2-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2020-05-05 16:35:29 -03:00
Konstantin Khlebnikov
bb629484d9
perf tools: Simplify checking if SMT is active.
...
SMT now could be disabled via "/sys/devices/system/cpu/smt/control".
Status is shown in "/sys/devices/system/cpu/smt/active" simply as "0" / "1".
If this knob isn't here then fallback to checking topology as before.
Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Dmitry Monakhov <dmtrmonakhov@yandex-team.ru >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Kan Liang <kan.liang@linux.intel.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Link: http://lore.kernel.org/lkml/158817741394.748034.9273604089138009552.stgit@buzz
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2020-05-05 16:35:29 -03:00
Konstantin Khlebnikov
846de4371f
perf tools: Fix reading new topology attribute "core_cpus"
...
Check if access("devices/system/cpu/cpu%d/topology/core_cpus", F_OK)
fails, which will happen unless the current directory is "/sys".
Simply try to read this file first.
Fixes: 0ccdb8407a ("perf tools: Apply new CPU topology sysfs attributes")
Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Dmitry Monakhov <dmtrmonakhov@yandex-team.ru >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Kan Liang <kan.liang@linux.intel.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Link: http://lore.kernel.org/lkml/158817718710.747528.11009278875028211991.stgit@buzz
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2020-05-05 16:35:29 -03:00
Ian Rogers
4599d29212
libperf evlist: Fix a refcount leak
...
Memory leaks found by applying LLVM's libfuzzer on the tools/perf
parse_events function.
Signed-off-by: Ian Rogers <irogers@google.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Jiri Olsa <jolsa@redhat.com >
Cc: Leo Yan <leo.yan@linaro.org >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Stephane Eranian <eranian@google.com >
Cc: clang-built-linux@googlegroups.com
Link: http://lore.kernel.org/lkml/20200319023101.82458-2-irogers@google.com
[ Did a minor adjustment due to some other previous patch having already set evlist->all_cpus to NULL at perf_evlist__exit() ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2020-05-05 16:35:29 -03:00
Ian Rogers
ba08829aac
perf parse-events: Fix another memory leaks found on parse_events()
...
Fix another memory leak found by applying LLVM's libfuzzer on parse_events().
Signed-off-by: Ian Rogers <irogers@google.com >
Acked-by: Jiri Olsa <jolsa@redhat.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Leo Yan <leo.yan@linaro.org >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Stephane Eranian <eranian@google.com >
Cc: clang-built-linux@googlegroups.com
Link: http://lore.kernel.org/lkml/20200319023101.82458-1-irogers@google.com
[ split from a larger patch ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2020-05-05 16:35:29 -03:00
Ian Rogers
672f707ef5
perf parse-events: Fix memory leaks found on parse_events
...
free_list_evsel() deals with tools/perf/ evsels, not with libperf
perf_evsels, use the right destructor and avoid a leak, as
evsel__delete() will delete something perf_evsel__delete() doesn't.
Signed-off-by: Ian Rogers <irogers@google.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Acked-by: Jiri Olsa <jolsa@redhat.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Leo Yan <leo.yan@linaro.org >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Stephane Eranian <eranian@google.com >
Cc: clang-built-linux@googlegroups.com
Link: http://lore.kernel.org/lkml/20200319023101.82458-1-irogers@google.com
[ split from a larger patch ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2020-05-05 16:35:29 -03:00
Ian Rogers
e8dfb81838
perf parse-events: Fix memory leaks found on parse_events
...
Fix a memory leak found by applying LLVM's libfuzzer on parse_events().
Signed-off-by: Ian Rogers <irogers@google.com >
Acked-by: Jiri Olsa <jolsa@redhat.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Leo Yan <leo.yan@linaro.org >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Stephane Eranian <eranian@google.com >
Cc: clang-built-linux@googlegroups.com
Link: http://lore.kernel.org/lkml/20200319023101.82458-1-irogers@google.com
[ split from a larger patch, use zfree() ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2020-05-05 16:35:29 -03:00
He Zhe
44d041b7b2
libperf: Add NULL pointer check for cpu_map iteration and NULL assignment for all_cpus.
...
A NULL pointer may be passed to perf_cpu_map__cpu and then cause a
crash, such as the one commit cb71f7d43e ("libperf: Setup initial
evlist::all_cpus value") fix.
Signed-off-by: He Zhe <zhe.he@windriver.com >
Acked-by: Jiri Olsa <jolsa@kernel.org >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Kyle Meyer <meyerk@hpe.com >
Link: http://lore.kernel.org/lkml/1583665157-349023-1-git-send-email-zhe.he@windriver.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2020-05-05 16:35:29 -03:00
Arnaldo Carvalho de Melo
23cbb41c93
perf record: Move side band evlist setup to separate routine
...
It is quite big by now, move that code to a separate
record__setup_sb_evlist() routine.
Suggested-by: Jiri Olsa <jolsa@redhat.com >
Acked-by: Jiri Olsa <jolsa@redhat.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Song Liu <songliubraving@fb.com >
Link: http://lore.kernel.org/lkml/20200429131106.27974-9-acme@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2020-05-05 16:35:29 -03:00
Arnaldo Carvalho de Melo
899e5ffbf2
perf record: Introduce --switch-output-event
...
Now we can use it with --overwrite to have a flight recorder mode that
gets snapshot requests from arbitrary events that are processed in the
side band thread together with the PERF_RECORD_BPF_EVENT processing.
Example:
To collect scheduler events until a recvmmsg syscall happens, system
wide:
[root@five a]# rm -f perf.data.2020042717*
[root@five a]# perf record --overwrite -e sched:*switch,syscalls:*recvmmsg --switch-output-event syscalls:sys_enter_recvmmsg
[ perf record: dump data: Woken up 1 times ]
[ perf record: Dump perf.data.2020042717585458 ]
[ perf record: dump data: Woken up 1 times ]
[ perf record: Dump perf.data.2020042717590235 ]
[ perf record: dump data: Woken up 1 times ]
[ perf record: Dump perf.data.2020042717590398 ]
^C[ perf record: Woken up 1 times to write data ]
[ perf record: Dump perf.data.2020042717590511 ]
[ perf record: Captured and wrote 7.244 MB perf.data.<timestamp> ]
So in the above case we had 3 snapshots, the fourth was forced by
control+C:
[root@five a]# ls -la
total 20440
drwxr-xr-x. 2 root root 4096 Apr 27 17:59 .
dr-xr-x---. 12 root root 4096 Apr 27 17:46 ..
-rw-------. 1 root root 3936125 Apr 27 17:58 perf.data.2020042717585458
-rw-------. 1 root root 5074869 Apr 27 17:59 perf.data.2020042717590235
-rw-------. 1 root root 4291037 Apr 27 17:59 perf.data.2020042717590398
-rw-------. 1 root root 7617037 Apr 27 17:59 perf.data.2020042717590511
[root@five a]#
One can make this more precise by adding the switch output event to the
main -e events list, as since this is done asynchronously, a few events
after the signal event will appear in the snapshots, as can be seen
with:
[root@five a]# rm -f perf.data.20200427175*
[root@five a]# perf record --overwrite -e sched:*switch,syscalls:*recvmmsg --switch-output-event syscalls:sys_enter_recvmmsg
[ perf record: dump data: Woken up 1 times ]
[ perf record: Dump perf.data.2020042718024203 ]
[ perf record: dump data: Woken up 1 times ]
[ perf record: Dump perf.data.2020042718024301 ]
[ perf record: dump data: Woken up 1 times ]
[ perf record: Dump perf.data.2020042718024484 ]
^C[ perf record: Woken up 1 times to write data ]
[ perf record: Dump perf.data.2020042718024562 ]
[ perf record: Captured and wrote 7.337 MB perf.data.<timestamp> ]
[root@five a]# perf script -i perf.data.2020042718024203 | tail -15
PacerThread 148586 [005] 122.830729: sched:sched_switch: prev_comm=PacerThread prev_pid=148586...
swapper 0 [000] 122.833588: sched:sched_switch: prev_comm=swapper/0 prev_pid=...
NetworkManager 1251 [000] 122.833619: syscalls:sys_enter_recvmmsg: fd: 0x0000001c, mmsg: 0x7ffe83054a1...
swapper 0 [002] 122.833624: sched:sched_switch: prev_comm=swapper/2 prev_pid=...
swapper 0 [003] 122.833624: sched:sched_switch: prev_comm=swapper/3 prev_pid=...
NetworkManager 1251 [000] 122.833626: syscalls:sys_exit_recvmmsg: 0x1
kworker/3:3-eve 158946 [003] 122.833628: sched:sched_switch: prev_comm=kworker/3:3 prev_pid=15894...
swapper 0 [004] 122.833641: sched:sched_switch: prev_comm=swapper/4 prev_pid=...
NetworkManager 1251 [000] 122.833642: sched:sched_switch: prev_comm=NetworkManage...
perf 228273 [002] 122.833645: sched:sched_switch: prev_comm=perf prev_pid=22827...
swapper 0 [011] 122.833646: sched:sched_switch: prev_comm=swapper/1...
swapper 0 [002] 122.833648: sched:sched_switch: prev_comm=swapper/...
kworker/0:2-eve 207387 [000] 122.833648: sched:sched_switch: prev_comm=kworker/0:2 prev_pid=20738...
kworker/2:3-eve 232038 [002] 122.833652: sched:sched_switch: prev_comm=kworker/2:3 prev_pid=23203...
perf 235825 [003] 122.833653: sched:sched_switch: prev_comm=perf prev_pid=23582...
[root@five a]#
Acked-by: Jiri Olsa <jolsa@redhat.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Song Liu <songliubraving@fb.com >
Cc: Wang Nan <wangnan0@huawei.com >
Link: http://lore.kernel.org/lkml/20200429131106.27974-8-acme@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2020-05-05 16:35:29 -03:00
Arnaldo Carvalho de Melo
636eb4d001
libsubcmd: Introduce OPT_CALLBACK_SET()
...
To register that an option was set, like with the upcoming 'perf record
--switch-output-option' one.
Acked-by: Jiri Olsa <jolsa@redhat.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Song Liu <songliubraving@fb.com >
Link: http://lore.kernel.org/lkml/20200429131106.27974-7-acme@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2020-05-05 16:35:29 -03:00
Arnaldo Carvalho de Melo
976be84504
perf evlist: Allow reusing the side band thread for more purposes
...
I.e. so far we had just one event in that side band thread, a dummy one
with attr.bpf_event set, so that 'perf record' can go ahead and ask the
kernel for further information about BPF programs being loaded.
Allow for more than one event to be there, so that we can use it as
well for the upcoming --switch-output-event feature.
Acked-by: Jiri Olsa <jolsa@redhat.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Song Liu <songliubraving@fb.com >
Link: http://lore.kernel.org/lkml/20200429131106.27974-6-acme@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2020-05-05 16:35:29 -03:00
Arnaldo Carvalho de Melo
9a39994467
perf evlist: Move the sideband thread routines to separate object
...
To avoid dragging more stuff into the perf python binding in the
following csets.
Reported-by: Jiri Olsa <jolsa@kernel.org >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2020-05-05 16:35:29 -03:00
Arnaldo Carvalho de Melo
d0abbc3ce6
perf parse-events: Add parse_events_option() variant that creates evlist
...
For the upcoming --switch-output-event option we want to create the side
band event, populate it with the specified events and then, if it is
present multiple times, go on adding to it, then, if the BPF tracking is
required, use the first event to set its attr.bpf_event to get those
PERF_RECORD_BPF_EVENT metadata events too.
Acked-by: Jiri Olsa <jolsa@redhat.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Song Liu <songliubraving@fb.com >
Link: http://lore.kernel.org/lkml/20200429131106.27974-5-acme@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2020-05-05 16:35:29 -03:00
Arnaldo Carvalho de Melo
b38d85ef49
perf bpf: Decouple creating the evlist from adding the SB event
...
Renaming bpf_event__add_sb_event() to evlist__add_sb_event() and
requiring that the evlist be allocated beforehand.
This will allow using the same side band thread and evlist to be used
for multiple purposes in addition to react to PERF_RECORD_BPF_EVENT soon
after they are generated.
Acked-by: Jiri Olsa <jolsa@redhat.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Song Liu <songliubraving@fb.com >
Link: http://lore.kernel.org/lkml/20200429131106.27974-4-acme@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2020-05-05 16:35:29 -03:00
Arnaldo Carvalho de Melo
ca6c9c8b10
perf top: Move sb_evlist to 'struct perf_top'
...
Where state related to a 'perf top' session is grouped.
Acked-by: Jiri Olsa <jolsa@redhat.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Song Liu <songliubraving@fb.com >
Link: http://lore.kernel.org/lkml/20200429131106.27974-3-acme@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2020-05-05 16:35:29 -03:00
Arnaldo Carvalho de Melo
bc477d7983
perf record: Move sb_evlist to 'struct record'
...
Where state related to a 'perf record' session is grouped.
Acked-by: Jiri Olsa <jolsa@redhat.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Song Liu <songliubraving@fb.com >
Link: http://lore.kernel.org/lkml/20200429131106.27974-2-acme@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2020-05-05 16:35:28 -03:00
Arnaldo Carvalho de Melo
40c7d2460e
perf tools: Move routines that probe for perf API features to separate file
...
Trying to disentangle this a bit further, unfortunately it uses
parse_events(), its interesting to have it separated anyway, so do it.
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Namhyung Kim <namhyung@kernel.org >
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2020-05-05 16:35:26 -03:00
Stephen Boyd
bbd7ffdbef
clk: Allow the common clk framework to be selectable
...
Enable build testing and configuration control of the common clk
framework so that more code coverage and testing can be done on the
common clk framework across various architectures. This also nicely
removes the requirement that architectures must select the framework
when they don't use it in architecture code.
There's one snag with doing this, and that's making sure that randconfig
builds don't select this option when some architecture or platform
implements 'struct clk' outside of the common clk framework. Introduce a
new config option 'HAVE_LEGACY_CLK' to indicate those platforms that
haven't migrated to the common clk framework and therefore shouldn't be
allowed to select this new config option. Also add a note that we hope
one day to remove this config entirely.
Based on a patch by Mark Brown <broonie@kernel.org >.
Cc: Mark Brown <broonie@kernel.org >
Cc: Geert Uytterhoeven <geert@linux-m68k.org >
Cc: Mark Salter <msalter@redhat.com >
Cc: Aurelien Jacquiot <jacquiot.aurelien@gmail.com >
Cc: Jiaxun Yang <jiaxun.yang@flygoat.com >
Cc: Guan Xuetao <gxt@pku.edu.cn >
Cc: Russell King <linux@armlinux.org.uk >
Cc: Arnd Bergmann <arnd@arndb.de >
Cc: Yoshinori Sato <ysato@users.sourceforge.jp >
Cc: Rich Felker <dalias@libc.org >
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de >
Cc: <linux-mips@vger.kernel.org >
Cc: <linux-c6x-dev@linux-c6x.org >
Cc: <linux-m68k@lists.linux-m68k.org >
Cc: <linux-arm-kernel@lists.infradead.org >
Cc: <linux-sh@vger.kernel.org >
Link: https://lore.kernel.org/r/1470915049-15249-1-git-send-email-broonie@kernel.org
Signed-off-by: Stephen Boyd <sboyd@kernel.org >
Link: https://lkml.kernel.org/r/20200409064416.83340-8-sboyd@kernel.org
Reviewed-by: Mark Brown <broonie@kernel.org >
Reviewed-by: Arnd Bergmann <arnd@arndb.de >
2020-05-05 12:34:11 -07:00
Stephen Boyd
3fd2fdb311
mmc: meson-mx-sdio: Depend on OF_ADDRESS and not just OF
...
Making COMMON_CLK a visible option causes the sparc allyesconfig to fail
to build like so:
sparc64-linux-ld: drivers/mmc/host/meson-mx-sdio.o: in function `meson_mx_mmc_remove':
meson-mx-sdio.c:(.text+0x70): undefined reference to `of_platform_device_destroy'
sparc64-linux-ld: drivers/mmc/host/meson-mx-sdio.o: in function `meson_mx_mmc_probe':
meson-mx-sdio.c:(.text+0x9e4): undefined reference to `of_platform_device_create'
sparc64-linux-ld: meson-mx-sdio.c:(.text+0xdd4): undefined reference to `of_platform_device_destroy'
This is because the implementation of of_platform_device_destroy() is
inside an #ifdef CONFIG_OF_ADDRESS section of drivers/of/platform.c.
This driver already depends on OF being enabled, so let's tighten that
constrain a little more so that it depends on OF_ADDRESS instead. This
way we won't try to build this driver on platforms that don't have this
function.
Reported-by: kbuild test robot <lkp@intel.com >
Cc: Neil Armstrong <narmstrong@baylibre.com >
Cc: Ulf Hansson <ulf.hansson@linaro.org >
Signed-off-by: Stephen Boyd <sboyd@kernel.org >
Link: https://lkml.kernel.org/r/20200409064416.83340-7-sboyd@kernel.org
Acked-by: Ulf Hansson <ulf.hansson@linaro.org >
Reviewed-by: Arnd Bergmann <arnd@arndb.de >
2020-05-05 12:34:06 -07:00
Stephen Boyd
b62bc0474b
MIPS: Remove redundant CLKDEV_LOOKUP selects
...
The ATH79 config selects COMMON_CLK already, and the COMMON_CLK config
option already selects CLKDEV_LOOKUP, and CLKDEV_LOOKUP already selects
HAVE_CLK so it's redundant to have these selected again.
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de >
Cc: <linux-mips@vger.kernel.org >
Signed-off-by: Stephen Boyd <sboyd@kernel.org >
Reviewed-by: Arnd Bergmann <arnd@arndb.de >
Link: https://lkml.kernel.org/r/20200409064416.83340-6-sboyd@kernel.org
2020-05-05 12:34:04 -07:00
Stephen Boyd
ba76c40dbe
h8300: Remove redundant CLKDEV_LOOKUP selects
...
The h8300 architecture selects COMMON_CLK already, and the COMMON_CLK
config option already selects CLKDEV_LOOKUP so it's redundant to have
this selected again.
Cc: Yoshinori Sato <ysato@users.sourceforge.jp >
Cc: uclinux-h8-devel@lists.sourceforge.jp
Cc: Arnd Bergmann <arnd@arndb.de >
Signed-off-by: Stephen Boyd <sboyd@kernel.org >
Reviewed-by: Arnd Bergmann <arnd@arndb.de >
Link: https://lkml.kernel.org/r/20200409064416.83340-5-sboyd@kernel.org
2020-05-05 12:34:01 -07:00
Stephen Boyd
d823836ad1
arm64: tegra: Remove redundant CLKDEV_LOOKUP selects
...
The arm64 architecture selects COMMON_CLK at the toplevel ARM64 config.
The COMMON_CLK config option already selects CLKDEV_LOOKUP so it's
redundant to have this selected again for the Tegra specific config.
Cc: Paul Walmsley <paul@pwsan.com >
Acked-by: Thierry Reding <treding@nvidia.com >
Cc: Catalin Marinas <catalin.marinas@arm.com >
Cc: Will Deacon <will@kernel.org >
Cc: <linux-arm-kernel@lists.infradead.org >
Cc: Arnd Bergmann <arnd@arndb.de >
Signed-off-by: Stephen Boyd <sboyd@kernel.org >
Reviewed-by: Arnd Bergmann <arnd@arndb.de >
Link: https://lkml.kernel.org/r/20200409064416.83340-4-sboyd@kernel.org
2020-05-05 12:33:59 -07:00
Stephen Boyd
e8bd633bc0
ARM: Remove redundant CLKDEV_LOOKUP selects
...
These platforms select COMMON_CLK indirectly through use of the
ARCH_MULTIPLATFORM config option that they depend on implicitly via some
V7/V6/V5 multi platform config option. The COMMON_CLK config option
already selects CLKDEV_LOOKUP so it's redundant to have this selected
again.
Cc: Tony Prisk <linux@prisktech.co.nz >
Cc: Russell King <linux@armlinux.org.uk >
Cc: <linux-arm-kernel@lists.infradead.org >
Cc: Arnd Bergmann <arnd@arndb.de >
Signed-off-by: Stephen Boyd <sboyd@kernel.org >
Reviewed-by: Arnd Bergmann <arnd@arndb.de >
Link: https://lkml.kernel.org/r/20200409064416.83340-3-sboyd@kernel.org
2020-05-05 12:33:57 -07:00
Stephen Boyd
38d6d84884
ARM: Remove redundant COMMON_CLK selects
...
The mulitplatform config already selects COMMON_CLK, so selecting it
again is not useful. Remove these selects from ARM platforms that are
part of the multiplatform build.
Reviewed-by: "Andreas Färber" <afaerber@suse.de > # actions
Acked-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org > # actions
Cc: Russell King <linux@armlinux.org.uk >
Cc: Alexander Shiyan <shc_work@mail.ru >
Cc: Lubomir Rintel <lkundrak@v3.sk >
Cc: <linux-arm-kernel@lists.infradead.org >
Cc: Arnd Bergmann <arnd@arndb.de >
Signed-off-by: Stephen Boyd <sboyd@kernel.org >
Reviewed-by: Arnd Bergmann <arnd@arndb.de >
Link: https://lkml.kernel.org/r/20200409064416.83340-2-sboyd@kernel.org
2020-05-05 12:33:50 -07:00
Stephen Boyd
e8b81b1ea3
Merge tag 'clk-renesas-for-v5.8-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers into clk-renesas
...
Pull Renesas clk driver updates from Geert Uytterhoeven:
- Add support for the USB 2.0 clock selector on R-Car M3-W+
- Add support for the new RZ/G1H (R8A7742) SoC
- Minor fixes and cleanups
* tag 'clk-renesas-for-v5.8-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers:
clk: renesas: rcar-gen2: Remove superfluous CLK_RENESAS_DIV6 selects
clk: renesas: cpg-mssr: Add R8A7742 support
dt-bindings: clock: renesas: cpg-mssr: Document r8a7742 binding
clk: renesas: Add r8a7742 CPG Core Clock Definitions
dt-bindings: power: rcar-sysc: Add r8a7742 power domain index macros
MAINTAINERS: Add DT Bindings for Renesas Clock Generators
clk: renesas: r9a06g032: Fix some typo in comments
dt-bindings: clock: renesas: rcar-usb2-clock-sel: Add r8a77961 support
2020-05-05 12:28:46 -07:00
Christophe JAILLET
4fe02fefe7
clk: clk-xgene: Fix a typo in Kconfig
...
s/Sypport/Support
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr >
Link: https://lkml.kernel.org/r/20200503190327.153249-1-christophe.jaillet@wanadoo.fr
Signed-off-by: Stephen Boyd <sboyd@kernel.org >
2020-05-05 12:28:19 -07:00
Xiaoguang Wang
7f13657d14
io_uring: handle -EFAULT properly in io_uring_setup()
...
If copy_to_user() in io_uring_setup() failed, we'll leak many kernel
resources, which will be recycled until process terminates. This bug
can be reproduced by using mprotect to set params to PROT_READ. To fix
this issue, refactor io_uring_create() a bit to add a new 'struct
io_uring_params __user *params' parameter and move the copy_to_user()
in io_uring_setup() to io_uring_setup(), if copy_to_user() failed,
we can free kernel resource properly.
Suggested-by: Jens Axboe <axboe@kernel.dk >
Signed-off-by: Xiaoguang Wang <xiaoguang.wang@linux.alibaba.com >
Signed-off-by: Jens Axboe <axboe@kernel.dk >
2020-05-05 13:18:11 -06:00
YueHaibing
782fe98b93
clk: Remove unused inline function clk_debug_reparent
...
There's no callers in-tree anymore.
Signed-off-by: YueHaibing <yuehaibing@huawei.com >
Link: https://lkml.kernel.org/r/20200505083001.52564-1-yuehaibing@huawei.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org >
2020-05-05 12:16:33 -07:00
Linus Walleij
24661081ba
clk: impd1: Look up clock-output-names
...
The IM-PD1 still need to pass the clock output names.
Signed-off-by: Linus Walleij <linus.walleij@linaro.org >
Link: https://lkml.kernel.org/r/20200416081348.326833-1-linus.walleij@linaro.org
Fixes: 84655b762a ("clk: versatile: Add device tree probing for IM-PD1 clocks")
Signed-off-by: Stephen Boyd <sboyd@kernel.org >
2020-05-05 12:13:12 -07:00
Marc Zyngier
018d4671b9
clk: Unlink clock if failed to prepare or enable
...
On failing to prepare or enable a clock, remove the core structure
from the list it has been inserted as it is about to be freed.
This otherwise leads to random crashes when subsequent clocks get
registered, during which parsing of the clock tree becomes adventurous.
Observed with QEMU's RPi-3 emulation.
Fixes: 12ead77432 ("clk: Don't try to enable critical clocks if prepare failed")
Signed-off-by: Marc Zyngier <maz@kernel.org >
Cc: Guenter Roeck <linux@roeck-us.net >
Cc: Stephen Boyd <sboyd@kernel.org >
Cc: Michael Turquette <mturquette@baylibre.com >
Link: https://lkml.kernel.org/r/20200505140953.409430-1-maz@kernel.org
Signed-off-by: Stephen Boyd <sboyd@kernel.org >
2020-05-05 12:12:00 -07:00
Yoshihiro Shimoda
dba496f361
dt-bindings: iommu: renesas,ipmmu-vmsa: convert to json-schema
...
Convert Renesas VMSA-Compatible IOMMU bindings documentation
to json-schema.
Note that original documentation doesn't mention renesas,ipmmu-vmsa
for R-Mobile APE6. But, R-Mobile APE6 is similar to the R-Car
Gen2. So, renesas,ipmmu-r8a73a4 belongs the renesas,ipmmu-vmsa
section.
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com >
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be >
Signed-off-by: Rob Herring <robh@kernel.org >
2020-05-05 14:10:54 -05:00
David S. Miller
fe121e078d
sch_choke: Remove classid from choke_skb_cb.
...
Suggested by Cong Wang.
Signed-off-by: David S. Miller <davem@davemloft.net >
2020-05-05 12:08:02 -07:00
YueHaibing
5b545cbc0a
net: sierra_net: Remove unused inline function
...
There's no callers in-tree
Signed-off-by: YueHaibing <yuehaibing@huawei.com >
Signed-off-by: David S. Miller <davem@davemloft.net >
2020-05-05 12:07:43 -07:00
YueHaibing
e36cac0c05
bnx2x: Remove unused inline function bnx2x_vf_vlan_credit
...
commit 05cc5a39dd ("bnx2x: add vlan filtering offload")
left behind this, remove it.
Signed-off-by: YueHaibing <yuehaibing@huawei.com >
Signed-off-by: David S. Miller <davem@davemloft.net >
2020-05-05 12:07:43 -07:00
YueHaibing
592138a88d
net: sched: choke: Remove unused inline function choke_set_classid
...
There's no callers in-tree anymore since commit 5952fde10c ("net:
sched: choke: remove dead filter classify code")
Signed-off-by: YueHaibing <yuehaibing@huawei.com >
Signed-off-by: David S. Miller <davem@davemloft.net >
2020-05-05 12:07:43 -07:00