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 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 <ravi.bango...@linux.vnet.ibm.com> wrote: > >> +pr_debug("Purged all: %s\n", err ? "FAIL" : "Ok"); > Hmm, I think this s

[PATCH] trace_uprobe: Display correct offset in uprobe_events

2018-01-05 Thread Ravi Bangoria
/main /tmp/a.out:0x058c Signed-off-by: Ravi Bangoria <ravi.bango...@linux.vnet.ibm.com> --- kernel/trace/trace_uprobe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/trace/trace_uprobe.c b/kernel/trace/trace_uprobe.c index 40592e7b3568..268029ae1be6 100

Re: [PATCH] trace_uprobe: Display correct offset in uprobe_events

2018-01-07 Thread Ravi Bangoria
On 01/08/2018 10:49 AM, Srikar Dronamraju wrote: > * Ravi Bangoria <ravi.bango...@linux.vnet.ibm.com> [2018-01-06 11:12:46]: > >> Recently, how the pointers being printed with %p has been changed >> by commit ad67b74d2469 ("printk: hash addresses printed

[PATCH 0/3] perf trace powerpc: Remove libaudit dependency for syscalls

2018-01-29 Thread Ravi Bangoria
( 0.006 ms): ls/43342 open(filename: 0x793f2778, flags: CLOEXEC ) = 3 ... Ravi Bangoria (3): tools include powerpc: Grab a copy of arch/powerpc/include/uapi/asm/unistd.h perf powerpc: Generate system call table from asm/unistd.h perf trace powerpc: Use generated syscall table

[PATCH 1/3] tools include powerpc: Grab a copy of arch/powerpc/include/uapi/asm/unistd.h

2018-01-29 Thread Ravi Bangoria
Will be used for generating the syscall id/string translation table. Signed-off-by: Ravi Bangoria <ravi.bango...@linux.vnet.ibm.com> --- tools/arch/powerpc/include/uapi/asm/unistd.h | 399 +++ tools/perf/check-headers.sh | 1 + 2 files change

[PATCH 3/3] perf trace powerpc: Use generated syscall table

2018-01-29 Thread Ravi Bangoria
This should speed up accessing new system calls introduced with the kernel rather than waiting for libaudit updates to include them. It also enables users to specify wildcards, for example, perf trace -e 'open*', just like was already possible on x86 and s390. Signed-off-by: Ravi Bangoria

[PATCH 2/3] perf powerpc: Generate system call table from asm/unistd.h

2018-01-29 Thread Ravi Bangoria
This should speed up accessing new system calls introduced with the kernel rather than waiting for libaudit updates to include them. Signed-off-by: Ravi Bangoria <ravi.bango...@linux.vnet.ibm.com> --- tools/perf/arch/powerpc/Makefile | 21 + .../perf/arch/p

[PATCH 0/2] perf trace: Two trivial fixes

2018-01-29 Thread Ravi Bangoria
Two independent fixes: First adds 'generated' directory into .gitignore Second fixes call-graph output with perf trace Ravi Bangoria (2): perf tools: Add trace/beauty/generated/ into .gitignore perf trace: Fix call-graph output tools/perf/.gitignore | 1 + tools/perf/builtin-trace.c

[PATCH 1/2] perf tools: Add trace/beauty/generated/ into .gitignore

2018-01-29 Thread Ravi Bangoria
No functionality changes. Signed-off-by: Ravi Bangoria <ravi.bango...@linux.vnet.ibm.com> --- tools/perf/.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/perf/.gitignore b/tools/perf/.gitignore index 643cc4ba..3e5135d 100644 --- a/tools/perf/.gitignore +++ b/tool

[PATCH 2/2] perf trace: Fix call-graph output

2018-01-29 Thread Ravi Bangoria
0, mode: R do_syscall_trace_leave ([kernel.kallsyms]) [0] ([unknown]) Fixes: bd3dda9ab0fb ("perf trace: Allow overriding global --max-stack per event") Signed-off-by: Ravi Bangoria <ravi.bango...@linux.vnet.ibm.com> ---

Re: [tip:perf/core] perf trace: Allow overriding global --max-stack per event

2018-01-29 Thread Ravi Bangoria
Hi Arnaldo, This commit seems to be causing a regression: $ ./perf trace record -g ls Perf compiled from acme/perf/core: $ ./perf trace -i perf.data 0.200 ( 0.016 ms): ls/19722 brk( 0.367 ( 0.024 ms): ls/19722 access(filename:

Re: [PATCH 2/2] trace_uprobe: Simplify probes_seq_show()

2018-02-07 Thread Ravi Bangoria
On 02/08/2018 08:59 AM, Kees Cook wrote: > On Tue, Feb 6, 2018 at 8:34 PM, Ravi Bangoria > <ravi.bango...@linux.vnet.ibm.com> wrote: >> Simplify probes_seq_show() function. We are using %lx to display >> the offset and we don't prepend unnecessary 0s in the offset. &

[PATCH 1/2] trace_uprobe: Use %lx to display offset

2018-02-06 Thread Ravi Bangoria
by: Kees Cook <keesc...@chromium.org> Signed-off-by: Ravi Bangoria <ravi.bango...@linux.vnet.ibm.com> --- kernel/trace/trace_uprobe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/trace/trace_uprobe.c b/kernel/trace/trace_uprobe.c index 268029ae1be6..c2c96539889

[PATCH 2/2] trace_uprobe: Simplify probes_seq_show()

2018-02-06 Thread Ravi Bangoria
Simplify probes_seq_show() function. We are using %lx to display the offset and we don't prepend unnecessary 0s in the offset. Signed-off-by: Ravi Bangoria <ravi.bango...@linux.vnet.ibm.com> --- kernel/trace/trace_uprobe.c | 21 +++-- 1 file changed, 3 insertions(+), 18 del

Uprobe: Bug(?) when probing small binaries

2018-02-12 Thread Ravi Bangoria
Hi Oleg, I'm observing a bug in the uprobe infrastructure. When target binary is quite small, uprobe replaces 'trap' instruction at two different places. Ex, Simple test.c that loops for 100 seconds:     void main()     {     int i = 0;         while (i++ != 100) {    

Re: [PATCH 1/3] tools include powerpc: Grab a copy of arch/powerpc/include/uapi/asm/unistd.h

2018-02-16 Thread Ravi Bangoria
Oops.. Really sorry about that. I've tested acme/perf/core on ubuntu ppc32 with and without libaudit-dev and it's working fine. Thank you very much for fixing it, Ravi On 02/16/2018 11:20 PM, Arnaldo Carvalho de Melo wrote: > Em Fri, Feb 16, 2018 at 02:29:01PM -0300, Arnaldo Carvalho de Melo

Re: [PATCH 0/2] perf-probe: Improve warning message for buildid mismatch

2018-01-02 Thread Ravi Bangoria
On 12/18/2017 12:58 PM, Masami Hiramatsu wrote: > Hello, > > This series ensure the build-ids for target binary and debuginfo > are matched. If there is a mismatch, it warns user to check the > package versions. For the series, Reviewed-by: Ravi Bangoria <ravi.bango...@linux.vnet.ibm.com>

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

2018-06-20 Thread Ravi Bangoria
: # ./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 report: Support forced leader feature in pipe mode") --- tools

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

2018-06-20 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 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 2/3] perf script: Fix crash because of missing evsel->priv

2018-06-20 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

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

[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 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

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

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 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.

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

[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/

[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

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 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 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 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; >> + &

[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 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

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

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

Re: [PATCH 2/2] trace_uprobe: Simplify probes_seq_show()

2018-03-06 Thread Ravi Bangoria
On 03/07/2018 03:34 AM, Kees Cook wrote: > On Tue, Mar 6, 2018 at 12:12 AM, Ravi Bangoria > <ravi.bango...@linux.vnet.ibm.com> wrote: >> >> On 02/08/2018 09:13 AM, Ravi Bangoria wrote: >>> Wang, ping :) >>> >>> Kees, I don't hea

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 05:36 PM, Srikar Dronamraju wrote: > * Ravi Bangoria <ravi.bango...@linux.vnet.ibm.com> [2018-02-28 13:23:41]: > >> # readelf -n ./tick >> Provider: tick >> Name: loop2 >> ... Semaphore: 0x10020036 >> >> # re

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

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 <ravi.bango...@linux.vnet.ibm.com> wrote: > >> Userspace Statically Defined Tracepoints[1] are

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

2018-03-13 Thread Ravi Bangoria
rf # dd if=/proc/`pgrep tick`/mem bs=1 count=1 skip=$(( 0x10020036 )) 2>/dev/null | xxd 000: 00 . Signed-off-by: Ravi Bangoria <ravi.bango...@linux.vnet.ibm.com> --- kernel/trace/trace_uprobe.c | 105 ++

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

2018-03-13 Thread Ravi Bangoria
No functionality changes. Signed-off-by: Ravi Bangoria <ravi.bango...@linux.vnet.ibm.com> --- Documentation/trace/uprobetracer.txt | 16 +--- kernel/trace/trace.c | 2 +- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Documentation

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

2018-03-13 Thread Ravi Bangoria
No functionality changes. Signed-off-by: Ravi Bangoria <ravi.bango...@linux.vnet.ibm.com> --- include/linux/mm.h | 12 kernel/events/uprobes.c | 10 -- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index a

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

2018-03-13 Thread Ravi Bangoria
ode. RFC series can be found at: https://lkml.org/lkml/2018/2/28/76 Ravi Bangoria (8): Uprobe: Export vaddr <-> offset conversion functions mm: Prefix vma_ to vaddr_to_offset() and offset_to_vaddr() Uprobe: Rename map_info to uprobe_map_info Uprobe: Export uprobe_map_info along with

[PATCH 4/8] Uprobe: Export uprobe_map_info along with uprobe_{build/free}_map_info()

2018-03-13 Thread Ravi Bangoria
These exported data structure and functions will be used by other files in later patches. No functionality changes. Signed-off-by: Ravi Bangoria <ravi.bango...@linux.vnet.ibm.com> --- include/linux/uprobes.h | 9 + kernel/events/uprobes.c | 14 +++--- 2 files chang

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

2018-03-13 Thread Ravi Bangoria
No functionality changes. Signed-off-by: Ravi Bangoria <ravi.bango...@linux.vnet.ibm.com> --- 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/include/linux/mm.h index 9

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

2018-03-13 Thread Ravi Bangoria
sed for any synchronization. So we are referring it as 'reference counter' in kernel / perf code. Signed-off-by: Ravi Bangoria <ravi.bango...@linux.vnet.ibm.com> Signed-off-by: Fengguang Wu <fengguang...@intel.com> [Fengguang reported/fixed build failure in RFC patch] --- include/

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

2018-03-13 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 <ravi.ba

[PATCH 3/8] Uprobe: Rename map_info to uprobe_map_info

2018-03-13 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(). No functionality changes. Signed-off-by: Ravi Bangoria <ravi.ba

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

2018-03-16 Thread Ravi Bangoria
On 03/15/2018 07:51 PM, Oleg Nesterov wrote: > On 03/13, Ravi Bangoria wrote: >> @@ -1053,6 +1056,9 @@ int uprobe_mmap(struct vm_area_struct *vma) >> struct uprobe *uprobe, *u; >> struct inode *inode; >> >> +if (uprobe_mmap_callback) >>

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

2018-03-16 Thread Ravi Bangoria
On 03/15/2018 08:31 PM, Oleg Nesterov wrote: > On 03/13, Ravi Bangoria wrote: >> +sdt_update_ref_ctr(struct mm_struct *mm, unsigned long vaddr, short d) >> +{ >> +void *kaddr; >> +struct page *page; >> +struct vm_area_struct *vma; >> +int r

Re: [PATCH 2/8] mm: Prefix vma_ to vaddr_to_offset() and offset_to_vaddr()

2018-03-16 Thread Ravi Bangoria
On 03/15/2018 09:58 PM, Steven Rostedt wrote: > On Tue, 13 Mar 2018 18:25:57 +0530 > Ravi Bangoria <ravi.bango...@linux.vnet.ibm.com> wrote: > >> No functionality changes. > Again, please add an explanation to why this patch is done. Sure. Will add. Thanks for the

Re: [PATCH 3/8] Uprobe: Rename map_info to uprobe_map_info

2018-03-16 Thread Ravi Bangoria
On 03/15/2018 10:14 PM, Steven Rostedt wrote: > On Tue, 13 Mar 2018 18:25:58 +0530 > Ravi Bangoria <ravi.bango...@linux.vnet.ibm.com> wrote: >> -static inline struct map_info *free_map_info(struct map_info *info) >> +static inline struct uprobe_map_info * >>

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

2018-03-16 Thread Ravi Bangoria
On 03/15/2018 10:18 PM, Steven Rostedt wrote: > On Tue, 13 Mar 2018 18:26:00 +0530 > Ravi Bangoria <ravi.bango...@linux.vnet.ibm.com> wrote: > >> +static void sdt_increment_ref_ctr(struct trace_uprobe *tu) >> +{ >> +struct uprobe_map_info *info; &

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

2018-03-16 Thread Ravi Bangoria
On 03/15/2018 08:00 PM, Oleg Nesterov wrote: > On 03/15, Oleg Nesterov wrote: >>> +static struct vm_area_struct * >>> +sdt_find_vma(struct mm_struct *mm, struct trace_uprobe *tu) >>> +{ >>> + struct vm_area_struct *tmp; >>> + >>> + for (tmp = mm->mmap; tmp != NULL; tmp = tmp->vm_next) >>> +

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

2018-03-16 Thread Ravi Bangoria
On 03/15/2018 06:17 PM, Masami Hiramatsu wrote: > Hi Ravi, > > On Wed, 14 Mar 2018 20:52:59 +0530 > Ravi Bangoria <ravi.bango...@linux.vnet.ibm.com> wrote: > >> On 03/14/2018 07:20 PM, Masami Hiramatsu wrote: >>> On Tue, 13 Mar 2018 18:26:03

Re: [PATCH 1/8] Uprobe: Export vaddr <-> offset conversion functions

2018-03-16 Thread Ravi Bangoria
On 03/15/2018 09:57 PM, Steven Rostedt wrote: > On Tue, 13 Mar 2018 18:25:56 +0530 > Ravi Bangoria <ravi.bango...@linux.vnet.ibm.com> wrote: > >> No functionality changes. > Please add a detailed explanation why this patch is needed. All commits > should be self suffic

Re: [PATCH 4/8] Uprobe: Export uprobe_map_info along with uprobe_{build/free}_map_info()

2018-03-16 Thread Ravi Bangoria
On 03/15/2018 10:02 PM, Steven Rostedt wrote: > On Tue, 13 Mar 2018 18:25:59 +0530 > Ravi Bangoria <ravi.bango...@linux.vnet.ibm.com> wrote: > >> These exported data structure and functions will be used by other >> files in later patches. > I'm

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 <ravi.bango...@linux.vnet.ibm.com> wrote: > >> For tiny binaries/libraries, different mmap regions points to the >> same file portion. In such cases, we may

Re: [PATCH v5 16/19] tracing: probeevent: Add array type support

2018-03-14 Thread Ravi Bangoria
Hi Masami, On 03/08/2018 02:20 PM, Masami Hiramatsu wrote: > Add array type support for probe events. > This allows user to get arraied types from memory address. > The array type syntax is > > TYPE[N] > > Where TYPE is one of types (u8/16/32/64,s8/16/32/64, > x8/16/32/64, symbol, string)

<    1   2   3   4   5   6   7   8   9   10   >