Commit-ID: b90dc17a5d14a881f9bb3b58edb3d71075d58afb
Gitweb: http://git.kernel.org/tip/b90dc17a5d14a881f9bb3b58edb3d71075d58afb
Author: Wang Nan <wangn...@huawei.com>
AuthorDate: Fri, 20 May 2016 16:38:23 +
Committer: Arnaldo Carvalho de Melo <a...@redhat.com>
CommitDate:
Commit-ID: b90dc17a5d14a881f9bb3b58edb3d71075d58afb
Gitweb: http://git.kernel.org/tip/b90dc17a5d14a881f9bb3b58edb3d71075d58afb
Author: Wang Nan
AuthorDate: Fri, 20 May 2016 16:38:23 +
Committer: Arnaldo Carvalho de Melo
CommitDate: Fri, 20 May 2016 14:54:23 -0300
perf evsel: Add
Commit-ID: d4c6fb36ac2c82f8f0c05b04cf102dcdc2d5a14d
Gitweb: http://git.kernel.org/tip/d4c6fb36ac2c82f8f0c05b04cf102dcdc2d5a14d
Author: Wang Nan <wangn...@huawei.com>
AuthorDate: Fri, 20 May 2016 16:38:24 +
Committer: Arnaldo Carvalho de Melo <a...@redhat.com>
CommitDate:
Commit-ID: d4c6fb36ac2c82f8f0c05b04cf102dcdc2d5a14d
Gitweb: http://git.kernel.org/tip/d4c6fb36ac2c82f8f0c05b04cf102dcdc2d5a14d
Author: Wang Nan
AuthorDate: Fri, 20 May 2016 16:38:24 +
Committer: Arnaldo Carvalho de Melo
CommitDate: Fri, 20 May 2016 14:56:58 -0300
perf evsel
and update config term array size because the
longest string length is changed.
For overwritable events, automatically select attr.write_backward since
perf requires it to be backward for reading.
Signed-off-by: Wang Nan <wangn...@huawei.com>
Signed-off-by: He Kuang <heku...@huawe
and update config term array size because the
longest string length is changed.
For overwritable events, automatically select attr.write_backward since
perf requires it to be backward for reading.
Signed-off-by: Wang Nan
Signed-off-by: He Kuang
Cc: Arnaldo Carvalho de Melo
Cc: Jiri Olsa
Cc
o 'struct perf_evlist' and points to
the evlist itself for normal evlists.
Signed-off-by: Wang Nan <wangn...@huawei.com>
Cc: He Kuang <heku...@huawei.com>
Cc: Arnaldo Carvalho de Melo <a...@redhat.com>
Cc: Jiri Olsa <jo...@kernel.org>
Cc: Masami Hiramatsu <masami.hiramatsu...@
o 'struct perf_evlist' and points to
the evlist itself for normal evlists.
Signed-off-by: Wang Nan
Cc: He Kuang
Cc: Arnaldo Carvalho de Melo
Cc: Jiri Olsa
Cc: Masami Hiramatsu
Cc: Namhyung Kim
Cc: Zefan Li
Cc: pi3or...@163.com
---
tools/perf/util/evlist.c | 31 +--
tools/
e.
v3 -> v4: Update commit message to describe auxiliary evlist more clearly.
Wang Nan (7):
perf evlist: Introduce aux perf evlist
perf tools: Don't poll and mmap overwritable events
perf tools: Enable overwrite settings
perf record: Introduce rec->overwrite_evlist for overwritable e
e.
v3 -> v4: Update commit message to describe auxiliary evlist more clearly.
Wang Nan (7):
perf evlist: Introduce aux perf evlist
perf tools: Don't poll and mmap overwritable events
perf tools: Enable overwrite settings
perf record: Introduce rec->overwrite_evlist for overwritable e
-off-by: Wang Nan <wangn...@huawei.com>
Signed-off-by: He Kuang <heku...@huawei.com>
Cc: Arnaldo Carvalho de Melo <a...@redhat.com>
Cc: Jiri Olsa <jo...@kernel.org>
Cc: Masami Hiramatsu <masami.hiramatsu...@hitachi.com>
Cc: Namhyung Kim <namhy...@kernel.org>
rec->evlist or
rec->overwrite_evlist.
Signed-off-by: Wang Nan <wangn...@huawei.com>
Cc: He Kuang <heku...@huawei.com>
Cc: Arnaldo Carvalho de Melo <a...@redhat.com>
Cc: Jiri Olsa <jo...@kernel.org>
Cc: Masami Hiramatsu <masami.hiramatsu...@hitachi.com>
Cc: Namhyung
:
# ~/perf record -m 1 -e raw_syscalls:*/overwrite/ -a
Reading from overwrite event is not supported by this kernel
Error:
The raw_syscalls:sys_enter event is not supported.
Signed-off-by: Wang Nan <wangn...@huawei.com>
Cc: He Kuang <heku...@huawei.com>
Cc: Arnaldo Carv
-off-by: Wang Nan
Signed-off-by: He Kuang
Cc: Arnaldo Carvalho de Melo
Cc: Jiri Olsa
Cc: Masami Hiramatsu
Cc: Namhyung Kim
Cc: Zefan Li
Cc: pi3or...@163.com
---
tools/perf/util/session.c | 22 +++---
1 file changed, 19 insertions(+), 3 deletions(-)
diff --git a/tools/perf
rec->evlist or
rec->overwrite_evlist.
Signed-off-by: Wang Nan
Cc: He Kuang
Cc: Arnaldo Carvalho de Melo
Cc: Jiri Olsa
Cc: Masami Hiramatsu
Cc: Namhyung Kim
Cc: Zefan Li
Cc: pi3or...@163.com
---
tools/perf/builtin-record.c | 131
1 file cha
:
# ~/perf record -m 1 -e raw_syscalls:*/overwrite/ -a
Reading from overwrite event is not supported by this kernel
Error:
The raw_syscalls:sys_enter event is not supported.
Signed-off-by: Wang Nan
Cc: He Kuang
Cc: Arnaldo Carvalho de Melo
Cc: Jiri Olsa
Cc: Masami Hiramatsu
Cc: Namhyung Kim
uffers
(3): Resume ring buffers for recording
We can't avoid this complexity. Because we deliberately drop records from
overwritable ring buffer, we can't detect remaining data by checking head
and old pointers. Therefore, DATA_PENDING state is mandatory.
Signed-off-by: Wang Nan <wangn...@h
uffers
(3): Resume ring buffers for recording
We can't avoid this complexity. Because we deliberately drop records from
overwritable ring buffer, we can't detect remaining data by checking head
and old pointers. Therefore, DATA_PENDING state is mandatory.
Signed-off-by: Wang Nan
Signed-off-by: He
her commits will expand it when we
introduce auxiliary evlists and have multiple mmaps.
Signed-off-by: Wang Nan <wangn...@huawei.com>
Signed-off-by: He Kuang <heku...@huawei.com>
Cc: Arnaldo Carvalho de Melo <a...@redhat.com>
Cc: Jiri Olsa <jo...@kernel.org>
Cc: Masami
her commits will expand it when we
introduce auxiliary evlists and have multiple mmaps.
Signed-off-by: Wang Nan
Signed-off-by: He Kuang
Cc: Arnaldo Carvalho de Melo
Cc: Jiri Olsa
Cc: Masami Hiramatsu
Cc: Namhyung Kim
Cc: Zefan Li
Cc: pi3or...@163.com
---
tools/perf/arch/x86/util/tsc.c | 2 ++
to
When record__mmap_read() requires data more than the size of ring
buffer, drop those data to avoid accessing invalid memory.
This can happen when reading from overwritable ring buffer, which
should be avoided. However, check this for robustness.
Signed-off-by: Wang Nan <wangn...@huawei.
When record__mmap_read() requires data more than the size of ring
buffer, drop those data to avoid accessing invalid memory.
This can happen when reading from overwritable ring buffer, which
should be avoided. However, check this for robustness.
Signed-off-by: Wang Nan
Signed-off-by: He Kuang
her commits will expand it.
Signed-off-by: Wang Nan <wangn...@huawei.com>
Signed-off-by: He Kuang <heku...@huawei.com>
Cc: Arnaldo Carvalho de Melo <a...@redhat.com>
Cc: Jiri Olsa <jo...@kernel.org>
Cc: Masami Hiramatsu <masami.hiramatsu...@hitachi.com>
Cc: Namhyung Kim &
Introduce rb_find_range() to find start and end position from a backward
ring buffer.
Signed-off-by: Wang Nan <wangn...@huawei.com>
Signed-off-by: He Kuang <heku...@huawei.com>
Cc: Arnaldo Carvalho de Melo <a...@redhat.com>
Cc: Jiri Olsa <jo...@kernel.org>
Cc: Masami Hir
her commits will expand it.
Signed-off-by: Wang Nan
Signed-off-by: He Kuang
Cc: Arnaldo Carvalho de Melo
Cc: Jiri Olsa
Cc: Masami Hiramatsu
Cc: Namhyung Kim
Cc: Zefan Li
Cc: pi3or...@163.com
---
tools/perf/arch/x86/util/tsc.c | 2 ++
tools/perf/builtin-record.c| 9 -
tools/perf/u
Introduce rb_find_range() to find start and end position from a backward
ring buffer.
Signed-off-by: Wang Nan
Signed-off-by: He Kuang
Cc: Arnaldo Carvalho de Melo
Cc: Jiri Olsa
Cc: Masami Hiramatsu
Cc: Namhyung Kim
Cc: Zefan Li
Cc: pi3or...@163.com
---
tools/perf/builtin-record.c | 52
e ring buffers for recording
We can't avoid this complexity. Because we deliberately drop records from
overwritable ring buffer, we can't detect remaining data by checking head
and old pointers. Therefore, DATA_PENDING state is mandatory.
Signed-off-by: Wang Nan <wangn...@huawei.com>
Signe
and update config term array size because the
longest string length is changed.
For overwritable events, automatically select attr.write_backward since
perf requires it to be backward for reading.
Signed-off-by: Wang Nan <wangn...@huawei.com>
Signed-off-by: He Kuang <heku...@huawe
change
behavior since:
buf = [old & md->mask];
size = head - old;
old += size; <--- Here, old == head
Signed-off-by: Wang Nan <wangn...@huawei.com>
Signed-off-by: He Kuang <heku...@huawei.com>
Cc: Arnaldo Carvalho de Melo <a...@redhat.com>
Cc: Jiri
change
behavior since:
buf = [old & md->mask];
size = head - old;
old += size; <--- Here, old == head
Signed-off-by: Wang Nan
Signed-off-by: He Kuang
Cc: Arnaldo Carvalho de Melo
Cc: Jiri Olsa
Cc: Masami Hiramatsu
Cc: Namhyung Kim
Cc: Zefan Li
Cc: pi3or...@163.com
e ring buffers for recording
We can't avoid this complexity. Because we deliberately drop records from
overwritable ring buffer, we can't detect remaining data by checking head
and old pointers. Therefore, DATA_PENDING state is mandatory.
Signed-off-by: Wang Nan
Signed-off-by: He Kuang
Cc: A
and update config term array size because the
longest string length is changed.
For overwritable events, automatically select attr.write_backward since
perf requires it to be backward for reading.
Signed-off-by: Wang Nan
Signed-off-by: He Kuang
Cc: Arnaldo Carvalho de Melo
Cc: Jiri Olsa
Cc
-off-by: Wang Nan <wangn...@huawei.com>
Signed-off-by: He Kuang <heku...@huawei.com>
Cc: Arnaldo Carvalho de Melo <a...@redhat.com>
Cc: Jiri Olsa <jo...@kernel.org>
Cc: Masami Hiramatsu <masami.hiramatsu...@hitachi.com>
Cc: Namhyung Kim <namhy...@kernel.org>
-off-by: Wang Nan
Signed-off-by: He Kuang
Cc: Arnaldo Carvalho de Melo
Cc: Jiri Olsa
Cc: Masami Hiramatsu
Cc: Namhyung Kim
Cc: Zefan Li
Cc: pi3or...@163.com
---
tools/perf/util/session.c | 22 +++---
1 file changed, 19 insertions(+), 3 deletions(-)
diff --git a/tools/perf
rg>
Cc: Masami Hiramatsu <masami.hiramatsu...@hitachi.com>
Cc: Namhyung Kim <namhy...@kernel.org>
Cc: Peter Zijlstra <pet...@infradead.org>
Cc: Wang Nan <wangn...@huawei.com>
Cc: Zefan Li <lize...@huawei.com>
Cc: pi3or...@163.com
--
1.8.3.4
-events.l | 2 +
tools/perf/util/record.c | 17 ++
tools/perf/util/session.c| 22 +-
13 files changed, 498 insertions(+), 69 deletions(-)
Cc: Arnaldo Carvalho de Melo
Cc: He Kuang
Cc: Jiri Olsa
Cc: Masami Hiramatsu
Cc: Namhyung Kim
Cc: Peter Zijlstra
Cc: Wan
:
# ~/perf record -m 1 -e raw_syscalls:*/overwrite/ -a
Reading from overwrite event is not supported by this kernel
Error:
The raw_syscalls:sys_enter event is not supported.
Signed-off-by: Wang Nan <wangn...@huawei.com>
Cc: He Kuang <heku...@huawei.com>
Cc: Arnaldo Carv
:
# ~/perf record -m 1 -e raw_syscalls:*/overwrite/ -a
Reading from overwrite event is not supported by this kernel
Error:
The raw_syscalls:sys_enter event is not supported.
Signed-off-by: Wang Nan
Cc: He Kuang
Cc: Arnaldo Carvalho de Melo
Cc: Jiri Olsa
Cc: Masami Hiramatsu
Cc: Namhyung Kim
perf_evlist__toggle_{pause,resume}() are introduced to pause/resume
events in an evlist. Utilize PERF_EVENT_IOC_PAUSE_OUTPUT ioctl.
Following commits use them to ensure overwrite ring buffer is paused
before reading.
Signed-off-by: Wang Nan <wangn...@huawei.com>
Signed-off-by: He Kuang
evlist or
rec->overwrite_evlist.
Signed-off-by: Wang Nan <wangn...@huawei.com>
Cc: He Kuang <heku...@huawei.com>
Cc: Arnaldo Carvalho de Melo <a...@redhat.com>
Cc: Jiri Olsa <jo...@kernel.org>
Cc: Masami Hiramatsu <masami.hiramatsu...@hitachi.com>
Cc: Namhyung Kim &
perf_evlist__toggle_{pause,resume}() are introduced to pause/resume
events in an evlist. Utilize PERF_EVENT_IOC_PAUSE_OUTPUT ioctl.
Following commits use them to ensure overwrite ring buffer is paused
before reading.
Signed-off-by: Wang Nan
Signed-off-by: He Kuang
Cc: Arnaldo Carvalho de Melo
evlist or
rec->overwrite_evlist.
Signed-off-by: Wang Nan
Cc: He Kuang
Cc: Arnaldo Carvalho de Melo
Cc: Jiri Olsa
Cc: Masami Hiramatsu
Cc: Namhyung Kim
Cc: Zefan Li
Cc: pi3or...@163.com
---
tools/perf/builtin-record.c | 125
1 file cha
t' in all functions in the patch of 'perf_evlist__mmap_ex',
except 'evlist->mmap' related operations, to make sure all evlist modifications
like pollfd and event id hash tables goes to original evlist.
Signed-off-by: Wang Nan <wangn...@huawei.com>
Cc: He Kuang <heku...@huawei.com>
Cc:
t' in all functions in the patch of 'perf_evlist__mmap_ex',
except 'evlist->mmap' related operations, to make sure all evlist modifications
like pollfd and event id hash tables goes to original evlist.
Signed-off-by: Wang Nan
Cc: He Kuang
Cc: Arnaldo Carvalho de Melo
Cc: Jiri Olsa
Cc: Masami H
Add a fd field into perf_mmap so perf can track fd from mmap.
This feature will be used for toggling overwrite ring buffers.
Signed-off-by: Wang Nan <wangn...@huawei.com>
Signed-off-by: He Kuang <heku...@huawei.com>
Cc: Arnaldo Carvalho de Melo <a...@redhat.com>
Cc: Jiri Olsa
Add a fd field into perf_mmap so perf can track fd from mmap.
This feature will be used for toggling overwrite ring buffers.
Signed-off-by: Wang Nan
Signed-off-by: He Kuang
Cc: Arnaldo Carvalho de Melo
Cc: Jiri Olsa
Cc: Masami Hiramatsu
Cc: Namhyung Kim
Cc: Zefan Li
Cc: pi3or...@163.com
-off-by: Wang Nan <wangn...@huawei.com>
Signed-off-by: He Kuang <heku...@huawei.com>
Cc: Arnaldo Carvalho de Melo <a...@redhat.com>
Cc: Jiri Olsa <jo...@kernel.org>
Cc: Masami Hiramatsu <masami.hiramatsu...@hitachi.com>
Cc: Namhyung Kim <namhy...@kernel.org>
change
behavior since:
buf = [old & md->mask];
size = head - old;
old += size; <--- Here, old == head
Signed-off-by: Wang Nan <wangn...@huawei.com>
Signed-off-by: He Kuang <heku...@huawei.com>
Cc: Arnaldo Carvalho de Melo <a...@redhat.com>
Cc: Jiri
-off-by: Wang Nan
Signed-off-by: He Kuang
Cc: Arnaldo Carvalho de Melo
Cc: Jiri Olsa
Cc: Masami Hiramatsu
Cc: Namhyung Kim
Cc: Zefan Li
Cc: pi3or...@163.com
---
tools/perf/util/session.c | 22 +++---
1 file changed, 19 insertions(+), 3 deletions(-)
diff --git a/tools/perf
change
behavior since:
buf = [old & md->mask];
size = head - old;
old += size; <--- Here, old == head
Signed-off-by: Wang Nan
Signed-off-by: He Kuang
Cc: Arnaldo Carvalho de Melo
Cc: Jiri Olsa
Cc: Masami Hiramatsu
Cc: Namhyung Kim
Cc: Zefan Li
Cc: pi3or...@163.com
her commits will expand it.
Signed-off-by: Wang Nan <wangn...@huawei.com>
Signed-off-by: He Kuang <heku...@huawei.com>
Cc: Arnaldo Carvalho de Melo <a...@redhat.com>
Cc: Jiri Olsa <jo...@kernel.org>
Cc: Masami Hiramatsu <masami.hiramatsu...@hitachi.com>
Cc: Namhyung Kim &
her commits will expand it.
Signed-off-by: Wang Nan
Signed-off-by: He Kuang
Cc: Arnaldo Carvalho de Melo
Cc: Jiri Olsa
Cc: Masami Hiramatsu
Cc: Namhyung Kim
Cc: Zefan Li
Cc: pi3or...@163.com
---
tools/perf/arch/x86/util/tsc.c | 2 ++
tools/perf/builtin-record.c| 9 -
tools/perf/u
perf_evlist__toggle_paused() is introduced to pause/resume events
in an evlist. Utilize PERF_EVENT_IOC_PAUSE_OUTPUT ioctl. Following
commits use perf_evlist__toggle_paused() to ensure overwrite
ring buffer is paused before reading.
Signed-off-by: Wang Nan <wangn...@huawei.com>
Signed-off-
perf_evlist__toggle_paused() is introduced to pause/resume events
in an evlist. Utilize PERF_EVENT_IOC_PAUSE_OUTPUT ioctl. Following
commits use perf_evlist__toggle_paused() to ensure overwrite
ring buffer is paused before reading.
Signed-off-by: Wang Nan
Signed-off-by: He Kuang
Cc: Arnaldo
.2016051323512215
-rw--- 1 root root 5135157 May 13 23:51 ./perf.data.2016051323512387
v1 -> v2: Totally redesign: drop the principle of 'channal', use
auxiliary evlist instead. Fix missing documentation.
Wang Nan (13):
perf tools: Add overwrite attribute to evsel and ch
.2016051323512215
-rw--- 1 root root 5135157 May 13 23:51 ./perf.data.2016051323512387
v1 -> v2: Totally redesign: drop the principle of 'channal', use
auxiliary evlist instead. Fix missing documentation.
Wang Nan (13):
perf tools: Add overwrite attribute to evsel and ch
t' in all functions in the patch of 'perf_evlist__mmap_ex',
except 'evlist->mmap' related operations, to make sure all evlist modifications
like pollfd and event id hash tables goes to original evlist.
Signed-off-by: Wang Nan <wangn...@huawei.com>
Cc: He Kuang <heku...@huawei.com>
Cc:
t' in all functions in the patch of 'perf_evlist__mmap_ex',
except 'evlist->mmap' related operations, to make sure all evlist modifications
like pollfd and event id hash tables goes to original evlist.
Signed-off-by: Wang Nan
Cc: He Kuang
Cc: Arnaldo Carvalho de Melo
Cc: Jiri Olsa
Cc: Masami H
Add 'overwrite' attribute to evsel to mark whether this event is set
overwritable. Following commits will support syntax like
# perf record -e cycles/overwrite/ ...
Overwritable evsel require kernel support write_backward. Add it to
perf_missing_feature.
Signed-off-by: Wang Nan <wa
Add 'overwrite' attribute to evsel to mark whether this event is set
overwritable. Following commits will support syntax like
# perf record -e cycles/overwrite/ ...
Overwritable evsel require kernel support write_backward. Add it to
perf_missing_feature.
Signed-off-by: Wang Nan
Cc: He Kuang
e ring buffers for recording
We can't avoid this complexity. Because we deliberately drop records from
overwritable ring buffer, we can't detect remaining data by checking head
and old pointers. Therefore, DATA_PENDING state is mandatory.
Signed-off-by: Wang Nan <wangn...@huawei.com>
Signe
and update config term array size because the
longest string length is changed.
For overwritable events, automatically select attr.write_backward since
perf requires it to be backward for reading.
Signed-off-by: Wang Nan <wangn...@huawei.com>
Signed-off-by: He Kuang <heku...@huawe
e ring buffers for recording
We can't avoid this complexity. Because we deliberately drop records from
overwritable ring buffer, we can't detect remaining data by checking head
and old pointers. Therefore, DATA_PENDING state is mandatory.
Signed-off-by: Wang Nan
Signed-off-by: He Kuang
Cc: A
and update config term array size because the
longest string length is changed.
For overwritable events, automatically select attr.write_backward since
perf requires it to be backward for reading.
Signed-off-by: Wang Nan
Signed-off-by: He Kuang
Cc: Arnaldo Carvalho de Melo
Cc: Jiri Olsa
Cc
:
# ~/perf record -m 1 -e raw_syscalls:*/overwrite/ -a
Reading from overwrite event is not supported by this kernel
Error:
The raw_syscalls:sys_enter event is not supported.
Signed-off-by: Wang Nan <wangn...@huawei.com>
Cc: He Kuang <heku...@huawei.com>
Cc: Arnaldo Carv
evlist or
rec->overwrite_evlist.
Signed-off-by: Wang Nan <wangn...@huawei.com>
Cc: He Kuang <heku...@huawei.com>
Cc: Arnaldo Carvalho de Melo <a...@redhat.com>
Cc: Jiri Olsa <jo...@kernel.org>
Cc: Masami Hiramatsu <masami.hiramatsu...@hitachi.com>
Cc: Namhyung Kim &
:
# ~/perf record -m 1 -e raw_syscalls:*/overwrite/ -a
Reading from overwrite event is not supported by this kernel
Error:
The raw_syscalls:sys_enter event is not supported.
Signed-off-by: Wang Nan
Cc: He Kuang
Cc: Arnaldo Carvalho de Melo
Cc: Jiri Olsa
Cc: Masami Hiramatsu
Cc: Namhyung Kim
evlist or
rec->overwrite_evlist.
Signed-off-by: Wang Nan
Cc: He Kuang
Cc: Arnaldo Carvalho de Melo
Cc: Jiri Olsa
Cc: Masami Hiramatsu
Cc: Namhyung Kim
Cc: Zefan Li
Cc: pi3or...@163.com
---
tools/perf/builtin-record.c | 125
1 file cha
Introduce rb_find_range() to find start and end position from a backward
ring buffer.
Signed-off-by: Wang Nan <wangn...@huawei.com>
Signed-off-by: He Kuang <heku...@huawei.com>
Cc: Arnaldo Carvalho de Melo <a...@redhat.com>
Cc: Jiri Olsa <jo...@kernel.org>
Cc: Masami Hir
Introduce rb_find_range() to find start and end position from a backward
ring buffer.
Signed-off-by: Wang Nan
Signed-off-by: He Kuang
Cc: Arnaldo Carvalho de Melo
Cc: Jiri Olsa
Cc: Masami Hiramatsu
Cc: Namhyung Kim
Cc: Zefan Li
Cc: pi3or...@163.com
---
tools/perf/builtin-record.c | 52
When record__mmap_read() requires data more than the size of ring
buffer, drop those data to avoid accessing invalid memory.
This can happen when reading from overwritable ring buffer, which
should be avoided. However, check this for robustness.
Signed-off-by: Wang Nan <wangn...@huawei.
When record__mmap_read() requires data more than the size of ring
buffer, drop those data to avoid accessing invalid memory.
This can happen when reading from overwritable ring buffer, which
should be avoided. However, check this for robustness.
Signed-off-by: Wang Nan
Signed-off-by: He Kuang
.
Signed-off-by: Wang Nan <wangn...@huawei.com>
Signed-off-by: He Kuang <heku...@huawei.com>
Cc: Arnaldo Carvalho de Melo <a...@redhat.com>
Cc: Jiri Olsa <jo...@kernel.org>
Cc: Masami Hiramatsu <masami.hiramatsu...@hitachi.com>
Cc: Namhyung Kim <namhy...@kernel.org>
perf_evlist__channel_find() can be used to find a proper channel based
on propreties of a evsel. If the channel doesn't exist, it can create
new one for it. After this patch there's no need to create default
channel explicitly.
Signed-off-by: Wang Nan <wangn...@huawei.com>
Signed-off-by: He
.
Signed-off-by: Wang Nan
Signed-off-by: He Kuang
Cc: Arnaldo Carvalho de Melo
Cc: Jiri Olsa
Cc: Masami Hiramatsu
Cc: Namhyung Kim
Cc: Zefan Li
Cc: pi3or...@163.com
---
tools/perf/builtin-record.c | 2 +-
tools/perf/util/evlist.c| 43 ---
tools/perf
perf_evlist__channel_find() can be used to find a proper channel based
on propreties of a evsel. If the channel doesn't exist, it can create
new one for it. After this patch there's no need to create default
channel explicitly.
Signed-off-by: Wang Nan
Signed-off-by: He Kuang
Cc: Arnaldo
Before this patch perf operates on only the first channel. Make perf
mmap and read from multiple channels.
Signed-off-by: Wang Nan <wangn...@huawei.com>
Signed-off-by: He Kuang <heku...@huawei.com>
Cc: Arnaldo Carvalho de Melo <a...@redhat.com>
Cc: Jiri Olsa <jo...@k
Before this patch perf operates on only the first channel. Make perf
mmap and read from multiple channels.
Signed-off-by: Wang Nan
Signed-off-by: He Kuang
Cc: Arnaldo Carvalho de Melo
Cc: Jiri Olsa
Cc: Masami Hiramatsu
Cc: Namhyung Kim
Cc: Zefan Li
Cc: pi3or...@163.com
---
tools/perf
ing that function nr_mmaps mmaps for each
channel are allocated together as a big array.
perf_evlist__channel_idx() converts index in the big array and the
channel number. For API functions which accept idx, _ex() versions are
introduced to accept selecting an mmap from a channel.
Signed-off-by: Wang
ing that function nr_mmaps mmaps for each
channel are allocated together as a big array.
perf_evlist__channel_idx() converts index in the big array and the
channel number. For API functions which accept idx, _ex() versions are
introduced to accept selecting an mmap from a channel.
Signed-off-by: Wang
change
behavior since:
buf = [old & md->mask];
size = head - old;
old += size; <--- Here, old == head
Signed-off-by: Wang Nan <wangn...@huawei.com>
Signed-off-by: He Kuang <heku...@huawei.com>
Cc: Arnaldo Carvalho de Melo <a...@redhat.com>
Cc: Jiri
change
behavior since:
buf = [old & md->mask];
size = head - old;
old += size; <--- Here, old == head
Signed-off-by: Wang Nan
Signed-off-by: He Kuang
Cc: Arnaldo Carvalho de Melo
Cc: Jiri Olsa
Cc: Masami Hiramatsu
Cc: Namhyung Kim
Cc: Zefan Li
Cc: pi3or...@163.com
Add a fd field into perf_mmap so perf can track fd from mmap.
This feature will be used for toggling overwrite ring buffers.
Signed-off-by: Wang Nan <wangn...@huawei.com>
Signed-off-by: He Kuang <heku...@huawei.com>
Cc: Arnaldo Carvalho de Melo <a...@redhat.com>
Cc: Jiri Olsa
-off-by: Wang Nan <wangn...@huawei.com>
Signed-off-by: He Kuang <heku...@huawei.com>
Cc: Arnaldo Carvalho de Melo <a...@redhat.com>
Cc: Jiri Olsa <jo...@kernel.org>
Cc: Masami Hiramatsu <masami.hiramatsu...@hitachi.com>
Cc: Namhyung Kim <namhy...@kernel.org>
Add a fd field into perf_mmap so perf can track fd from mmap.
This feature will be used for toggling overwrite ring buffers.
Signed-off-by: Wang Nan
Signed-off-by: He Kuang
Cc: Arnaldo Carvalho de Melo
Cc: Jiri Olsa
Cc: Masami Hiramatsu
Cc: Namhyung Kim
Cc: Zefan Li
Cc: pi3or...@163.com
-off-by: Wang Nan
Signed-off-by: He Kuang
Cc: Arnaldo Carvalho de Melo
Cc: Jiri Olsa
Cc: Masami Hiramatsu
Cc: Namhyung Kim
Cc: Zefan Li
Cc: pi3or...@163.com
---
tools/perf/util/session.c | 22 +++---
1 file changed, 19 insertions(+), 3 deletions(-)
diff --git a/tools/perf
nly mmap users (most of them are in perf/tests).
Signed-off-by: Wang Nan <wangn...@huawei.com>
Signed-off-by: He Kuang <heku...@huawei.com>
Cc: Arnaldo Carvalho de Melo <a...@redhat.com>
Cc: Jiri Olsa <jo...@kernel.org>
Cc: Masami Hiramatsu <masami.hiramatsu...@hitach
Reading from a overwrite ring buffer is unrelible.
perf_evlist__channel_toggle_paused() should be called before
reading from them.
Toggel overwrite_evt_paused director after receiving done or switch
output.
Signed-off-by: Wang Nan <wangn...@huawei.com>
Signed-off-by: He Kuang <heku...@h
nly mmap users (most of them are in perf/tests).
Signed-off-by: Wang Nan
Signed-off-by: He Kuang
Cc: Arnaldo Carvalho de Melo
Cc: Jiri Olsa
Cc: Masami Hiramatsu
Cc: Namhyung Kim
Cc: Zefan Li
Cc: pi3or...@163.com
---
tools/perf/builtin-record.c | 7 +++
tools/perf/util/evlist.c|
Reading from a overwrite ring buffer is unrelible.
perf_evlist__channel_toggle_paused() should be called before
reading from them.
Toggel overwrite_evt_paused director after receiving done or switch
output.
Signed-off-by: Wang Nan
Signed-off-by: He Kuang
Cc: Arnaldo Carvalho de Melo
Cc: Jiri
There's no need to receive events from overwritable ring buffer. Instead,
perf should make them run background until something happen. This patch
makes normal events from overwrite ring buffer ignored.
Signed-off-by: Wang Nan <wangn...@huawei.com>
Signed-off-by: He Kuang <heku...@huawe
There's no need to receive events from overwritable ring buffer. Instead,
perf should make them run background until something happen. This patch
makes normal events from overwrite ring buffer ignored.
Signed-off-by: Wang Nan
Signed-off-by: He Kuang
Cc: Arnaldo Carvalho de Melo
Cc: Jiri Olsa
.2016051323512215
-rw--- 1 root root 5135157 May 13 23:51 ./perf.data.2016051323512387
Wang Nan (17):
perf tools: Extract __perf_evlist__mmap_read()
perf tools: Add evlist channel helpers
perf tools: Automatically add new channel according to evlist
perf tools: Operate multiple channels
Reading from overwritable ring buffer is unreliable. Introduce
record__mmap_should_read() and prevent reading from such ring
buffers in 'perf record'. The rule in record__mmap_should_read() will
be changed when perf support reading from backward writing ring buffer.
Signed-off-by: Wang Nan <wa
Detect avalibility of write_backward and save the result into
record_opts. With write_backward the start pointer of a ring
buffer mapped read only can be found reliably.
Signed-off-by: Wang Nan <wangn...@huawei.com>
Signed-off-by: He Kuang <heku...@huawei.com>
Cc: Arnaldo Carv
.2016051323512215
-rw--- 1 root root 5135157 May 13 23:51 ./perf.data.2016051323512387
Wang Nan (17):
perf tools: Extract __perf_evlist__mmap_read()
perf tools: Add evlist channel helpers
perf tools: Automatically add new channel according to evlist
perf tools: Operate multiple channels
Reading from overwritable ring buffer is unreliable. Introduce
record__mmap_should_read() and prevent reading from such ring
buffers in 'perf record'. The rule in record__mmap_should_read() will
be changed when perf support reading from backward writing ring buffer.
Signed-off-by: Wang Nan
Detect avalibility of write_backward and save the result into
record_opts. With write_backward the start pointer of a ring
buffer mapped read only can be found reliably.
Signed-off-by: Wang Nan
Signed-off-by: He Kuang
Cc: Arnaldo Carvalho de Melo
Cc: Jiri Olsa
Cc: Masami Hiramatsu
Cc
Extract event reader to __perf_evlist__mmap_read(). Future commit will
feed it with manually computed 'head' and 'old' pointers.
Signed-off-by: Wang Nan <wangn...@huawei.com>
Cc: Arnaldo Carvalho de Melo <a...@redhat.com>
Cc: Peter Zijlstra <pet...@infradead.org>
Cc: Zefan Li &
Extract event reader to __perf_evlist__mmap_read(). Future commit will
feed it with manually computed 'head' and 'old' pointers.
Signed-off-by: Wang Nan
Cc: Arnaldo Carvalho de Melo
Cc: Peter Zijlstra
Cc: Zefan Li
Cc: pi3or...@163.com
---
tools/perf/util/evlist.c | 10 +-
1 file
901 - 1000 of 5282 matches
Mail list logo