Re: [PATCH 3/3] perf script: Fix crash because of missing feat_op[] entry

2018-06-20 Thread Ravi Bangoria
Hi Arnaldo, On 06/20/2018 07:19 PM, Arnaldo Carvalho de Melo wrote: > Em Wed, Jun 20, 2018 at 07:00:30PM +0530, Ravi Bangoria escreveu: >> perf_event__process_feature() tries to access feat_ops[feat].process >> which is not defined for feat = HEADER_LAST_FEATURE and thus perf is &

Re: [PATCH 2/3] perf script: Fix crash because of missing evsel->priv

2018-06-21 Thread Ravi Bangoria
Hi Arnaldo, On 06/20/2018 07:22 PM, Arnaldo Carvalho de Melo wrote: > Em Wed, Jun 20, 2018 at 07:00:29PM +0530, Ravi Bangoria escreveu: >> perf script in pipped mode is crashing because evsel->priv is not >> set properly. Fix it. >> >> Before: >> # ./pe

[PATCH v2 2/3] perf script: Fix crash because of missing evsel->priv

2018-06-25 Thread Ravi Bangoria
ls 2282 1031.73: 25 cpu-clock:uhH: 7effe4b3a650 Signed-off-by: Ravi Bangoria Fixes: a14390fde64e ("perf script: Allow creating per-event dump files") --- tools/perf/builtin-script.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/tools/perf/builtin-script.c

[PATCH v2 3/3] perf script/annotate: Fix crash caused by accessing feat_ops[HEADER_LAST_FEATURE]

2018-06-25 Thread Ravi Bangoria
record -o - ls | ./perf script Segmentation fault (core dumped) After: # ./perf record -o - ls | ./perf script ls 7031 4392.099856: 25 cpu-clock:uhH: 7f5e0ce7cd60 ls 7031 4392.100355: 25 cpu-clock:uhH: 7f5e0c706ef7 Signed-off-by: Ravi Bangoria Fixes: 57b5de463925 ("perf r

[PATCH v2 1/3] perf script: Add missing output fields in a hint

2018-06-25 Thread Ravi Bangoria
Few fields are missing in a perf script -F hint. Add them. Signed-off-by: Ravi Bangoria --- tools/perf/builtin-script.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index a31d7082188e..f3fefbcc4503 100644

[PATCH v2 0/3] perf script: Few trivial fixes

2018-06-25 Thread Ravi Bangoria
First patch fixes perf output field hint. Second and third fixes crash when used in a piped mode. v2 changes: - [PATCH 3/3] Changed as suggested by Arnaldo v1: https://lkml.org/lkml/2018/6/20/538 Ravi Bangoria (3): perf script: Add missing output fields in a hint perf script: Fix crash

xfs: Deadlock between fs_reclaim and sb_internal

2018-06-27 Thread Ravi Bangoria
Hello Darrick, Lockdep is reporting a deadlock with following trace. Saw this on my powerpc vm with 4GB of ram, running Linus/master kernel. Though, I don't have exact testcase to reproduce it. Is this something known? [ 1797.620389] == [

Re: [PATCH v3 6/9] trace_uprobe: Support SDT markers having reference count (semaphore)

2018-05-25 Thread Ravi Bangoria
Thanks Oleg for the review, On 05/24/2018 09:56 PM, Oleg Nesterov wrote: > On 04/17, Ravi Bangoria wrote: >> >> @@ -941,6 +1091,9 @@ typedef bool (*filter_func_t)(struct uprobe_consumer >> *self, >> if (ret) >> goto err_buffer; &g

Re: [PATCH v5 09/10] Uprobes/sdt: Document about reference counter

2018-07-03 Thread Ravi Bangoria
Hi Srikar, On 07/02/2018 08:24 PM, Srikar Dronamraju wrote: > * Ravi Bangoria [2018-06-28 10:52:08]: > >> Reference counter gate the invocation of probe. If present, >> by default reference count is 0. Kernel needs to increment >> it before tracing the probe an

Re: [RFC 2/4] perf: Pass pmu pointer to perf_paranoid_* helpers

2018-07-03 Thread Ravi Bangoria
Hi Tvrtko, > @@ -199,7 +199,7 @@ static inline void perf_get_data_addr(struct pt_regs > *regs, u64 *addrp) > if (!(mmcra & MMCRA_SAMPLE_ENABLE) || sdar_valid) > *addrp = mfspr(SPRN_SDAR); > > - if (perf_paranoid_kernel() && !capable(CAP_SYS_ADMIN) && > + if

Re: [PATCH v6 5/6] Uprobes/sdt: Prevent multiple reference counter for same uprobe

2018-07-26 Thread Ravi Bangoria
Hi Oleg, On 07/25/2018 04:38 PM, Oleg Nesterov wrote: > No, I can't understand this patch... > > On 07/16, Ravi Bangoria wrote: >> >> --- a/kernel/events/uprobes.c >> +++ b/kernel/events/uprobes.c >> @@ -63,6 +63,8 @@ static struct percpu_rw_semaphore du

[PATCH v7 4/6] Uprobes/sdt: Prevent multiple reference counter for same uprobe

2018-07-30 Thread Ravi Bangoria
We assume to have only one reference counter for one uprobe. Don't allow user to register multiple uprobes having same inode+offset but different reference counter. Signed-off-by: Ravi Bangoria --- kernel/events/uprobes.c | 9 + 1 file changed, 9 insertions(+) diff --git a/kernel

[PATCH v7 6/6] perf probe: Support SDT markers having reference counter (semaphore)

2018-07-30 Thread Ravi Bangoria
/tick # ./perf probe sdt_tick:loop2 # ./perf stat -e sdt_tick:loop2 /tmp/tick hi: 0 hi: 1 hi: 2 ^C Performance counter stats for '/tmp/tick': 3 sdt_tick:loop2 2.561851452 seconds time elapsed Signed-off-by: Ravi Bangoria Acked-by: Masami Hiramatsu

[PATCH v7 3/6] Uprobes: Support SDT markers having reference count (semaphore)

2018-07-30 Thread Ravi Bangoria
ing it as 'reference counter' in kernel / perf code. Signed-off-by: Ravi Bangoria Reviewed-by: Masami Hiramatsu [Only trace_uprobe.c] --- include/linux/uprobes.h | 5 + kernel/events/uprobes.c | 232 ++-- kernel/trace/trace.c| 2 +- kernel/tr

[PATCH v7 2/6] Uprobe: Additional argument arch_uprobe to uprobe_write_opcode()

2018-07-30 Thread Ravi Bangoria
Add addition argument 'arch_uprobe' to uprobe_write_opcode(). We need this in later set of patches. Signed-off-by: Ravi Bangoria --- arch/arm/probes/uprobes/core.c | 2 +- arch/mips/kernel/uprobes.c | 2 +- include/linux/uprobes.h| 2 +- kernel/events/uprobes.c| 9

[PATCH v7 0/6] Uprobes: Support SDT markers having reference count (semaphore)

2018-07-30 Thread Ravi Bangoria
hi: 1 hi: 2 ^C Performance counter stats for '/tmp/tick': 3 sdt_tick:loop2 2.561851452 seconds time elapsed Ravi Bangoria (6): Uprobes: Simplify uprobe_register() body Uprobe: Additional argument arch_uprobe to uprobe_write_opcode() Uprobes:

[PATCH v7 5/6] trace_uprobe/sdt: Prevent multiple reference counter for same uprobe

2018-07-30 Thread Ravi Bangoria
s not conflict with any other existing entries. Signed-off-by: Ravi Bangoria --- kernel/trace/trace_uprobe.c | 37 +++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/kernel/trace/trace_uprobe.c b/kernel/trace/trace_uprobe.c index bf2be098eb08..be6

[PATCH v7 1/6] Uprobes: Simplify uprobe_register() body

2018-07-30 Thread Ravi Bangoria
Simplify uprobe_register() function body and let __uprobe_register() handle everything. Also move dependency functions around to fix build failures. Signed-off-by: Ravi Bangoria --- kernel/events/uprobes.c | 69 ++--- 1 file changed, 36 insertions

Re: [PATCH] perf test 39 (Session topology) dumps core on s390

2018-05-27 Thread Ravi Bangoria
Hi Thomas, On 05/24/2018 07:26 PM, Thomas Richter wrote: > @@ -95,7 +98,7 @@ int test__session_topology(struct test *test > __maybe_unused, int subtest __maybe > { > char path[PATH_MAX]; > struct cpu_map *map; > - int ret = -1; > + int ret; This is failing for me:

[PATCH] perf script powerpc: Python script for hypervisor call statistics

2018-06-05 Thread Ravi Bangoria
2600 H_SEND_CRQ 77 1762 7240 2447 Signed-off-by: Ravi Bangoria --- .../perf/scripts/python/bin/powerpc-hcalls-record | 2 + .../perf/scripts/python/bin/powerpc-hcalls-report | 2 + tools/perf/scripts/python/powerpc-hcalls.py

[PATCH 0/7] Uprobes: Support SDT markers having reference count (semaphore)

2018-06-06 Thread Ravi Bangoria
correctness issue. I'm working on a fix for this. [1] https://lkml.org/lkml/2018/4/17/23 [2] https://lkml.org/lkml/2018/5/25/111 [3] https://sourceware.org/systemtap/wiki/UserSpaceProbeImplementation [4] https://github.com/iovisor/bcc/issues/327#issuecomment-200576506 Ravi Bangoria (7

Re: [PATCH] perf stat: Fix shadow stats for clock events

2018-11-27 Thread Ravi Bangoria
On 11/16/18 7:05 PM, Jiri Olsa wrote: > On Fri, Nov 16, 2018 at 09:58:43AM +0530, Ravi Bangoria wrote: >> Commit 0aa802a79469 ("perf stat: Get rid of extra clock display >> function") introduced scale and unit for clock events. Thus, >> perf_stat__update_shadow_

[PATCH] Uprobes: Fix kernel oops with delayed_uprobe_remove()

2018-11-14 Thread Ravi Bangoria
(). Reported-by: syzbot+cb1fb754b771caca0...@syzkaller.appspotmail.com Signed-off-by: Ravi Bangoria --- kernel/events/uprobes.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c index 96fb51f3994f..e527c4753d4f 100644 --- a/kernel/events/uprobes.c +++ b

Re: mainline/master boot bisection: v4.20-rc5-79-gabb8d6ecbd8f on jetson-tk1

2018-12-10 Thread Ravi Bangoria
b/scm/linux/kernel/git/torvalds/linux.git > Branch: master > Target: jetson-tk1 > Lab:lab-baylibre > Config: multi_v7_defconfig > Plan: boot > > Breaking commit found: > > ----

[PATCH v2] Uprobes: Fix kernel oops with delayed_uprobe_remove()

2018-12-04 Thread Ravi Bangoria
...@syzkaller.appspotmail.com Fixes: 1cc33161a83d ("uprobes: Support SDT markers having reference count (semaphore)") Signed-off-by: Ravi Bangoria --- kernel/events/uprobes.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c index 32

[PATCH v9 0/4] Uprobes: Support SDT markers having reference count (semaphore)

2018-08-19 Thread Ravi Bangoria
ssues/327#issuecomment-200576506 Ravi Bangoria (4): Uprobes: Support SDT markers having reference count (semaphore) Uprobes/sdt: Prevent multiple reference counter for same uprobe trace_uprobe/sdt: Prevent multiple reference counter for same uprobe perf probe: Support SDT markers having refere

[PATCH v9 2/4] Uprobes/sdt: Prevent multiple reference counter for same uprobe

2018-08-19 Thread Ravi Bangoria
We assume to have only one reference counter for one uprobe. Don't allow user to register multiple uprobes having same inode+offset but different reference counter. Signed-off-by: Ravi Bangoria Acked-by: Srikar Dronamraju Reviewed-by: Oleg Nesterov --- kernel/events/uprobes.c | 19

[PATCH v9 1/4] Uprobes: Support SDT markers having reference count (semaphore)

2018-08-19 Thread Ravi Bangoria
nce counter' in kernel / perf code. Signed-off-by: Ravi Bangoria Reviewed-by: Masami Hiramatsu [Only trace_uprobe.c] Reviewed-by: Oleg Nesterov --- include/linux/uprobes.h | 5 + kernel/events/uprobes.c | 259 ++-- kernel/trace/trace.c|

[PATCH v9 4/4] perf probe: Support SDT markers having reference counter (semaphore)

2018-08-19 Thread Ravi Bangoria
/tick # ./perf probe sdt_tick:loop2 # ./perf stat -e sdt_tick:loop2 /tmp/tick hi: 0 hi: 1 hi: 2 ^C Performance counter stats for '/tmp/tick': 3 sdt_tick:loop2 2.561851452 seconds time elapsed Signed-off-by: Ravi Bangoria Acked-by: Masami Hiramatsu

[PATCH v9 3/4] trace_uprobe/sdt: Prevent multiple reference counter for same uprobe

2018-08-19 Thread Ravi Bangoria
s not conflict with any other existing entries. Signed-off-by: Ravi Bangoria Acked-by: Srikar Dronamraju Reviewed-by: Song Liu Reviewed-by: Oleg Nesterov --- kernel/trace/trace_uprobe.c | 37 +++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/

Re: [PATCH v9 0/4] Uprobes: Support SDT markers having reference count (semaphore)

2018-08-20 Thread Ravi Bangoria
Hi Song, > root@virt-test:~# ~/a.out > 11 > semaphore 0 > semaphore 0 > semaphore 2 <<< when the uprobe is enabled Yes, this happens when multiple vmas points to the same file portion. Can you check /proc/`pgrep a.out`/maps. Logic is simple. If we are going to patch an instruction,

Re: [PATCH v9 0/4] Uprobes: Support SDT markers having reference count (semaphore)

2018-08-20 Thread Ravi Bangoria
Hi Song, > However, if I start a.out AFTER enabling the uprobe, there is something wrong: > > root@virt-test:~# ~/a.out > 11 > semaphore 0 <<< this should be non-zero, as the uprobe is already > enabled Ok. I'm able to reproduce this. Digging deeper. Ravi

Re: [PATCH v9 0/4] Uprobes: Support SDT markers having reference count (semaphore)

2018-08-21 Thread Ravi Bangoria
Hi Song, On 08/21/2018 10:53 AM, Ravi Bangoria wrote: > Hi Song, > >> However, if I start a.out AFTER enabling the uprobe, there is something >> wrong: >> >> root@virt-test:~# ~/a.out >> 11 >> semaphore 0 <<< this should be non-zero, as

Re: [PATCH v9 0/4] Uprobes: Support SDT markers having reference count (semaphore)

2018-08-21 Thread Ravi Bangoria
On 08/21/2018 01:04 PM, Naveen N. Rao wrote: > Song Liu wrote: >> I am testing the patch set with the following code: >> >> #include >> #include >> >> volatile short semaphore = 0; >> >> int for_uprobe(int c) >> { >>     printf("%d\n", c + 10); >>     return c + 1; >> } >> >> int

Re: [PATCH] trace_uprobe: support reference count in fd-based uprobe

2018-08-22 Thread Ravi Bangoria
ward. Highest 40 bits of perf_event_attr.config is used to stored offset > of the reference count (semaphore). > > Format information in /sys/bus/event_source/devices/uprobe/format/ is > updated to reflect this new feature. LGTM Reviewed-and-tested-by: Ravi Bangoria > > Signed-off-

Re: [PATCH v8 3/6] Uprobes: Support SDT markers having reference count (semaphore)

2018-08-12 Thread Ravi Bangoria
Hi Song, On 08/11/2018 01:27 PM, Song Liu wrote: >> + >> +static void delayed_uprobe_delete(struct delayed_uprobe *du) >> +{ >> + if (!du) >> + return; > Do we really need this check? Not necessary though, but I would still like to keep it for a safety. > >> +

Re: [PATCH v8 3/6] Uprobes: Support SDT markers having reference count (semaphore)

2018-08-13 Thread Ravi Bangoria
Hi Song, On 08/13/2018 11:17 AM, Ravi Bangoria wrote: >>> + >>> +static void delayed_uprobe_remove(struct uprobe *uprobe, struct mm_struct >>> *mm) >>> +{ >>> + struct list_head *pos, *q; >>> + struct de

Re: [PATCH v8 5/6] trace_uprobe/sdt: Prevent multiple reference counter for same uprobe

2018-08-13 Thread Ravi Bangoria
Hi Song, On 08/11/2018 01:42 PM, Song Liu wrote: > Do we really need this given we already have PATCH 4/6? > uprobe_regsiter() can be called > out of trace_uprobe, this patch won't catch all conflicts anyway. Right but it, at least, catch all conflicts happening via trace_uprobe. I don't mind

Re: [PATCH v8 3/6] Uprobes: Support SDT markers having reference count (semaphore)

2018-08-13 Thread Ravi Bangoria
Hi Oleg, On 08/13/2018 05:20 PM, Oleg Nesterov wrote: > On 08/13, Ravi Bangoria wrote: >> >> On 08/11/2018 01:27 PM, Song Liu wrote: >>>> + >>>> +static void delayed_uprobe_delete(struct delayed_uprobe *du) >>>> +{ >>>> +

Re: [PATCH v8 3/6] Uprobes: Support SDT markers having reference count (semaphore)

2018-08-13 Thread Ravi Bangoria
On 08/13/2018 06:47 PM, Oleg Nesterov wrote: > On 08/13, Ravi Bangoria wrote: >> >>> But damn, process creation (exec) is trivial. We could add a new >>> uprobe_exec() >>> hook and avoid delayed_uprobe_install() in uprobe_mmap(). >> >> I'm so

Re: [PATCH v8 3/6] Uprobes: Support SDT markers having reference count (semaphore)

2018-08-13 Thread Ravi Bangoria
Hi Song, On 08/13/2018 10:42 PM, Song Liu wrote: > On Mon, Aug 13, 2018 at 6:17 AM, Oleg Nesterov wrote: >> On 08/13, Ravi Bangoria wrote: >>> >>>> But damn, process creation (exec) is trivial. We could add a new >>>> uprobe_exec() >>>>

Re: [PATCH v8 3/6] Uprobes: Support SDT markers having reference count (semaphore)

2018-08-14 Thread Ravi Bangoria
> +static int delayed_uprobe_install(struct vm_area_struct *vma) > +{ > + struct list_head *pos, *q; > + struct delayed_uprobe *du; > + unsigned long vaddr; > + int ret = 0, err = 0; > + > + mutex_lock(_uprobe_lock); > + list_for_each_safe(pos, q, _uprobe_list) { > +

Re: [PATCH] perf record: use unmapped IP for inline callchain cursors

2018-10-02 Thread Ravi Bangoria
447feb3 gaih_inet.constprop.7+0xf43 (/usr/lib64/libc-2.26.so) 7fff94480a13 __GI_getaddrinfo+0x163 (inlined) 13c752d6f _init+0xbfb (/usr/bin/ping) 7fff9439371f generic_start_main.isra.0+0x13f (/usr/lib64/libc-2.26.so) 7fff9439391b __libc_start_main+0xbb (/usr/lib64/libc-2.26.so) LGTM. Tested-by: Ravi Bangoria

Re: [PATCH v3 1/1] perf: Sharing PMU counters across compatible events

2018-09-27 Thread Ravi Bangoria
Hi Song, On 09/25/2018 03:55 AM, Song Liu wrote: > This patch tries to enable PMU sharing. To make perf event scheduling > fast, we use special data structures. > > An array of "struct perf_event_dup" is added to the perf_event_context, > to remember all the duplicated events under this ctx. All

Re: [PATCH v2] perf test: S390 does not support watchpoints in test 22

2018-09-28 Thread Ravi Bangoria
Hi Thomas, On 09/28/2018 01:13 PM, Thomas Richter wrote: > diff --git a/tools/perf/tests/builtin-test.c b/tools/perf/tests/builtin-test.c > index 54ca7d87236f..e83c15a95c43 100644 > --- a/tools/perf/tests/builtin-test.c > +++ b/tools/perf/tests/builtin-test.c > @@ -124,7 +124,7 @@ static struct

Re: [PATCH v2] perf test: S390 does not support watchpoints in test 22

2018-09-28 Thread Ravi Bangoria
Hi Thomas, On 09/28/2018 03:32 PM, Thomas-Mich Richter wrote: > I can rework the patch to use the is_supported() member function. The > down side is that the test does not show up in the list of executed tests > anymore, > unless some debug output is enabled: Which should be fine because s390

Re: [PATCH v3] perf test: S390 does not support watchpoints in test 22

2018-09-28 Thread Ravi Bangoria
ort to avoid these tests being executed on > s390 platform: > > [root@s8360046 perf]# ./perf test 22 > [root@s8360046 perf]# ./perf test -v 22 > 22: Watchpoint: Disabled > [root@s8360046 perf]# > > Signed-off-by: Thomas Richter Acked-by: Ravi Bangoria Thanks, Ravi

Re: [PATCH 4/6] perf report: Use the offset address to find inline frames

2018-09-30 Thread Ravi Bangoria
Hi Milian, Seems this has a regression: With acme/perf/urgent: $ ./perf record -e cycles:u --call-graph=dwarf ls $ ./perf script ls 13585 602082.534478: 28032 cycles:u: 1f1f4 __GI___tunables_init+0xd3dc00a4 (/usr/lib64/ld-2.26.so)

Re: [PATCH v7 3/6] Uprobes: Support SDT markers having reference count (semaphore)

2018-08-06 Thread Ravi Bangoria
Hi Oleg, Sorry for bit late reply. On 08/03/2018 04:54 PM, Oleg Nesterov wrote: > Hi Ravi, > > I was going to give up and ack this series, but it seems I noticed > a bug... > > On 07/31, Ravi Bangoria wrote: >> >> +static int delayed_uprobe_add(struct uprobe

Re: [PATCH v7 3/6] Uprobes: Support SDT markers having reference count (semaphore)

2018-08-07 Thread Ravi Bangoria
Hi Oleg, >> I'm sorry. I didn't get this. How can uprobe go away without calling >> uprobe_unregister() >> -> rergister_for_each_vma() >>-> remove_breakpoint() >> And remove_breakpoint() will get called > > assuming that _unregister() will find the same vma with the probed insn.

[PATCH v8 4/6] Uprobes/sdt: Prevent multiple reference counter for same uprobe

2018-08-08 Thread Ravi Bangoria
We assume to have only one reference counter for one uprobe. Don't allow user to register multiple uprobes having same inode+offset but different reference counter. Signed-off-by: Ravi Bangoria --- kernel/events/uprobes.c | 9 + 1 file changed, 9 insertions(+) diff --git a/kernel

[PATCH v8 3/6] Uprobes: Support SDT markers having reference count (semaphore)

2018-08-08 Thread Ravi Bangoria
ing it as 'reference counter' in kernel / perf code. Signed-off-by: Ravi Bangoria Reviewed-by: Masami Hiramatsu [Only trace_uprobe.c] --- include/linux/uprobes.h | 5 + kernel/events/uprobes.c | 246 ++-- kernel/trace/trace.c| 2 +- kernel/tr

[PATCH v8 1/6] Uprobes: Simplify uprobe_register() body

2018-08-08 Thread Ravi Bangoria
Simplify uprobe_register() function body and let __uprobe_register() handle everything. Also move dependency functions around to fix build failures. Signed-off-by: Ravi Bangoria --- kernel/events/uprobes.c | 69 ++--- 1 file changed, 36 insertions

[PATCH v8 5/6] trace_uprobe/sdt: Prevent multiple reference counter for same uprobe

2018-08-08 Thread Ravi Bangoria
s not conflict with any other existing entries. Signed-off-by: Ravi Bangoria --- kernel/trace/trace_uprobe.c | 37 +++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/kernel/trace/trace_uprobe.c b/kernel/trace/trace_uprobe.c index bf2be098eb08..be6

[PATCH v8 2/6] Uprobe: Additional argument arch_uprobe to uprobe_write_opcode()

2018-08-08 Thread Ravi Bangoria
Add addition argument 'arch_uprobe' to uprobe_write_opcode(). We need this in later set of patches. Signed-off-by: Ravi Bangoria --- arch/arm/probes/uprobes/core.c | 2 +- arch/mips/kernel/uprobes.c | 2 +- include/linux/uprobes.h| 2 +- kernel/events/uprobes.c| 9

[PATCH v8 6/6] perf probe: Support SDT markers having reference counter (semaphore)

2018-08-08 Thread Ravi Bangoria
/tick # ./perf probe sdt_tick:loop2 # ./perf stat -e sdt_tick:loop2 /tmp/tick hi: 0 hi: 1 hi: 2 ^C Performance counter stats for '/tmp/tick': 3 sdt_tick:loop2 2.561851452 seconds time elapsed Signed-off-by: Ravi Bangoria Acked-by: Masami Hiramatsu

[PATCH v8 0/6] Uprobes: Support SDT markers having reference count (semaphore)

2018-08-08 Thread Ravi Bangoria
sdt_tick:loop2 2.561851452 seconds time elapsed [1] https://sourceware.org/systemtap/wiki/UserSpaceProbeImplementation Ravi Bangoria (6): Uprobes: Simplify uprobe_register() body Uprobe: Additional argument arch_uprobe to uprobe_write_opcode() Uprobes: Support SDT markers having reference

[PATCH 2/2] powerpc/perf: Fix mmcra corruption by bhrb_filter

2019-05-10 Thread Ravi Bangoria
nfig_bhrb(-1) will set mmcra to -1. Signed-off-by: Ravi Bangoria --- arch/powerpc/perf/core-book3s.c | 6 -- arch/powerpc/perf/power8-pmu.c | 3 +++ arch/powerpc/perf/power9-pmu.c | 3 +++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/perf/core-book3s.c b/arc

[PATCH 1/2] perf ioctl: Add check for the sample_period value

2019-05-10 Thread Ravi Bangoria
Add a check for sample_period value sent from userspace. Negative value does not make sense. And in powerpc arch code this could cause a recursive PMI leading to a hang (reported when running perf-fuzzer). Signed-off-by: Ravi Bangoria --- kernel/events/core.c | 3 +++ 1 file changed, 3

Re: [PATCH 2/2] powerpc/perf: Fix mmcra corruption by bhrb_filter

2019-05-10 Thread Ravi Bangoria
On 5/11/19 8:12 AM, Ravi Bangoria wrote: > Consider a scenario where user creates two events: > > 1st event: > attr.sample_type |= PERF_SAMPLE_BRANCH_STACK; > attr.branch_sample_type = PERF_SAMPLE_BRANCH_ANY; > fd = perf_event_open(attr, 0, 1, -1, 0); >

Re: [PATCH 1/2] perf ioctl: Add check for the sample_period value

2019-05-13 Thread Ravi Bangoria
On 5/13/19 2:26 PM, Peter Zijlstra wrote: > On Mon, May 13, 2019 at 09:42:13AM +0200, Peter Zijlstra wrote: >> On Sat, May 11, 2019 at 08:12:16AM +0530, Ravi Bangoria wrote: >>> Add a check for sample_period value sent from userspace. Negative >>> value does not make

Re: [PATCH V2 1/3] perf parse-regs: Split parse_regs

2019-05-15 Thread Ravi Bangoria
t; > Modify the warning message. "--user-regs=?" should be applied to show > the available registers for --user-regs. > > Signed-off-by: Kan Liang > --- For patch 1 and 2, Tested-by: Ravi Bangoria Minor neat. Should we update document as well? May be something like: t

Re: [PATCH]perf:Remove P8 HW events which are not supported

2019-03-18 Thread Ravi Bangoria
On 3/18/19 11:56 PM, Arnaldo Carvalho de Melo wrote: > I added this: > > Cc: Sukadev Bhattiprolu > Fixes: 2a81fa3bb5ed ("perf vendor events: Add power8 PMU events") > > - Arnaldo Sure. Thanks a lot Arnaldo!

[PATCH] perf c2c: Fix c2c report for empty numa node

2019-02-28 Thread Ravi Bangoria
perf c2c report fails if system has empty numa node(0 cpus): $ lscpu NUMA node0 CPU(s): NUMA node1 CPU(s): 0-4 $ sudo ./perf c2c report node/cpu topology bugFailed setup nodes Fix this. Reported-by: Nageswara R Sastry Signed-off-by: Ravi Bangoria --- tools/perf/util/cpumap.c

Re: [PATCH] perf c2c: Fix c2c report for empty numa node

2019-02-28 Thread Ravi Bangoria
On 2/28/19 9:52 PM, Jiri Olsa wrote: > how about attached change (untested)? LGTM. Would you mind sending a patch. > > but I wonder there are some other hidden > bugs wrt empty node > > jirka > > > --- > diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c > index

Re: [PATCH v4 3/4] perf stat: Support 'percore' event qualifier

2019-04-15 Thread Ravi Bangoria
Thread Thread(s) per core:4 Apart from that, for the series: Tested-by: Ravi Bangoria

Re: [PATCH] perf c2c: Fix c2c report for empty numa node

2019-03-01 Thread Ravi Bangoria
On 3/1/19 3:56 PM, Jiri Olsa wrote: > Ravi Bangoria reported that we fail with empty > numa node with following message: > > $ lscpu > NUMA node0 CPU(s): > NUMA node1 CPU(s): 0-4 > > $ sudo ./perf c2c report > node/cpu topology bugFailed setup nodes &g

Re: [PATCH] Uprobes: Fix deadlock between delayed_uprobe_lock and fs_reclaim

2019-02-25 Thread Ravi Bangoria
On 2/8/19 2:03 PM, Ravi Bangoria wrote: > > > On 2/6/19 7:06 PM, Oleg Nesterov wrote: >> Ravi, I am on vacation till the end of this week, can't read your patch >> carefully. >> >> I am not sure I fully understand the problem, but shouldn't we change &

Re: [PATCH]perf:Remove P8 HW events which are not supported

2019-02-25 Thread Ravi Bangoria
On 2/7/19 3:09 PM, Mamatha Inamdar wrote: > This patch is to remove following hardware events > from JSON file which are not supported on POWER8 > Acked-by: Ravi Bangoria

Re: System crash with perf_fuzzer (kernel: 5.0.0-rc3)

2019-01-31 Thread Ravi Bangoria
Hi Jiri, On 2/1/19 1:13 PM, Jiri Olsa wrote: > On Thu, Jan 31, 2019 at 09:27:11AM +0100, Jiri Olsa wrote: >> On Wed, Jan 30, 2019 at 07:36:48PM +0100, Jiri Olsa wrote: >> >> SNIP >> >>> diff --git a/kernel/events/core.c b/kernel/events/core.c >>> index 280a72b3a553..22ec63a0782e 100644 >>> ---

Re: System crash with perf_fuzzer (kernel: 5.0.0-rc3)

2019-02-01 Thread Ravi Bangoria
On 2/1/19 1:24 PM, Ravi Bangoria wrote: > I ran fuzzer for couple of hours but I didn't see any crash with > your previous patch. > > I'll try this newer one as well. I ran fuzzer for ~8 hrs and no lockup so far. Thanks.

Re: [PATCH] perf script: fix crash when processing recorded stat data

2019-01-20 Thread Ravi Bangoria
On 1/21/19 12:44 AM, Tony Jones wrote: > While updating Perf to work with Python3 and Python2 I noticed that the > stat-cpi script was dumping core. [...] > Fixes: 1fcd03946b52 ("perf stat: Update per-thread shadow stats") > Signed-off-by: Tony Jones Tested-by: Ravi Bangoria

Re: perf trace syscall table generation for powerpc with syscall.tbl

2019-01-08 Thread Ravi Bangoria
Hi Arnaldo, Yes. I'm aware of it. Just that I was busy with something else so couldn't do it. Thanks for reminding :). Will post a patch soon. Ravi On 1/8/19 10:34 PM, Arnaldo Carvalho de Melo wrote: > Hi Ravi, > > I noticed that in: > > commit

[PATCH 1/2] perf powerpc: Rework syscall table generation

2019-01-10 Thread Ravi Bangoria
Commit aff850393200 ("powerpc: add system call table generation support") changed how systemcall table is generated for powerpc. Incorporate these changes into perf as well. Signed-off-by: Ravi Bangoria --- tools/perf/arch/powerpc/Makefile | 15 +- .../perf/arch/pow

[PATCH 2/2] perf powerpc: Remove unistd.h

2019-01-10 Thread Ravi Bangoria
We use syscall.tbl to generate system call table on powerpc. unistd.h is no longer required now. Remove it. Signed-off-by: Ravi Bangoria --- tools/arch/powerpc/include/uapi/asm/unistd.h | 404 --- tools/perf/check-headers.sh | 1 - 2 files changed, 405

Re: [PATCH] Uprobes: Fix kernel oops with delayed_uprobe_remove()

2018-12-02 Thread Ravi Bangoria
Hi Steve, Please pull this patch. Thanks. On 11/15/18 6:13 PM, Oleg Nesterov wrote: > On 11/15, Ravi Bangoria wrote: >> >> There could be a race between task exit and probe unregister: >> >> exit_mm() >> mmput() >> __mmput() upro

[PATCH] perf test: Add watchpoint test

2018-09-10 Thread Ravi Bangoria
: 22.1: Read Only Watchpoint: Ok 22.2: Write Only Watchpoint : Ok 22.3: Read / Write Watchpoint : Ok 22.4: Modify Watchpoint : Ok Signed-off-by: Ravi Bangoria

Re: [PATCH v6 3/6] Uprobes: Support SDT markers having reference count (semaphore)

2018-07-23 Thread Ravi Bangoria
gt; > On 07/16, Ravi Bangoria wrote: >> >> +static int delayed_uprobe_install(struct vm_area_struct *vma) >> +{ >> +struct list_head *pos, *q; >> +struct delayed_uprobe *du; >> +unsigned long vaddr; >> +int ret = 0, err = 0; >> + &

Re: [PATCH v6 0/6] Uprobes: Support SDT markers having reference count (semaphore)

2018-07-20 Thread Ravi Bangoria
Oleg, Srikar, Masami, Song, Any feedback please? :) Thanks, Ravi On 07/16/2018 02:17 PM, Ravi Bangoria wrote: > Userspace Statically Defined Tracepoints[1] are dtrace style markers > inside userspace applications. Applications like PostgreSQL, MySQL, > Pthread, Perl, Python, Java, Ruby

Re: [PATCH] perf report powerpc: Fix crash if callchain is empty

2018-06-11 Thread Ravi Bangoria
libc-2.26.so > +8.83% _init+236 [.] _initls > ... > > Reported-by: Ravi Bangoria > Signed-off-by: Sandipan Das Acked-by: Ravi Bangoria

Re: [PATCH v5 06/10] Uprobes: Support SDT markers having reference count (semaphore)

2018-07-16 Thread Ravi Bangoria
Hi Song, On 07/14/2018 05:20 AM, Song Liu wrote: > > Hmm... what happens when we have multiple uprobes sharing the same > reference counter? It feels equally complicate to me. Or did I miss any > cases here? As far as I can think of, it should be handled by default. No special treatment needed

[PATCH v6 2/6] Uprobe: Additional argument arch_uprobe to uprobe_write_opcode()

2018-07-16 Thread Ravi Bangoria
Add addition argument 'arch_uprobe' to uprobe_write_opcode(). We need this in later set of patches. Signed-off-by: Ravi Bangoria --- arch/arm/probes/uprobes/core.c | 2 +- arch/mips/kernel/uprobes.c | 2 +- include/linux/uprobes.h| 2 +- kernel/events/uprobes.c| 9

[PATCH v6 1/6] Uprobes: Simplify uprobe_register() body

2018-07-16 Thread Ravi Bangoria
Simplify uprobe_register() function body and let __uprobe_register() handle everything. Also move dependency functions around to fix build failures. Signed-off-by: Ravi Bangoria --- kernel/events/uprobes.c | 69 ++--- 1 file changed, 36 insertions

[PATCH v6 0/6] Uprobes: Support SDT markers having reference count (semaphore)

2018-07-16 Thread Ravi Bangoria
. - No need to use FOLL_FORCE in get_user_pages_remote() while getting a page to update reference counter. Remove it. - Do not mention usage of reference counter in Documentation/. v5 can be found at: https://lkml.org/lkml/2018/6/28/51 Ravi Bangoria (6): Uprobes: Simplify uprobe_register() body

[PATCH v6 3/6] Uprobes: Support SDT markers having reference count (semaphore)

2018-07-16 Thread Ravi Bangoria
ing it as 'reference counter' in kernel / perf code. Signed-off-by: Ravi Bangoria --- include/linux/uprobes.h | 5 + kernel/events/uprobes.c | 232 ++-- kernel/trace/trace.c| 2 +- kernel/trace/trace_uprobe.c | 38 +++- 4 files changed,

[PATCH v6 4/6] trace_uprobe/sdt: Prevent multiple reference counter for same uprobe

2018-07-16 Thread Ravi Bangoria
e new entry does not conflict with any other existing entry. 2) Any one of the reference counter offset is 0 while comparing new entry with old one. Signed-off-by: Ravi Bangoria --- kernel/trace/trace_uprobe.c | 40 ++-- 1 file changed, 38 insertions(+), 2 dele

[PATCH v6 5/6] Uprobes/sdt: Prevent multiple reference counter for same uprobe

2018-07-16 Thread Ravi Bangoria
reference counter on his own. Signed-off-by: Ravi Bangoria --- kernel/events/uprobes.c | 52 +++-- 1 file changed, 50 insertions(+), 2 deletions(-) diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c index 84da8512a974..563cc3e625b3 100644

[PATCH v6 6/6] perf probe: Support SDT markers having reference counter (semaphore)

2018-07-16 Thread Ravi Bangoria
/tick # ./perf probe sdt_tick:loop2 # ./perf stat -e sdt_tick:loop2 /tmp/tick hi: 0 hi: 1 hi: 2 ^C Performance counter stats for '/tmp/tick': 3 sdt_tick:loop2 2.561851452 seconds time elapsed Signed-off-by: Ravi Bangoria Acked-by: Masami Hiramatsu

Re: [PATCH 42/46] perf script powerpc: Python script for hypervisor call statistics

2018-06-06 Thread Ravi Bangoria
Hi Paul, On 06/06/2018 08:23 PM, Paul Clarke wrote: > On 06/05/2018 12:50 PM, Arnaldo Carvalho de Melo wrote: >> From: Ravi Bangoria >> >> Add python script to show hypervisor call statistics. Ex, >> >> # perf record -a -e "{powerpc:hcall_entry,powe

Re: [PATCH 0/7] Uprobes: Support SDT markers having reference count (semaphore)

2018-06-10 Thread Ravi Bangoria
Hi Oleg, On 06/08/2018 10:06 PM, Oleg Nesterov wrote: > Hello, > > I am travelling till the end of the next week, can't read this version > until I return. Just one question, > > On 06/06, Ravi Bangoria wrote: >> >> 1. One of the major reason was the deadlock

Re: [PATCH 0/7] Uprobes: Support SDT markers having reference count (semaphore)

2018-06-10 Thread Ravi Bangoria
Hi Masami, >>> Hmm, it sounds simple... maybe we can increment refctr in >>> install_breakpoint/ >>> remove_breakpoint? >> >> Not really, it would be simpler if I can put it inside install_breakpoint(). >> Consider an mmap() case. Probed instruction resides in the text section >> whereas >>

Re: [PATCH] perf test: Add watchpoint test

2018-09-11 Thread Ravi Bangoria
reveu: >>>> On Mon, Sep 10, 2018 at 03:28:11PM +0530, Ravi Bangoria wrote: >>>>> Ex on powerpc: >>>>> $ sudo ./perf test 22 >>>>> 22: Watchpoint: >>>>> 22.1: Re

Re: [PATCH] perf test: Add watchpoint test

2018-09-11 Thread Ravi Bangoria
> While testing, I got curious, as a 'perf test' user, why one of the > tests had the "Skip" result: > > [root@seventh ~]# perf test watchpoint > 22: Watchpoint: > 22.1: Read Only Watchpoint: Skip > 22.2: Write Only

[PATCH v2] perf test: Add watchpoint test

2018-09-12 Thread Ravi Bangoria
: 22.1: Read Only Watchpoint: Ok 22.2: Write Only Watchpoint : Ok 22.3: Read / Write Watchpoint : Ok 22.4: Modify Watchpoint : Ok Signed-off-by: Ravi Bangoria

Re: [PATCH] Uprobes: Fix kernel oops with delayed_uprobe_remove()

2018-11-14 Thread Ravi Bangoria
Hi Oleg, On 11/14/18 9:36 PM, Oleg Nesterov wrote: > On 11/14, Ravi Bangoria wrote: >> >> syzbot reported a kernel crash with delayed_uprobe_remove(): >> https://lkml.org/lkml/2018/11/1/1244 >> >> Backtrace mentioned in the link points to a race between proc

[PATCH 1/2] perf stat: Use perf_evsel__is_clocki() for clock events

2018-11-15 Thread Ravi Bangoria
We already have function to check if a given event is either SW_CPU_CLOCK or SW_TASK_CLOCK. Utilize it. Signed-off-by: Ravi Bangoria --- tools/perf/util/stat-shadow.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/perf/util/stat-shadow.c b/tools/perf/util/stat

[RFC 2/2] perf stat: Fix shadow stats for clock events

2018-11-15 Thread Ravi Bangoria
is results in a sightly different values of shadow stats. Reported-by: Anton Blanchard Fixes: 0aa802a79469 ("perf stat: Get rid of extra clock display function") Signed-off-by: Ravi Bangoria --- tools/perf/util/stat-shadow.c | 13 +++-- tools/perf/util/stat.h| 2 +- 2 files c

[PATCH] perf stat: Fix shadow stats for clock events

2018-11-15 Thread Ravi Bangoria
a802a79469 ("perf stat: Get rid of extra clock display function") Signed-off-by: Ravi Bangoria --- tools/perf/util/stat-shadow.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/perf/util/stat-shadow.c b/tools/perf/util/stat-shadow.c index f0a8cec55c47..3c22c58b3e9

Re: [PATCH] powerpc/xmon: Fix data-breakpoint

2016-11-22 Thread Ravi Bangoria
Thanks Michael, On Tuesday 22 November 2016 05:03 PM, Michael Ellerman wrote: > Ravi Bangoria writes: > >> Xmon data-breakpoint feature is broken. >> >> Whenever there is a watchpoint match occurs, hw_breakpoint_handler will >> be called by do_break via notifier c

Re: [PATCH v8 2/3] perf annotate: Support jump instruction with target as second operand

2016-12-05 Thread Ravi Bangoria
10,r2,-15 ▒ BTW, we have lot of such instructions in kernel. Thanks, -Ravi On Monday 05 December 2016 09:26 PM, Ravi Bangoria wrote: > Arch like powerpc has jump instructions that includes target address > as second operand. For example, 'bne cr7,0xc00f6154'

<    5   6   7   8   9   10   11   12   13   14   >