Re: [PATCH 5/8] trace_uprobe: Support SDT markers having reference count (semaphore)

2018-03-14 Thread Ravi Bangoria
Hi Masami, On 03/14/2018 07:18 PM, Masami Hiramatsu wrote: > Hi Ravi, > > On Tue, 13 Mar 2018 18:26:00 +0530 > Ravi Bangoria wrote: > >> Userspace Statically Defined Tracepoints[1] are dtrace style markers >> inside userspace applications. These markers are added b

Re: [PATCH 6/8] trace_uprobe/sdt: Fix multiple update of same reference counter

2018-03-14 Thread Ravi Bangoria
On 03/14/2018 07:45 PM, Masami Hiramatsu wrote: > On Tue, 13 Mar 2018 18:26:01 +0530 > Ravi Bangoria wrote: > >> For tiny binaries/libraries, different mmap regions points to the >> same file portion. In such cases, we may increment reference counter >> multiple times

Re: [PATCH 7/8] perf probe: Support SDT markers having reference counter (semaphore)

2018-03-14 Thread Ravi Bangoria
On 03/14/2018 07:39 PM, Masami Hiramatsu wrote: > Hi Ravi, > > This code logic looks good. I just have several small comments for style. > > On Tue, 13 Mar 2018 18:26:02 +0530 > Ravi Bangoria wrote: > >> diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/pro

Re: [PATCH 8/8] trace_uprobe/sdt: Document about reference counter

2018-03-14 Thread Ravi Bangoria
On 03/14/2018 07:20 PM, Masami Hiramatsu wrote: > On Tue, 13 Mar 2018 18:26:03 +0530 > Ravi Bangoria wrote: > >> No functionality changes. > Please consider to describe what is this change and why, here. Will add in next version. >> Signed-off-by: Ravi Bangoria >&g

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 te

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 is

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] 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_

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 fi

[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

[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

[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

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

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 and decr

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 (perf_par

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

2018-07-11 Thread Ravi Bangoria
Hi Oleg, On 07/10/2018 08:55 PM, Oleg Nesterov wrote: > Hi Ravi, > > On 07/04, Ravi Bangoria wrote: >> >>> Now I understand what did you mean by "for each consumer". So if we move >>> this logic >>> into install/remove_breakpoint as I tr

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] == [ 1797.

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] 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: tests/top

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

2018-06-20 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 b3bf35512d21..4d1cee68cfd2 100644

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

2018-06-20 Thread Ravi Bangoria
First patch fixes perf output field hint. Second and third fixes crash when used in a piped mode. Ravi Bangoria (3): perf script: Add missing output fields in a hint perf script: Fix crash because of missing evsel->priv perf script: Fix crash because of missing feat_op[] entry tools/p

Re: [PATCH 1/2] perf script: Show virtual addresses instead of offsets

2018-05-17 Thread Ravi Bangoria
Arnaldo, We already have a binary offset handy in perf code but there is no way to dump it with perf script. We can derive it from symname+symoff but that's a manual work. Will it be good to have a '-F binoff' option? Ravi On 05/18/2018 01:29 AM, Arnaldo Carvalho de Melo wrote: > Em Thu, May 1

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

2018-08-19 Thread Ravi Bangoria
entation [2] https://github.com/iovisor/bcc/issues/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

[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

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

2018-08-19 Thread Ravi Bangoria
ion. So we are calling it a 'reference 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 +++

[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

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

2018-08-19 Thread Ravi Bangoria
y does 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 --g

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

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

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

[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
m_flags has VM_SHARED set. - 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

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

2018-07-16 Thread Ravi Bangoria
hronization. So we are referring 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/tra

[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

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

2018-07-16 Thread Ravi Bangoria
ntain 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 1

[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

[RFC 0/4] trace_uprobe: Support SDT markers having semaphore

2018-02-27 Thread Ravi Bangoria
Can we introduce one more config there? config3? [1] https://sourceware.org/systemtap/wiki/UserSpaceProbeImplementation [2] https://github.com/iovisor/bcc/issues/327#issuecomment-200576506 [3] https://lkml.org/lkml/2017/12/6/976 Ravi Bangoria (4): Uprobe: Rename map_info to uprobe_map_info

[RFC 2/4] Uprobe: Export few functions / data structures

2018-02-27 Thread Ravi Bangoria
These functions and data structures will be used by other files in later patches. Signed-off-by: Ravi Bangoria --- include/linux/uprobes.h | 23 +++ kernel/events/uprobes.c | 20 ++-- 2 files changed, 29 insertions(+), 14 deletions(-) diff --git a/include

[RFC 1/4] Uprobe: Rename map_info to uprobe_map_info

2018-02-27 Thread Ravi Bangoria
map_info is very generic name, rename it to uprobe_map_info. Renaming will help to export this structure outside of the file. Signed-off-by: Ravi Bangoria --- kernel/events/uprobes.c | 32 +--- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/kernel

[RFC 3/4] trace_uprobe: Support SDT markers having semaphore

2018-02-27 Thread Ravi Bangoria
ent the semaphore if corresponding uprobe is enabled. At the time of disabling probes, decrement semaphore in all existing target processes. Signed-off-by: Ravi Bangoria --- include/linux/uprobes.h | 2 + kernel/events/uprobes.c | 5 ++ kernel/trace/trace_uprobe.c |

[RFC 4/4] trace_uprobe: Fix multiple update of same semaphores

2018-02-27 Thread Ravi Bangoria
0 > events/sdt_tick/loop2/enable # dd if=/proc//mem bs=1 count=1 skip=268566582 2>/dev/null | xxd 000: 00 . Signed-off-by: Ravi Bangoria --- kernel/trace/trace_uprobe.c | 105 ++-- 1 file changed, 102 in

Re: [RFC 0/4] trace_uprobe: Support SDT markers having semaphore

2018-02-28 Thread Ravi Bangoria
On 02/28/2018 05:36 PM, Srikar Dronamraju wrote: > * Ravi Bangoria [2018-02-28 13:23:41]: > >> # readelf -n ./tick >> Provider: tick >> Name: loop2 >> ... Semaphore: 0x10020036 >> >> # readelf -SW ./tick | grep p

Re: [RFC 1/4] Uprobe: Rename map_info to uprobe_map_info

2018-02-28 Thread Ravi Bangoria
On 02/28/2018 05:39 PM, Srikar Dronamraju wrote: >> -static inline struct map_info *free_map_info(struct map_info *info) >> +static inline struct uprobe_map_info * >> +free_uprobe_map_info(struct uprobe_map_info *info) >> { >> -struct map_info *next = info->next; >> +struct uprobe_map_in

Re: [RFC 2/4] Uprobe: Export few functions / data structures

2018-02-28 Thread Ravi Bangoria
On 02/28/2018 05:54 PM, Srikar Dronamraju wrote: >> @@ -149,6 +155,11 @@ struct uprobes_state { >> extern bool arch_uprobe_ignore(struct arch_uprobe *aup, struct pt_regs >> *regs); >> extern void arch_uprobe_copy_ixol(struct page *page, unsigned long vaddr, >>

Re: [RFC 0/4] trace_uprobe: Support SDT markers having semaphore

2018-02-28 Thread Ravi Bangoria
On 02/28/2018 07:55 PM, Masami Hiramatsu wrote: > Hi Ravi, > > Thank you for your great work! Thanks Masami. > On Wed, 28 Feb 2018 13:23:41 +0530 > Ravi Bangoria wrote: > >> Userspace Statically Defined Tracepoints[1] are dtrace style markers >> inside userspa

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

2018-04-04 Thread Ravi Bangoria
a marker. This is not really used for any synchronization. So we are referring it as 'reference counter' in kernel / perf code. Signed-off-by: Ravi Bangoria Signed-off-by: Fengguang Wu [Fengguang reported/fixed build failure in RFC patch] --- include/linux/uprobes.h | 10 +++ kern

[PATCH v2 4/9] Uprobe: Rename map_info to uprobe_map_info

2018-04-04 Thread Ravi Bangoria
map_info is very generic name, rename it to uprobe_map_info. Renaming will help to export this structure outside of the file. Also rename free_map_info() to uprobe_free_map_info() and build_map_info() to uprobe_build_map_info(). Signed-off-by: Ravi Bangoria Reviewed-by: Jérôme Glisse

[PATCH v2 3/9] Uprobe: Move mmput() into free_map_info()

2018-04-04 Thread Ravi Bangoria
From: Oleg Nesterov build_map_info() has a side effect like one need to perform mmput() when done with the mm. Add mmput() in free_map_info() so that user does not have to call it explicitly. Signed-off-by: Oleg Nesterov Signed-off-by: Ravi Bangoria --- kernel/events/uprobes.c | 9

[PATCH v2 0/9] trace_uprobe: Support SDT markers having reference count (semaphore)

2018-04-04 Thread Ravi Bangoria
rence counter. - Other changes as suggested by Masami, Oleg and Steve. v1 can be found at: https://lkml.org/lkml/2018/3/13/432 [1] https://sourceware.org/systemtap/wiki/UserSpaceProbeImplementation [2] https://github.com/iovisor/bcc/issues/327#issuecomment-200576506 [3] https://lkml.org/lkml/2017/12

[PATCH v2 8/9] trace_uprobe/sdt: Document about reference counter

2018-04-04 Thread Ravi Bangoria
. Signed-off-by: Ravi Bangoria --- Documentation/trace/uprobetracer.txt | 16 +--- kernel/trace/trace.c | 2 +- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Documentation/trace/uprobetracer.txt b/Documentation/trace/uprobetracer.txt index bf526a7c

[PATCH v2 7/9] trace_uprobe/sdt: Fix multiple update of same reference counter

2018-04-04 Thread Ravi Bangoria
count=1 skip=$(( 0x7fff9cbb99d8 )) 2>/dev/null | xxd 000: 00 . Signed-off-by: Ravi Bangoria --- kernel/trace/trace_uprobe.c | 105 ++-- 1 file changed, 102 insertions(+), 3 deletions(-) diff --git a/kernel/

[PATCH v2 1/9] Uprobe: Export vaddr <-> offset conversion functions

2018-04-04 Thread Ravi Bangoria
These are generic functions which operates on file offset and virtual address. Make these functions available outside of uprobe code so that other can use it as well. Signed-off-by: Ravi Bangoria Reviewed-by: Jérôme Glisse --- include/linux/mm.h | 12 kernel/events/uprobes.c

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

2018-04-04 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 --- tools/perf/

[PATCH v2 2/9] mm: Prefix vma_ to vaddr_to_offset() and offset_to_vaddr()

2018-04-04 Thread Ravi Bangoria
Make function names more meaningful by adding vma_ prefix to them. Signed-off-by: Ravi Bangoria Reviewed-by: Jérôme Glisse --- include/linux/mm.h | 4 ++-- kernel/events/uprobes.c | 14 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/linux/mm.h b

[PATCH v2 5/9] Uprobe: Export uprobe_map_info along with uprobe_{build/free}_map_info()

2018-04-04 Thread Ravi Bangoria
Given the file(inode) and offset, build_map_info() finds all existing mm that map the portion of file containing offset. Exporting these functions and data structure will help to use them in other set of files. Signed-off-by: Ravi Bangoria Reviewed-by: Jérôme Glisse --- include/linux

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

2018-05-03 Thread Ravi Bangoria
On 04/17/2018 10:02 AM, Ravi Bangoria wrote: > Userspace Statically Defined Tracepoints[1] are dtrace style markers > inside userspace applications. Applications like PostgreSQL, MySQL, > Pthread, Perl, Python, Java, Ruby, Node.js, libvirt, QEMU, glib etc > have these markers embe

Re: [PATCH v2 3/3] perf/buildid-cache: Support --purge-all option

2018-05-03 Thread Ravi Bangoria
Hi Masami, On 04/23/2018 12:32 PM, Masami Hiramatsu wrote: > On Tue, 17 Apr 2018 09:43:46 +0530 > Ravi Bangoria wrote: > >> +pr_debug("Purged all: %s\n", err ? "FAIL" : "Ok"); > Hmm, I think this should use pr_info(or pr_warning), at least fo

[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
ples from his interested process. But still this is more of a 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://gith

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

[RFC] powerpc/emulate_step: Fix kernel crash when VSX is not present

2018-05-15 Thread Ravi Bangoria
: stvx : PASS emulate_step_test: lxvd2x : FAIL emulate_step_test: stxvd2x: FAIL Fixes: https://github.com/linuxppc/linux/issues/148 Reported-by: Michael Ellerman Signed-off-by: Ravi Bangoria --- Note: VSX was first introduced on P6. But there are many VSX

[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 4272763a5e96..

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] perf mem/c2c: Fix perf_mem_events to support powerpc

2019-01-28 Thread Ravi Bangoria
On 1/14/19 9:44 AM, Ravi Bangoria wrote: > Powerpc hw does not have inbuilt latency filter (--ldlat) for mem-load > event and, perf_mem_events by default includes ldlat=30 which is > causing failure on powerpc. Refactor code to support perf mem/c2c on > powerpc. > > Thi

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 w

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

[PATCH v2] powerpc/uprobes: Validation for prefixed instruction

2021-02-04 Thread Ravi Bangoria
path. But because Uprobe is invalid, entire mmap() operation can not be stopped. In this case just print an error and continue. Signed-off-by: Ravi Bangoria --- v1: http://lore.kernel.org/r/20210119091234.76317-1-ravi.bango...@linux.ibm.com v1->v2: - Instead of introducing new arch hook from

Re: [PATCH v2] powerpc/uprobes: Validation for prefixed instruction

2021-02-04 Thread Ravi Bangoria
On 2/4/21 4:17 PM, Ravi Bangoria wrote: Don't allow Uprobe on 2nd word of a prefixed instruction. As per ISA 3.1, prefixed instruction should not cross 64-byte boundary. So don't allow Uprobe on such prefixed instruction as well. There are two ways probed instruction is changed

Re: [PATCH] perf test: Skip test 68 for Powerpc

2020-12-08 Thread Ravi Bangoria
On 12/8/20 8:13 PM, Thomas Richter wrote: On 12/7/20 5:35 PM, Arnaldo Carvalho de Melo wrote: Em Tue, Nov 24, 2020 at 03:04:53PM +0530, Ravi Bangoria escreveu: On 11/19/20 7:20 PM, Kajol Jain wrote: Commit ed21d6d7c48e6e ("perf tests: Add test for PE binary format support&quo

[PATCH] powerpc/uprobes: Don't allow probe on suffix of prefixed instruction

2021-01-19 Thread Ravi Bangoria
and continue. Signed-off-by: Ravi Bangoria --- arch/powerpc/kernel/uprobes.c | 28 include/linux/uprobes.h | 1 + kernel/events/uprobes.c | 8 3 files changed, 37 insertions(+) diff --git a/arch/powerpc/kernel/uprobes.c b/arch/powerpc/kernel

Re: [PATCH v3] powerpc/uprobes: Validation for prefixed instruction

2021-03-04 Thread Ravi Bangoria
On 3/4/21 1:02 PM, Christophe Leroy wrote: Le 04/03/2021 à 06:05, Ravi Bangoria a écrit : As per ISA 3.1, prefixed instruction should not cross 64-byte boundary. So don't allow Uprobe on such prefixed instruction. There are two ways probed instruction is changed in mapped pages.

Re: [PATCH v3] powerpc/uprobes: Validation for prefixed instruction

2021-03-04 Thread Ravi Bangoria
On 3/4/21 4:21 PM, Christophe Leroy wrote: Le 04/03/2021 à 11:13, Ravi Bangoria a écrit : On 3/4/21 1:02 PM, Christophe Leroy wrote: Le 04/03/2021 à 06:05, Ravi Bangoria a écrit : As per ISA 3.1, prefixed instruction should not cross 64-byte boundary. So don't allow Uprobe on

[PATCH v4] powerpc/uprobes: Validation for prefixed instruction

2021-03-05 Thread Ravi Bangoria
d. In this case just print an error and continue. Signed-off-by: Ravi Bangoria Acked-by: Naveen N. Rao --- v3: https://lore.kernel.org/r/20210304050529.59391-1-ravi.bango...@linux.ibm.com v3->v4: - CONFIG_PPC64 check was not required, remove it. - Use SZ_ macros instead of hardcoded numbers

[PATCH v3] powerpc/uprobes: Validation for prefixed instruction

2021-03-03 Thread Ravi Bangoria
d. In this case just print an error and continue. Signed-off-by: Ravi Bangoria --- v2: https://lore.kernel.org/r/20210204104703.273429-1-ravi.bango...@linux.ibm.com v2->v3: - Drop restriction for Uprobe on suffix of prefixed instruction. It needs lot of code change including generic code

[PATCH] perf report: Fix -F for branch & mem modes

2021-03-03 Thread Ravi Bangoria
stdio # Samples: 8K of event 'cycles' # Event count (approx.): 8784 ... Reported-by: Athira Rajeev Fixes: aa6b3c99236b ("perf report: Make -F more strict like -s") Signed-off-by: Ravi Bangoria --- tools/perf/util/sort.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletio

Re: [PATCH v3] powerpc/uprobes: Validation for prefixed instruction

2021-03-03 Thread Ravi Bangoria
@@ -41,6 +41,14 @@ int arch_uprobe_analyze_insn(struct arch_uprobe *auprobe, if (addr & 0x03) return -EINVAL; + if (!IS_ENABLED(CONFIG_PPC64) || !cpu_has_feature(CPU_FTR_ARCH_31)) + return 0; Sorry, I missed this last time, but I think we can drop the

Re: [PATCH] perf test: Skip test 68 for Powerpc

2020-12-09 Thread Ravi Bangoria
On 12/9/20 11:19 PM, Arnaldo Carvalho de Melo wrote: Em Tue, Dec 08, 2020 at 10:32:33PM +0530, Ravi Bangoria escreveu: On 12/8/20 8:13 PM, Thomas Richter wrote: On 12/7/20 5:35 PM, Arnaldo Carvalho de Melo wrote: Em Tue, Nov 24, 2020 at 03:04:53PM +0530, Ravi Bangoria escreveu: On 11/19

Re: [PATCH] perf test: Skip test 68 for Powerpc

2020-11-24 Thread Ravi Bangoria
s test. Result in power9 platform before this patach: [command]# ./perf test -F 68 68: PE file support : Failed! Result in power9 platform after this patch: [command]# ./perf test -F 68 68: PE file support : Skip Signed-off-by: Kajol

[PATCH v2 1/4] KVM: PPC: Allow nested guest creation when L0 hv_guest_state > L1

2020-11-24 Thread Ravi Bangoria
t the new member to be added only at the end. i.e. we can allow nested guest even when L0 hv_guest_state.version > L1 hv_guest_state.version. Though, the other way around is not possible. Signed-off-by: Ravi Bangoria --- arch/powerpc/include/asm/hvcall.h | 17 +++-- arch/pow

[PATCH v2 0/4] KVM: PPC: Power10 2nd DAWR enablement

2020-11-24 Thread Ravi Bangoria
#x27;t rename KVM_REG_PPC_DAWR, it's an uapi macro - patch #3: Increment HV_GUEST_STATE_VERSION - Split kvm and selftests patches into different series - Patches rebased to paulus/kvm-ppc-next (cf59eb13e151) + few other watchpoint patches which are yet to be merged in paulus/kvm-ppc-next.

[PATCH v2 2/4] KVM: PPC: Rename current DAWR macros and variables

2020-11-24 Thread Ravi Bangoria
Power10 is introducing second DAWR. Use real register names (with suffix 0) from ISA for current macros and variables used by kvm. One exception is KVM_REG_PPC_DAWR. Keep it as it is because it's uapi so changing it will break userspace. Signed-off-by: Ravi Bangoria --- arch/powerpc/includ

[PATCH v2 3/4] KVM: PPC: Add infrastructure to support 2nd DAWR

2020-11-24 Thread Ravi Bangoria
kvm code assumes single DAWR everywhere. Add code to support 2nd DAWR. DAWR is a hypervisor resource and thus H_SET_MODE hcall is used to set/ unset it. Introduce new case H_SET_MODE_RESOURCE_SET_DAWR1 for 2nd DAWR. Also, kvm will support 2nd DAWR only if CPU_FTR_DAWR1 is set. Signed-off-by: Ravi

[PATCH v2 4/4] KVM: PPC: Introduce new capability for 2nd DAWR

2020-11-24 Thread Ravi Bangoria
Introduce KVM_CAP_PPC_DAWR1 which can be used by Qemu to query whether kvm supports 2nd DAWR or not. Signed-off-by: Ravi Bangoria --- arch/powerpc/kvm/powerpc.c | 3 +++ include/uapi/linux/kvm.h | 1 + 2 files changed, 4 insertions(+) diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc

Re: [PATCH] powerpc/uprobes: Don't allow probe on suffix of prefixed instruction

2021-01-20 Thread Ravi Bangoria
On 1/19/21 10:56 PM, Oleg Nesterov wrote: On 01/19, Ravi Bangoria wrote: Probe on 2nd word of a prefixed instruction is invalid scenario and should be restricted. I don't understand this ppc-specific problem, but... So far (upto Power9), instruction size was fixed - 4 bytes. But Po

[PATCH v5] powerpc/uprobes: Validation for prefixed instruction

2021-03-11 Thread Ravi Bangoria
d. In this case just print an error and continue. Signed-off-by: Ravi Bangoria Acked-by: Naveen N. Rao Acked-by: Sandipan Das --- v4: https://lore.kernel.org/r/20210305115433.140769-1-ravi.bango...@linux.ibm.com v4->v5: - Replace SZ_ macros with numbers arch/powerpc/kernel/uprob

Re: [PATCH v4] powerpc/uprobes: Validation for prefixed instruction

2021-03-09 Thread Ravi Bangoria
On 3/9/21 4:51 PM, Naveen N. Rao wrote: On 2021/03/09 08:54PM, Michael Ellerman wrote: Ravi Bangoria writes: As per ISA 3.1, prefixed instruction should not cross 64-byte boundary. So don't allow Uprobe on such prefixed instruction. There are two ways probed instruction is chang

Re: [PATCH v2] powerpc/uprobes: Validation for prefixed instruction

2021-02-08 Thread Ravi Bangoria
On 2/6/21 11:36 PM, Oleg Nesterov wrote: On 02/04, Ravi Bangoria wrote: +static int get_instr(struct mm_struct *mm, unsigned long addr, u32 *instr) +{ + struct page *page; + struct vm_area_struct *vma; + void *kaddr; + unsigned int gup_flags = FOLL_FORCE

Re: [PATCH v2] powerpc/uprobes: Validation for prefixed instruction

2021-02-08 Thread Ravi Bangoria
On 2/4/21 6:45 PM, Naveen N. Rao wrote: On 2021/02/04 04:19PM, Ravi Bangoria wrote: On 2/4/21 4:17 PM, Ravi Bangoria wrote: Don't allow Uprobe on 2nd word of a prefixed instruction. As per ISA 3.1, prefixed instruction should not cross 64-byte boundary. So don't allow Upro

Re: [PATCH v2] powerpc/uprobes: Validation for prefixed instruction

2021-02-08 Thread Ravi Bangoria
On 2/4/21 9:42 PM, Naveen N. Rao wrote: On 2021/02/04 06:38PM, Naveen N. Rao wrote: On 2021/02/04 04:17PM, Ravi Bangoria wrote: Don't allow Uprobe on 2nd word of a prefixed instruction. As per ISA 3.1, prefixed instruction should not cross 64-byte boundary. So don't allow Upro

Re: [PATCH v2] powerpc/uprobes: Validation for prefixed instruction

2021-02-08 Thread Ravi Bangoria
On 2/4/21 6:38 PM, Naveen N. Rao wrote: On 2021/02/04 04:17PM, Ravi Bangoria wrote: Don't allow Uprobe on 2nd word of a prefixed instruction. As per ISA 3.1, prefixed instruction should not cross 64-byte boundary. So don't allow Uprobe on such prefixed instruction as well. The

[PATCH v3 2/4] KVM: PPC: Rename current DAWR macros and variables

2020-12-16 Thread Ravi Bangoria
Power10 is introducing second DAWR. Use real register names (with suffix 0) from ISA for current macros and variables used by kvm. One exception is KVM_REG_PPC_DAWR. Keep it as it is because it's uapi so changing it will break userspace. Signed-off-by: Ravi Bangoria --- arch/powerpc/includ

[PATCH v3 3/4] KVM: PPC: Add infrastructure to support 2nd DAWR

2020-12-16 Thread Ravi Bangoria
kvm code assumes single DAWR everywhere. Add code to support 2nd DAWR. DAWR is a hypervisor resource and thus H_SET_MODE hcall is used to set/ unset it. Introduce new case H_SET_MODE_RESOURCE_SET_DAWR1 for 2nd DAWR. Also, kvm will support 2nd DAWR only if CPU_FTR_DAWR1 is set. Signed-off-by: Ravi

[PATCH v3 4/4] KVM: PPC: Introduce new capability for 2nd DAWR

2020-12-16 Thread Ravi Bangoria
Introduce KVM_CAP_PPC_DAWR1 which can be used by Qemu to query whether kvm supports 2nd DAWR or not. The capability is by default disabled even when the underlying CPU supports 2nd DAWR. Qemu needs to check and enable it manually to use the feature. Signed-off-by: Ravi Bangoria

[PATCH v3 0/4] KVM: PPC: Power10 2nd DAWR enablement

2020-12-16 Thread Ravi Bangoria
ch #2: Don't rename KVM_REG_PPC_DAWR, it's an uapi macro - patch #3: Increment HV_GUEST_STATE_VERSION - Split kvm and selftests patches into different series - Patches rebased to paulus/kvm-ppc-next (cf59eb13e151) + few other watchpoint patches which are yet to be merged in paulus/kvm-ppc-ne

[PATCH v3 1/4] KVM: PPC: Allow nested guest creation when L0 hv_guest_state > L1

2020-12-16 Thread Ravi Bangoria
t the new member to be added only at the end. i.e. we can allow nested guest even when L0 hv_guest_state.version > L1 hv_guest_state.version. Though, the other way around is not possible. Signed-off-by: Ravi Bangoria Reviewed-by: Fabiano Rosas --- arch/powerpc/include/asm/hvcall.

Re: [RFC 1/4] perf kvm: Enable 'record' on powerpc

2016-05-09 Thread Ravi Bangoria
Hi Arnaldo, Thanks for the review. Please find my comments below. On Thursday 28 April 2016 03:17 AM, Arnaldo Carvalho de Melo wrote: Em Wed, Apr 27, 2016 at 06:02:21PM +0530, Ravi Bangoria escreveu: Hi Arnaldo, I've worked on your patch. I'm sending this patch(diff) to check if t

<    1   2   3   4   5   6   7   8   9   >