2019-05-27 08:55:05 +02:00
|
|
|
|
2009-10-08 17:17:38 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-01-22 11:24:34 -02:00
|
|
|
|
2019-08-30 10:26:37 -03:00
|
|
|
|
2009-12-08 17:03:23 -05:00
|
|
|
|
2011-01-20 23:15:39 +09:00
|
|
|
|
2021-10-18 14:48:42 +01:00
|
|
|
|
2019-08-30 11:56:47 -03:00
|
|
|
|
2009-10-16 20:08:10 -04:00
|
|
|
|
2015-12-15 09:39:39 -06:00
|
|
|
|
2009-10-08 17:17:38 -04:00
|
|
|
|
2009-11-30 19:19:58 -05:00
|
|
|
|
2015-09-04 21:16:03 +09:00
|
|
|
|
2019-08-29 16:18:59 -03:00
|
|
|
|
2019-07-04 11:32:27 -03:00
|
|
|
|
2009-10-08 17:17:38 -04:00
|
|
|
|
2011-01-20 23:15:39 +09:00
|
|
|
|
2021-07-04 00:35:34 +09:00
|
|
|
|
2016-07-01 17:03:26 +09:00
|
|
|
|
2009-10-08 17:17:38 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-05-06 00:22:57 +09:00
|
|
|
|
2009-12-15 10:31:14 -05:00
|
|
|
|
2012-04-16 17:39:09 +05:30
|
|
|
|
2015-04-01 19:25:42 +09:00
|
|
|
|
2010-03-16 18:06:12 -04:00
|
|
|
|
|
|
|
|
|
2010-01-06 09:45:34 -05:00
|
|
|
|
2014-01-16 09:39:47 +00:00
|
|
|
|
2011-01-20 23:15:39 +09:00
|
|
|
|
2017-07-05 18:48:10 -07:00
|
|
|
|
2023-05-26 11:33:56 -07:00
|
|
|
|
2009-10-08 17:17:38 -04:00
|
|
|
|
2009-10-27 16:43:10 -04:00
|
|
|
|
2010-04-12 13:17:42 -04:00
|
|
|
|
2009-10-08 17:17:38 -04:00
|
|
|
|
2023-05-26 11:33:56 -07:00
|
|
|
|
2010-04-12 13:17:42 -04:00
|
|
|
|
2009-10-08 17:17:38 -04:00
|
|
|
|
2023-05-26 11:33:56 -07:00
|
|
|
|
|
|
|
|
|
2010-05-18 22:57:27 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-10-08 17:17:38 -04:00
|
|
|
|
2023-05-26 11:33:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-04-01 19:25:39 +09:00
|
|
|
|
|
|
|
|
|
2023-05-26 11:33:56 -07:00
|
|
|
|
2015-04-01 19:25:39 +09:00
|
|
|
|
2012-04-16 17:39:09 +05:30
|
|
|
|
2023-05-26 11:33:56 -07:00
|
|
|
|
2017-07-05 18:48:10 -07:00
|
|
|
|
2010-03-16 18:06:12 -04:00
|
|
|
|
2010-04-12 13:17:42 -04:00
|
|
|
|
2010-03-16 18:06:12 -04:00
|
|
|
|
2010-04-12 13:17:42 -04:00
|
|
|
|
|
|
|
|
|
2009-10-27 16:43:02 -04:00
|
|
|
|
|
|
|
|
|
2015-04-24 18:47:50 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-05-26 11:33:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-04-24 18:47:50 +09:00
|
|
|
|
|
|
|
|
|
2023-05-26 11:33:56 -07:00
|
|
|
|
2015-04-24 18:47:50 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-04-16 17:39:25 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-05-26 11:33:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-01-16 09:39:47 +00:00
|
|
|
|
2023-05-26 11:33:56 -07:00
|
|
|
|
2014-01-16 09:39:47 +00:00
|
|
|
|
2012-04-16 17:39:25 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-05-26 11:33:56 -07:00
|
|
|
|
2012-04-16 17:39:25 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-04-12 13:17:42 -04:00
|
|
|
|
2009-12-08 17:02:54 -05:00
|
|
|
|
2012-04-16 17:39:25 +05:30
|
|
|
|
2009-12-08 17:02:54 -05:00
|
|
|
|
|
|
|
|
|
2012-04-16 17:39:25 +05:30
|
|
|
|
2014-01-16 09:39:47 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-04-16 17:39:25 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-08 17:02:54 -05:00
|
|
|
|
|
|
|
|
|
2012-04-16 17:39:25 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-08 17:02:54 -05:00
|
|
|
|
2012-04-16 17:39:25 +05:30
|
|
|
|
2010-05-18 22:57:27 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-08 17:02:54 -05:00
|
|
|
|
2012-04-16 17:39:25 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-08 17:02:54 -05:00
|
|
|
|
2012-04-16 17:39:25 +05:30
|
|
|
|
2010-04-12 13:17:42 -04:00
|
|
|
|
2009-12-08 17:02:54 -05:00
|
|
|
|
2010-04-12 13:17:42 -04:00
|
|
|
|
2009-12-08 17:02:54 -05:00
|
|
|
|
|
|
|
|
|
2012-04-16 17:39:09 +05:30
|
|
|
|
2012-09-11 01:15:03 +03:00
|
|
|
|
2012-04-16 17:39:09 +05:30
|
|
|
|
|
|
|
|
|
2013-12-26 05:41:50 +00:00
|
|
|
|
2012-04-16 17:39:09 +05:30
|
|
|
|
2015-04-01 19:25:39 +09:00
|
|
|
|
2012-04-16 17:39:09 +05:30
|
|
|
|
2023-05-26 11:33:56 -07:00
|
|
|
|
2012-04-16 17:39:09 +05:30
|
|
|
|
2023-05-26 11:33:56 -07:00
|
|
|
|
2012-04-16 17:39:09 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-12-26 05:41:50 +00:00
|
|
|
|
2023-05-26 11:33:56 -07:00
|
|
|
|
|
|
|
|
|
2013-12-26 05:41:50 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-05-26 11:33:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-04-16 17:39:09 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-07-05 18:48:10 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-11-19 15:36:21 -08:00
|
|
|
|
2017-07-05 18:48:10 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-02-11 02:34:06 -08:00
|
|
|
|
2023-05-26 11:33:56 -07:00
|
|
|
|
2017-07-05 18:48:10 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-05-06 00:22:57 +09:00
|
|
|
|
|
|
|
|
|
2024-10-16 17:13:53 -07:00
|
|
|
|
2015-05-06 00:22:57 +09:00
|
|
|
|
2012-09-11 01:15:03 +03:00
|
|
|
|
2010-01-16 21:31:16 +09:00
|
|
|
|
2010-04-12 13:17:42 -04:00
|
|
|
|
|
|
|
|
|
2011-08-11 20:02:53 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-05-26 11:33:56 -07:00
|
|
|
|
2011-08-11 20:02:53 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-05-26 11:33:56 -07:00
|
|
|
|
|
|
|
|
|
2010-04-12 13:17:42 -04:00
|
|
|
|
|
|
|
|
|
2010-01-16 21:31:16 +09:00
|
|
|
|
2010-10-21 19:13:23 +09:00
|
|
|
|
2015-05-06 00:22:57 +09:00
|
|
|
|
2012-09-11 01:15:03 +03:00
|
|
|
|
2010-10-21 19:13:23 +09:00
|
|
|
|
2023-05-26 11:33:56 -07:00
|
|
|
|
2010-10-21 19:13:23 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-05-26 11:33:56 -07:00
|
|
|
|
2010-10-21 19:13:23 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
perf tools: Make options always available, even if required libs not linked
This patch keeps options of perf builtins same in all conditions. If
one option is disabled because of compiling options, users should be
notified.
Masami suggested another implementation in [1] that, by adding a
OPTION_NEXT_DEPENDS option before those options in the 'struct option'
array, options parser knows an option is disabled. However, in some
cases this array is reordered (options__order()). In addition, in
parse-option.c that array is const, so we can't simply merge
information in decorator option into the affacted option.
This patch chooses a simpler implementation that, introducing a
set_option_nobuild() function and two option parsing flags. Builtins
with such options should call set_option_nobuild() before option
parsing. The complexity of this patch is because we want some of options
can be skipped safely. In this case their arguments should also be
consumed.
Options in 'perf record' and 'perf probe' are fixed in this patch.
[1] http://lkml.kernel.org/g/50399556C9727B4D88A595C8584AAB3752627CD4@GSjpTKYDCembx32.service.hitachi.net
Test result:
Normal case:
# ./perf probe --vmlinux /tmp/vmlinux sys_write
Added new event:
probe:sys_write (on sys_write)
You can now use it in all perf tools, such as:
perf record -e probe:sys_write -aR sleep 1
Build with NO_DWARF=1:
# ./perf probe -L sys_write
Error: switch `L' is not available because NO_DWARF=1
Usage: perf probe [<options>] 'PROBEDEF' ['PROBEDEF' ...]
or: perf probe [<options>] --add 'PROBEDEF' [--add 'PROBEDEF' ...]
or: perf probe [<options>] --del '[GROUP:]EVENT' ...
or: perf probe --list [GROUP:]EVENT ...
or: perf probe [<options>] --funcs
-L, --line <FUNC[:RLN[+NUM|-RLN2]]|SRC:ALN[+NUM|-ALN2]>
Show source code lines.
(not built-in because NO_DWARF=1)
# ./perf probe -k /tmp/vmlinux sys_write
Warning: switch `k' is being ignored because NO_DWARF=1
Added new event:
probe:sys_write (on sys_write)
You can now use it in all perf tools, such as:
perf record -e probe:sys_write -aR sleep 1
# ./perf probe --vmlinux /tmp/vmlinux sys_write
Warning: option `vmlinux' is being ignored because NO_DWARF=1
Added new event:
[SNIP]
# ./perf probe -l
Usage: perf probe [<options>] 'PROBEDEF' ['PROBEDEF' ...]
or: perf probe [<options>] --add 'PROBEDEF' [--add 'PROBEDEF' ...]
...
-k, --vmlinux <file> vmlinux pathname
(not built-in because NO_DWARF=1)
-L, --line <FUNC[:RLN[+NUM|-RLN2]]|SRC:ALN[+NUM|-ALN2]>
Show source code lines.
(not built-in because NO_DWARF=1)
...
-V, --vars <FUNC[@SRC][+OFF|%return|:RL|;PT]|SRC:AL|SRC;PT>
Show accessible variables on PROBEDEF
(not built-in because NO_DWARF=1)
--externs Show external variables too (with --vars only)
(not built-in because NO_DWARF=1)
--no-inlines Don't search inlined functions
(not built-in because NO_DWARF=1)
--range Show variables location range in scope (with --vars only)
(not built-in because NO_DWARF=1)
Signed-off-by: Wang Nan <wangnan0@huawei.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/1450089563-122430-14-git-send-email-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2015-12-14 10:39:22 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-01-20 23:15:45 +09:00
|
|
|
|
2015-05-06 00:22:57 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-05-26 11:33:56 -07:00
|
|
|
|
2015-05-06 00:22:57 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-05-05 11:29:50 +09:00
|
|
|
|
|
|
|
|
|
2023-05-26 11:33:56 -07:00
|
|
|
|
2015-05-05 11:29:50 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-01-20 23:15:39 +09:00
|
|
|
|
2012-09-11 01:15:03 +03:00
|
|
|
|
|
|
|
|
|
2011-01-20 23:15:39 +09:00
|
|
|
|
2015-04-24 18:47:50 +09:00
|
|
|
|
|
|
|
|
|
2011-01-20 23:15:39 +09:00
|
|
|
|
2015-04-24 18:47:50 +09:00
|
|
|
|
2011-01-20 23:15:39 +09:00
|
|
|
|
2009-10-08 17:17:38 -04:00
|
|
|
|
2014-02-06 05:32:09 +00:00
|
|
|
|
2014-01-16 09:39:47 +00:00
|
|
|
|
2023-05-26 11:33:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-01-16 09:39:47 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-05-26 11:33:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 00:04:06 -03:00
|
|
|
|
2023-05-26 11:33:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-01-16 09:39:47 +00:00
|
|
|
|
|
|
|
|
|
2014-06-06 07:13:52 +00:00
|
|
|
|
|
|
|
|
|
2014-08-14 02:22:34 +00:00
|
|
|
|
|
|
|
|
|
2014-06-06 07:13:52 +00:00
|
|
|
|
2014-08-14 02:22:34 +00:00
|
|
|
|
tools: Introduce str_error_r()
The tools so far have been using the strerror_r() GNU variant, that
returns a string, be it the buffer passed or something else.
But that, besides being tricky in cases where we expect that the
function using strerror_r() returns the error formatted in a provided
buffer (we have to check if it returned something else and copy that
instead), breaks the build on systems not using glibc, like Alpine
Linux, where musl libc is used.
So, introduce yet another wrapper, str_error_r(), that has the GNU
interface, but uses the portable XSI variant of strerror_r(), so that
users rest asured that the provided buffer is used and it is what is
returned.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-d4t42fnf48ytlk8rjxs822tf@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-07-06 11:56:20 -03:00
|
|
|
|
2014-06-06 07:13:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-09-04 21:16:01 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-09-10 11:27:05 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-09-04 21:16:01 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-05-26 11:33:56 -07:00
|
|
|
|
2021-06-05 01:28:43 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-08-26 01:24:27 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-09-04 21:16:01 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-04-23 20:01:22 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-09-04 21:16:01 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-31 19:17:48 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-09-04 21:16:01 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-31 19:17:48 +05:30
|
|
|
|
2015-09-04 21:16:01 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-09-10 11:27:05 +09:00
|
|
|
|
2015-09-04 21:16:01 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-07-01 17:03:36 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-07-12 19:04:54 +09:00
|
|
|
|
2016-07-01 17:03:36 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-07-05 18:48:11 -07:00
|
|
|
|
2016-07-01 17:03:36 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-09-04 21:16:03 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-07-01 17:03:36 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-09-04 21:16:03 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-09-16 21:52:42 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-09-04 21:16:03 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-06-23 11:31:20 -03:00
|
|
|
|
2015-09-04 21:16:03 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-02-26 22:30:04 +08:00
|
|
|
|
|
|
|
|
|
2015-09-04 21:16:03 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-06-23 11:31:20 -03:00
|
|
|
|
2015-09-04 21:16:03 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-02-26 22:30:04 +08:00
|
|
|
|
|
|
|
|
|
2015-09-04 21:16:03 +09:00
|
|
|
|
|
|
|
|
|
2017-03-17 16:16:32 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-09-04 21:16:03 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-10-16 17:13:53 -07:00
|
|
|
|
2016-08-26 01:24:27 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-01-16 09:39:47 +00:00
|
|
|
|
2017-03-27 11:47:20 -03:00
|
|
|
|
2012-10-01 15:20:58 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-04-24 18:47:50 +09:00
|
|
|
|
2024-10-16 17:13:53 -07:00
|
|
|
|
2012-10-01 15:20:58 -03:00
|
|
|
|
|
|
|
|
|
2010-02-25 08:35:12 -05:00
|
|
|
|
2015-04-23 22:46:12 +09:00
|
|
|
|
2012-10-01 15:20:58 -03:00
|
|
|
|
2015-04-24 18:47:50 +09:00
|
|
|
|
2014-10-23 00:15:49 +09:00
|
|
|
|
2010-04-13 18:37:33 +10:00
|
|
|
|
2009-10-16 20:08:10 -04:00
|
|
|
|
2022-10-18 10:41:36 +01:00
|
|
|
|
|
|
|
|
|
2015-04-24 18:47:50 +09:00
|
|
|
|
2015-05-06 00:22:57 +09:00
|
|
|
|
|
|
|
|
|
2009-12-08 17:03:23 -05:00
|
|
|
|
2015-05-06 00:22:57 +09:00
|
|
|
|
2016-08-26 01:24:27 +09:00
|
|
|
|
2009-10-08 17:17:38 -04:00
|
|
|
|
2009-12-15 10:32:18 -05:00
|
|
|
|
|
|
|
|
|
2009-10-08 17:17:38 -04:00
|
|
|
|
2010-02-25 08:36:12 -05:00
|
|
|
|
2009-10-27 16:43:10 -04:00
|
|
|
|
2024-10-16 17:13:53 -07:00
|
|
|
|
2009-10-08 17:17:38 -04:00
|
|
|
|
2010-02-25 08:36:12 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-10-08 17:17:38 -04:00
|
|
|
|
2009-11-30 19:19:58 -05:00
|
|
|
|
2010-03-22 13:10:26 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-10-27 16:43:10 -04:00
|
|
|
|
2016-08-26 01:24:27 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-05-08 10:03:31 +09:00
|
|
|
|
2009-12-15 10:32:25 -05:00
|
|
|
|
2010-01-06 09:45:34 -05:00
|
|
|
|
2010-04-02 12:50:39 -04:00
|
|
|
|
2010-01-06 09:45:34 -05:00
|
|
|
|
2010-10-21 19:13:23 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-05-08 10:03:31 +09:00
|
|
|
|
2010-10-21 19:13:35 +09:00
|
|
|
|
perf probe: Add --range option to show a variable's location range
It is not easy for users to get the accurate byte offset or the line
number where a local variable can be probed.
With '--range' option, local variables in the scope of the probe point
are showed with a byte offset range, and can be added according to this
range information.
For example, there are some variables in the function
generic_perform_write():
<generic_perform_write@mm/filemap.c:0>
0 ssize_t generic_perform_write(struct file *file,
1 struct iov_iter *i, loff_t pos)
2 {
3 struct address_space *mapping = file->f_mapping;
4 const struct address_space_operations *a_ops = mapping->a_ops;
...
42 status = a_ops->write_begin(file, mapping, pos, bytes, flags,
&page, &fsdata);
44 if (unlikely(status < 0))
But we fail when we try to probe the variable 'a_ops' at line 42 or 44.
$ perf probe --add 'generic_perform_write:42 a_ops'
Failed to find the location of a_ops at this address.
Perhaps, it has been optimized out.
This is because the source code do not match the assembly, so a variable
may not be available in the source code line where it appears.
After this patch, we can lookup the accurate byte offset range of a
variable, 'INV' indicates that this variable is not valid at the given
point, but available in the scope:
$ perf probe --vars 'generic_perform_write:42' --range
Available variables at generic_perform_write:42
@<generic_perform_write+141>
[INV] ssize_t written @<generic_perform_write+[324-331]>
[INV] struct address_space_operations* a_ops @<generic_perform_write+[55-61,170-176,223-246]>
[VAL] (unknown_type) fsdata @<generic_perform_write+[70-307,346-411]>
[VAL] loff_t pos @<generic_perform_write+[0-286,286-336,346-411]>
[VAL] long int status @<generic_perform_write+[83-342,346-411]>
[VAL] long unsigned int bytes @<generic_perform_write+[122-311,320-338,346-403,403-411]>
[VAL] struct address_space* mapping @<generic_perform_write+[35-344,346-411]>
[VAL] struct iov_iter* i @<generic_perform_write+[0-340,346-411]>
[VAL] struct page* page @<generic_perform_write+[70-307,346-411]>
Then it is more clear for us to add a probe with this variable:
$ perf probe --add 'generic_perform_write+170 a_ops'
Added new event:
probe:generic_perform_write (on generic_perform_write+170 with a_ops)
Signed-off-by: He Kuang <hekuang@huawei.com>
Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1431336304-16863-2-git-send-email-hekuang@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2015-05-11 09:25:03 +00:00
|
|
|
|
|
|
|
|
|
2010-03-22 13:10:26 -03:00
|
|
|
|
|
|
|
|
|
2010-06-14 15:26:30 -04:00
|
|
|
|
|
|
|
|
|
2015-05-08 10:03:33 +09:00
|
|
|
|
|
|
|
|
|
2010-03-16 18:06:05 -04:00
|
|
|
|
2015-05-08 10:03:31 +09:00
|
|
|
|
2010-04-21 15:56:40 -04:00
|
|
|
|
2015-05-05 11:29:50 +09:00
|
|
|
|
|
|
|
|
|
2015-05-06 00:22:57 +09:00
|
|
|
|
2011-01-20 23:15:45 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-04-16 17:39:09 +05:30
|
|
|
|
|
|
|
|
|
2015-10-02 21:58:32 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-10-28 12:04:24 +04:00
|
|
|
|
2014-10-27 16:31:24 -04:00
|
|
|
|
2014-09-13 07:15:05 +03:00
|
|
|
|
|
|
|
|
|
2016-06-15 12:28:40 +09:00
|
|
|
|
2026-03-09 17:44:12 +00:00
|
|
|
|
|
|
|
|
|
2017-07-05 18:48:10 -07:00
|
|
|
|
|
|
|
|
|
2021-06-05 01:28:43 +09:00
|
|
|
|
|
|
|
|
|
2009-10-08 17:17:38 -04:00
|
|
|
|
2012-10-01 15:20:58 -03:00
|
|
|
|
2010-04-12 13:17:42 -04:00
|
|
|
|
|
|
|
|
|
2014-10-23 00:15:49 +09:00
|
|
|
|
|
|
|
|
|
2016-08-26 01:24:27 +09:00
|
|
|
|
2014-10-23 00:15:49 +09:00
|
|
|
|
2024-10-16 17:13:53 -07:00
|
|
|
|
2014-10-23 00:15:49 +09:00
|
|
|
|
|
|
|
|
|
perf tools: Make options always available, even if required libs not linked
This patch keeps options of perf builtins same in all conditions. If
one option is disabled because of compiling options, users should be
notified.
Masami suggested another implementation in [1] that, by adding a
OPTION_NEXT_DEPENDS option before those options in the 'struct option'
array, options parser knows an option is disabled. However, in some
cases this array is reordered (options__order()). In addition, in
parse-option.c that array is const, so we can't simply merge
information in decorator option into the affacted option.
This patch chooses a simpler implementation that, introducing a
set_option_nobuild() function and two option parsing flags. Builtins
with such options should call set_option_nobuild() before option
parsing. The complexity of this patch is because we want some of options
can be skipped safely. In this case their arguments should also be
consumed.
Options in 'perf record' and 'perf probe' are fixed in this patch.
[1] http://lkml.kernel.org/g/50399556C9727B4D88A595C8584AAB3752627CD4@GSjpTKYDCembx32.service.hitachi.net
Test result:
Normal case:
# ./perf probe --vmlinux /tmp/vmlinux sys_write
Added new event:
probe:sys_write (on sys_write)
You can now use it in all perf tools, such as:
perf record -e probe:sys_write -aR sleep 1
Build with NO_DWARF=1:
# ./perf probe -L sys_write
Error: switch `L' is not available because NO_DWARF=1
Usage: perf probe [<options>] 'PROBEDEF' ['PROBEDEF' ...]
or: perf probe [<options>] --add 'PROBEDEF' [--add 'PROBEDEF' ...]
or: perf probe [<options>] --del '[GROUP:]EVENT' ...
or: perf probe --list [GROUP:]EVENT ...
or: perf probe [<options>] --funcs
-L, --line <FUNC[:RLN[+NUM|-RLN2]]|SRC:ALN[+NUM|-ALN2]>
Show source code lines.
(not built-in because NO_DWARF=1)
# ./perf probe -k /tmp/vmlinux sys_write
Warning: switch `k' is being ignored because NO_DWARF=1
Added new event:
probe:sys_write (on sys_write)
You can now use it in all perf tools, such as:
perf record -e probe:sys_write -aR sleep 1
# ./perf probe --vmlinux /tmp/vmlinux sys_write
Warning: option `vmlinux' is being ignored because NO_DWARF=1
Added new event:
[SNIP]
# ./perf probe -l
Usage: perf probe [<options>] 'PROBEDEF' ['PROBEDEF' ...]
or: perf probe [<options>] --add 'PROBEDEF' [--add 'PROBEDEF' ...]
...
-k, --vmlinux <file> vmlinux pathname
(not built-in because NO_DWARF=1)
-L, --line <FUNC[:RLN[+NUM|-RLN2]]|SRC:ALN[+NUM|-ALN2]>
Show source code lines.
(not built-in because NO_DWARF=1)
...
-V, --vars <FUNC[@SRC][+OFF|%return|:RL|;PT]|SRC:AL|SRC;PT>
Show accessible variables on PROBEDEF
(not built-in because NO_DWARF=1)
--externs Show external variables too (with --vars only)
(not built-in because NO_DWARF=1)
--no-inlines Don't search inlined functions
(not built-in because NO_DWARF=1)
--range Show variables location range in scope (with --vars only)
(not built-in because NO_DWARF=1)
Signed-off-by: Wang Nan <wangnan0@huawei.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/1450089563-122430-14-git-send-email-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2015-12-14 10:39:22 +00:00
|
|
|
|
2024-10-16 17:13:45 -07:00
|
|
|
|
perf tools: Make options always available, even if required libs not linked
This patch keeps options of perf builtins same in all conditions. If
one option is disabled because of compiling options, users should be
notified.
Masami suggested another implementation in [1] that, by adding a
OPTION_NEXT_DEPENDS option before those options in the 'struct option'
array, options parser knows an option is disabled. However, in some
cases this array is reordered (options__order()). In addition, in
parse-option.c that array is const, so we can't simply merge
information in decorator option into the affacted option.
This patch chooses a simpler implementation that, introducing a
set_option_nobuild() function and two option parsing flags. Builtins
with such options should call set_option_nobuild() before option
parsing. The complexity of this patch is because we want some of options
can be skipped safely. In this case their arguments should also be
consumed.
Options in 'perf record' and 'perf probe' are fixed in this patch.
[1] http://lkml.kernel.org/g/50399556C9727B4D88A595C8584AAB3752627CD4@GSjpTKYDCembx32.service.hitachi.net
Test result:
Normal case:
# ./perf probe --vmlinux /tmp/vmlinux sys_write
Added new event:
probe:sys_write (on sys_write)
You can now use it in all perf tools, such as:
perf record -e probe:sys_write -aR sleep 1
Build with NO_DWARF=1:
# ./perf probe -L sys_write
Error: switch `L' is not available because NO_DWARF=1
Usage: perf probe [<options>] 'PROBEDEF' ['PROBEDEF' ...]
or: perf probe [<options>] --add 'PROBEDEF' [--add 'PROBEDEF' ...]
or: perf probe [<options>] --del '[GROUP:]EVENT' ...
or: perf probe --list [GROUP:]EVENT ...
or: perf probe [<options>] --funcs
-L, --line <FUNC[:RLN[+NUM|-RLN2]]|SRC:ALN[+NUM|-ALN2]>
Show source code lines.
(not built-in because NO_DWARF=1)
# ./perf probe -k /tmp/vmlinux sys_write
Warning: switch `k' is being ignored because NO_DWARF=1
Added new event:
probe:sys_write (on sys_write)
You can now use it in all perf tools, such as:
perf record -e probe:sys_write -aR sleep 1
# ./perf probe --vmlinux /tmp/vmlinux sys_write
Warning: option `vmlinux' is being ignored because NO_DWARF=1
Added new event:
[SNIP]
# ./perf probe -l
Usage: perf probe [<options>] 'PROBEDEF' ['PROBEDEF' ...]
or: perf probe [<options>] --add 'PROBEDEF' [--add 'PROBEDEF' ...]
...
-k, --vmlinux <file> vmlinux pathname
(not built-in because NO_DWARF=1)
-L, --line <FUNC[:RLN[+NUM|-RLN2]]|SRC:ALN[+NUM|-ALN2]>
Show source code lines.
(not built-in because NO_DWARF=1)
...
-V, --vars <FUNC[@SRC][+OFF|%return|:RL|;PT]|SRC:AL|SRC;PT>
Show accessible variables on PROBEDEF
(not built-in because NO_DWARF=1)
--externs Show external variables too (with --vars only)
(not built-in because NO_DWARF=1)
--no-inlines Don't search inlined functions
(not built-in because NO_DWARF=1)
--range Show variables location range in scope (with --vars only)
(not built-in because NO_DWARF=1)
Signed-off-by: Wang Nan <wangnan0@huawei.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/1450089563-122430-14-git-send-email-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2015-12-14 10:39:22 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-10-23 00:15:49 +09:00
|
|
|
|
2015-04-23 22:46:12 +09:00
|
|
|
|
2014-10-23 00:15:49 +09:00
|
|
|
|
2009-10-08 17:17:38 -04:00
|
|
|
|
2009-10-27 16:43:02 -04:00
|
|
|
|
2022-12-20 11:57:02 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-15 10:31:28 -05:00
|
|
|
|
|
|
|
|
|
2015-10-25 00:49:27 +09:00
|
|
|
|
|
|
|
|
|
2009-12-15 10:31:28 -05:00
|
|
|
|
2023-05-26 11:33:56 -07:00
|
|
|
|
2015-10-25 00:49:27 +09:00
|
|
|
|
|
|
|
|
|
2015-05-06 00:22:57 +09:00
|
|
|
|
2010-04-12 13:17:42 -04:00
|
|
|
|
|
|
|
|
|
2014-06-06 07:13:52 +00:00
|
|
|
|
2010-04-12 13:17:42 -04:00
|
|
|
|
|
|
|
|
|
2023-05-26 11:33:56 -07:00
|
|
|
|
2009-12-15 10:31:28 -05:00
|
|
|
|
2009-10-27 16:43:02 -04:00
|
|
|
|
2021-10-18 14:48:42 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-05-08 10:03:31 +09:00
|
|
|
|
|
|
|
|
|
2010-04-21 15:56:40 -04:00
|
|
|
|
2010-12-10 14:06:03 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-08-26 23:57:58 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-05-26 11:33:56 -07:00
|
|
|
|
2016-08-26 23:57:58 +09:00
|
|
|
|
|
|
|
|
|
2023-05-26 11:33:56 -07:00
|
|
|
|
2015-05-06 00:22:57 +09:00
|
|
|
|
2023-05-26 11:33:56 -07:00
|
|
|
|
2015-10-25 00:49:27 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-04-16 17:39:09 +05:30
|
|
|
|
2023-05-26 11:33:56 -07:00
|
|
|
|
2010-04-12 13:17:42 -04:00
|
|
|
|
2014-06-06 07:13:52 +00:00
|
|
|
|
2010-04-12 13:17:42 -04:00
|
|
|
|
2015-05-06 00:22:57 +09:00
|
|
|
|
2023-05-26 11:33:56 -07:00
|
|
|
|
|
|
|
|
|
2011-01-13 21:46:11 +09:00
|
|
|
|
2014-06-06 07:13:52 +00:00
|
|
|
|
2011-01-13 21:46:11 +09:00
|
|
|
|
2024-10-16 17:13:53 -07:00
|
|
|
|
2015-05-06 00:22:57 +09:00
|
|
|
|
2023-05-26 11:33:56 -07:00
|
|
|
|
|
|
|
|
|
2010-04-12 13:17:42 -04:00
|
|
|
|
2014-06-06 07:13:52 +00:00
|
|
|
|
2010-04-12 13:17:42 -04:00
|
|
|
|
2015-05-06 00:22:57 +09:00
|
|
|
|
2023-05-26 11:33:56 -07:00
|
|
|
|
|
|
|
|
|
2011-01-20 23:15:39 +09:00
|
|
|
|
|
|
|
|
|
2023-05-26 11:33:56 -07:00
|
|
|
|
|
|
|
|
|
2010-10-21 19:13:23 +09:00
|
|
|
|
2014-06-06 07:13:52 +00:00
|
|
|
|
2010-10-21 19:13:23 +09:00
|
|
|
|
2010-01-06 09:45:34 -05:00
|
|
|
|
2015-05-06 00:22:57 +09:00
|
|
|
|
2023-05-26 11:33:56 -07:00
|
|
|
|
2010-04-12 13:17:42 -04:00
|
|
|
|
2014-06-06 07:13:52 +00:00
|
|
|
|
2010-04-12 13:17:42 -04:00
|
|
|
|
|
|
|
|
|
2015-05-06 00:22:57 +09:00
|
|
|
|
2016-08-26 01:24:27 +09:00
|
|
|
|
2023-05-26 11:33:56 -07:00
|
|
|
|
2021-06-05 01:28:43 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-11-25 15:50:16 +00:00
|
|
|
|
2016-08-26 01:24:42 +09:00
|
|
|
|
|
|
|
|
|
2015-04-01 19:25:42 +09:00
|
|
|
|
2023-05-26 11:33:56 -07:00
|
|
|
|
2015-10-25 00:49:27 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-04-01 19:25:42 +09:00
|
|
|
|
|
|
|
|
|
2023-05-26 11:33:56 -07:00
|
|
|
|
2010-04-12 13:17:42 -04:00
|
|
|
|
2019-07-18 11:28:37 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-05-26 11:33:56 -07:00
|
|
|
|
2019-07-18 11:28:37 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-05-26 11:33:56 -07:00
|
|
|
|
2014-06-06 07:13:52 +00:00
|
|
|
|
2010-04-12 13:17:42 -04:00
|
|
|
|
|
|
|
|
|
2015-05-06 00:22:57 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-04-12 13:17:42 -04:00
|
|
|
|
2009-10-08 17:17:38 -04:00
|
|
|
|
|
|
|
|
|
2014-01-16 09:39:47 +00:00
|
|
|
|
2017-03-27 11:47:20 -03:00
|
|
|
|
2014-01-16 09:39:47 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-02-06 05:32:09 +00:00
|
|
|
|
|
|
|
|
|
2017-03-27 11:47:20 -03:00
|
|
|
|
2014-02-06 05:32:09 +00:00
|
|
|
|
|
|
|
|
|
2014-01-16 09:39:47 +00:00
|
|
|
|
2015-05-06 21:46:45 +09:00
|
|
|
|
2014-01-16 09:39:47 +00:00
|
|
|
|