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

2018-03-15 Thread Ravi Bangoria
On 03/14/2018 10:29 PM, Oleg Nesterov wrote: > On 03/13, Ravi Bangoria wrote: >> +static bool sdt_valid_vma(struct trace_uprobe *tu, struct vm_area_struct >> *vma) >> +{ >> +unsigned long vaddr = vma_offset_to_vaddr(vma, tu->ref_ctr_offset); >>

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

2018-03-15 Thread Ravi Bangoria
On 03/15/2018 12:53 PM, Masami Hiramatsu wrote: > > Sorry, that is too complicated than enough. you should try to specify a[0] > instead of a. > > $ sudo ./perf probe -x ~/hello foo1 'a=a[0]:x32[3]' Cool.. that works fine. $ sudo ./perf script    hello  1779 [034]    76.081971:

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

2018-03-15 Thread Ravi Bangoria
Simplify probes_seq_show() function. No change in output before and after patch. Signed-off-by: Ravi Bangoria <ravi.bango...@linux.vnet.ibm.com> --- kernel/trace/trace_uprobe.c | 21 +++-- 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/kernel/trace/trace_up

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

2018-03-15 Thread Ravi Bangoria
tu->offset is unsigned long, not a pointer, thus %lx should be used to print it, not the %px. Fixes: 0e4d819d0893 ("trace_uprobe: Display correct offset in uprobe_events") Suggested-by: Kees Cook <keesc...@chromium.org> Signed-off-by: Ravi Bangoria <ravi.bango...@linu

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

2018-03-07 Thread Ravi Bangoria
On 03/06/2018 05:29 PM, Peter Zijlstra wrote: > On Wed, Feb 28, 2018 at 01:23:44PM +0530, Ravi Bangoria wrote: >> Userspace Statically Defined Tracepoints[1] are dtrace style markers >> inside userspace applications. These markers are added by developer at >> important pla

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

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 <ravi.bango...@linux.vnet.ibm.com> wrote: > >> No functionality changes. > Please consider to describe what is this change and why, here. Will add in next version.

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 <ravi.bango...@linux.vnet.ibm.com> wrote: > >> diff --git a/tools/per

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

2018-04-10 Thread Ravi Bangoria
Hi Oleg, On 04/09/2018 06:59 PM, Oleg Nesterov wrote: > On 04/04, Ravi Bangoria wrote: >> +static void sdt_add_mm_list(struct trace_uprobe *tu, struct mm_struct *mm) >> +{ >> +struct mmu_notifier *mn; >> +struct sdt_mm_list *sml = kzalloc(sizeof(*sml), GFP_KER

Re: [PATCH v5 0/6] enable creating [k,u]probe with perf_event_open

2018-04-09 Thread Ravi Bangoria
Hi Song, On 12/07/2017 04:15 AM, Song Liu wrote: > With current kernel, user space tools can only create/destroy [k,u]probes > with a text-based API (kprobe_events and uprobe_events in tracefs). This > approach relies on user space to clean up the [k,u]probe after using them. > However, this is

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

2018-04-09 Thread Ravi Bangoria
Hi Masami, On 04/09/2018 12:58 PM, Masami Hiramatsu wrote: > Hi Ravi, > > On Wed, 4 Apr 2018 14:01:10 +0530 > Ravi Bangoria <ravi.bango...@linux.vnet.ibm.com> wrote: > >> @@ -2054,15 +2060,21 @@ char *synthesize_probe_trace_command(struct >> probe_trace_event *t

[PATCH 2/3] perf/buildid-cache: Support --list option

2018-04-09 Thread Ravi Bangoria
-by: Ravi Bangoria <ravi.bango...@linux.vnet.ibm.com> --- tools/perf/Documentation/perf-buildid-cache.txt | 4 ++- tools/perf/builtin-buildid-cache.c | 41 +++-- 2 files changed, 41 insertions(+), 4 deletions(-) diff --git a/tools/perf/Documentation/perf-b

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

2018-04-09 Thread Ravi Bangoria
(8a86ef73e44067bca52cc3f6cd3e5446c783391c) /tmp/a.out.1 (ebe71fdcf4b366518cc154d570a33cd461a51c36) # perf buildid-cache -P -v Removing /tmp/a.out (8a86ef73e44067bca52cc3f6cd3e5446c783391c): Ok Removing /tmp/a.out.1 (ebe71fdcf4b366518cc154d570a33cd461a51c36): Ok Purged all: Ok Signed-off-by: Ravi Bangoria <ravi.ba

[PATCH 1/3] tools/parse-options: Add '\n' at the end of error messages

2018-04-09 Thread Ravi Bangoria
Few error messages does not have '\n' at the end and thus next prompt gets printed in the same line. Ex, linux~$ perf buildid-cache -verbose --add ./a.out Error: did you mean `--verbose` (with two dashes ?)linux~$ Fix it. Signed-off-by: Ravi Bangoria <ravi.bango...@linux.vnet.ibm.

[PATCH 0/3] perf/buildid-cache: Add --list and --purge-all options

2018-04-09 Thread Ravi Bangoria
First patch is a trivial error message fix. Second and third adds new options --list and --purge-all to 'buildid-cache' subcommand. Ravi Bangoria (3): tools/parse-options: Add '\n' at the end of error messages perf/buildid-cache: Support --list option perf/buildid-cache: Support --purge-all

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

2018-04-09 Thread Ravi Bangoria
Hi Oleg, On 04/09/2018 06:47 PM, Oleg Nesterov wrote: > On 04/04, Ravi Bangoria wrote: >> +static void sdt_add_mm_list(struct trace_uprobe *tu, struct mm_struct *mm) >> +{ >> +struct mmu_notifier *mn; >> +struct sdt_mm_list *sml = kzalloc(sizeof(*sml), GFP_KER

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

2018-04-09 Thread Ravi Bangoria
On 04/09/2018 07:02 PM, Ravi Bangoria wrote: > Hi Oleg, > > On 04/09/2018 06:47 PM, Oleg Nesterov wrote: >> I didn't read this version yet, just one question... >> >> So now it depends on CONFIG_MMU_NOTIFIER, yes? I do not see any changes in >> Kconfig >>

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

2018-04-11 Thread Ravi Bangoria
Hi Steve, Can you please pull these patches. Thanks, Ravi On 03/15/2018 01:57 PM, Ravi Bangoria wrote: > tu->offset is unsigned long, not a pointer, thus %lx should > be used to print it, not the %px. > > Fixes: 0e4d819d0893 ("trace_uprobe: Display correct offset in uprobe_

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

2018-04-10 Thread Ravi Bangoria
Hi Oleg, On 04/10/2018 04:36 PM, Oleg Nesterov wrote: > Hi Ravi, > > On 04/10, Ravi Bangoria wrote: >>> and what if __mmu_notifier_register() fails simply because signal_pending() >>> == T? >>> see mm_take_all_locks(). >>> >>> at first glan

Re: [PATCH 1/2] perf tools powerpc: Fix callchain ip filtering

2018-04-17 Thread Ravi Bangoria
On 04/12/2018 10:41 PM, Sandipan Das wrote: > For powerpc64, if a probe is added for a function without specifying > a line number, the corresponding trap instruction is placed at offset > 0 (for big endian) or 8 (for little endian) from the start address of > the function. This address is in

Re: [PATCH v2 0/3] perf: Fixes for callchain ip handling on powerpc

2018-04-19 Thread Ravi Bangoria
hen callchain is empty. Looks good. For the series, Tested-by: Ravi Bangoria <ravi.bango...@linux.ibm.com> But there are few other cases, I've mentioned them in detail at the end, which needs to be fixed. Arnaldo, if you are fine, can we push this series and take care of other cases

Re: [PATCH 2/3] perf/buildid-cache: Support --list option

2018-04-16 Thread Ravi Bangoria
Thanks Jiri for the reviews. Will post v2 soon. -Ravi On 04/13/2018 06:28 PM, Jiri Olsa wrote: > On Mon, Apr 09, 2018 at 04:36:32PM +0530, Ravi Bangoria wrote: > > SNIP > >> - !remove_name_list_str && !purge_name_list_str && >

[RFC] trace_events: Fix kernel crash while using empty filter with perf

2018-04-20 Thread Ravi Bangoria
ter logic to be simpler and faster"). This patch restores the behavior as a side effect: Before patch: # echo "" > filter # After patch: # echo "" > filter bash: echo: write error: Invalid argument # Fixes: 80765597bc58 ("tracing: Rewr

[PATCH v2 2/3] perf/buildid-cache: Support --list option

2018-04-16 Thread Ravi Bangoria
-by: Ravi Bangoria <ravi.bango...@linux.vnet.ibm.com> --- tools/perf/Documentation/perf-buildid-cache.txt | 4 ++- tools/perf/builtin-buildid-cache.c | 43 +++-- 2 files changed, 43 insertions(+), 4 deletions(-) diff --git a/tools/perf/Documentation/perf-b

[PATCH v2 1/3] tools/parse-options: Add '\n' at the end of error messages

2018-04-16 Thread Ravi Bangoria
Few error messages does not have '\n' at the end and thus next prompt gets printed in the same line. Ex, linux~$ perf buildid-cache -verbose --add ./a.out Error: did you mean `--verbose` (with two dashes ?)linux~$ Fix it. Signed-off-by: Ravi Bangoria <ravi.bango...@linux.vnet.ibm.

[PATCH v2 0/3] perf/buildid-cache: Add --list and --purge-all options

2018-04-16 Thread Ravi Bangoria
. v1 can be found at: https://lkml.org/lkml/2018/4/9/295 Ravi Bangoria (3): tools/parse-options: Add '\n' at the end of error messages perf/buildid-cache: Support --list option perf/buildid-cache: Support --purge-all option tools/lib/subcmd/parse-options.c| 6 +- tools/perf

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

2018-04-16 Thread Ravi Bangoria
/a.out ebe71fdcf4b366518cc154d570a33cd461a51c36 /tmp/a.out.1 # perf buildid-cache -P -v Removing /tmp/a.out (8a86ef73e44067bca52cc3f6cd3e5446c783391c): Ok Removing /tmp/a.out.1 (ebe71fdcf4b366518cc154d570a33cd461a51c36): Ok Purged all: Ok Signed-off-by: Ravi Bangoria <ravi.ba

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

2018-04-16 Thread Ravi Bangoria
From: Ravi Bangoria <ravi.bango...@linux.ibm.com> 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 <ravi.bango...@linux.ibm.com> Reviewe

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

2018-04-16 Thread Ravi Bangoria
From: Ravi Bangoria <ravi.bango...@linux.ibm.com> Make function names more meaningful by adding vma_ prefix to them. Signed-off-by: Ravi Bangoria <ravi.bango...@linux.ibm.com> Reviewed-by: Jérôme Glisse <jgli...@redhat.com> --- include/linux/mm.h | 4 ++-- kernel/eve

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

2018-04-16 Thread Ravi Bangoria
From: Ravi Bangoria <ravi.bango...@linux.ibm.com> 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(). Sign

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

2018-04-16 Thread Ravi Bangoria
From: Ravi Bangoria <ravi.bango...@linux.ibm.com> When virtual memory map for binary/library is being prepared, there is no direct one to one mapping between mmap() and virtual memory area. Ex, when loader loads the library, it first calls mmap(size = total_size), where total_size is ad

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

2018-04-16 Thread Ravi Bangoria
From: Ravi Bangoria <ravi.bango...@linux.ibm.com> With this, perf buildid-cache will save SDT markers with reference counter in probe cache. Perf probe will be able to probe markers having reference counter. Ex, # readelf -n /tmp/tick | grep -A1 loop2 Name: loop2 ... Sem

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

2018-04-16 Thread Ravi Bangoria
From: Ravi Bangoria <ravi.bango...@linux.ibm.com> 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 Ba

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

2018-04-16 Thread Ravi Bangoria
From: Ravi Bangoria <ravi.bango...@linux.ibm.com> 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 decrement it when done. This is identical to semaphore in Userspace Statically D

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

2018-04-16 Thread Ravi Bangoria
From: Ravi Bangoria <ravi.bango...@linux.ibm.com> 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 embedded i

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

2018-04-16 Thread Ravi Bangoria
From: Oleg Nesterov <o...@redhat.com> 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 <o...@redhat.com> Signed-off-by: R

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

2018-04-16 Thread Ravi Bangoria
ceware.org/systemtap/wiki/UserSpaceProbeImplementation [2] https://github.com/iovisor/bcc/issues/327#issuecomment-200576506 [3] https://lkml.org/lkml/2017/12/6/976 Oleg Nesterov (1): Uprobe: Move mmput() into free_map_info() Ravi Bangoria (8): Uprobe: Export vaddr <-> offset conversion functions mm:

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

2018-04-16 Thread Ravi Bangoria
Hi Masami, On 04/16/2018 02:57 PM, Masami Hiramatsu wrote: > On Mon, 9 Apr 2018 16:36:33 +0530 > Ravi Bangoria <ravi.bango...@linux.vnet.ibm.com> wrote: > >> User can remove files from cache using --remove/--purge options >> but both needs list of files as an ar

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

2018-04-04 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 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 <ravi.bango...@linux.vnet.ibm.

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

2018-04-04 Thread Ravi Bangoria
From: Oleg Nesterov <o...@redhat.com> 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 <o...@redhat.com> Signed-off-by: R

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

2018-04-04 Thread Ravi Bangoria
bb99d8 )) 2>/dev/null | xxd 000: 00 . Signed-off-by: Ravi Bangoria <ravi.bango...@linux.vnet.ibm.com> --- kernel/trace/trace_uprobe.c | 105 ++-- 1 file changed, 102 insertions(+), 3 deletions(-) diff

[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 <ravi.bango...@linux.vnet.ibm.com> Reviewed-by: Jérôme Glisse <jgli...@redhat.com> --- i

[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 <ravi.ba

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

2018-04-04 Thread Ravi Bangoria
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/6/976 Oleg Nesterov (1): Uprobe: Move mmput() into free_map_info() Ra

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

2018-04-04 Thread Ravi Bangoria
. 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/trace/uprobetracer.txt b/Documentation

[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 <ravi.bango...@linux.vnet.ibm.com> Reviewed-by:

[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 <ravi.bango...@linux.vnet.ibm.com> Reviewed-by: Jérôme Glisse <jgli...@redhat.com> --- include/linux/mm.h | 4 ++-- kernel/events/uprobes.c | 14 +++--- 2 files changed,

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

2018-03-16 Thread Ravi Bangoria
On 03/16/2018 05:42 PM, Ravi Bangoria wrote: > > On 03/15/2018 08:19 PM, Oleg Nesterov wrote: >> On 03/13, Ravi Bangoria wrote: >>> For tiny binaries/libraries, different mmap regions points to the >>> same file portion. In such cases, we may increment refere

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

2018-03-16 Thread Ravi Bangoria
On 03/15/2018 08:19 PM, Oleg Nesterov wrote: > On 03/13, 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. > Yes, > >> But while d

Re: [PATCH v6 21/21] perf-probe: Add array argument support

2018-03-22 Thread Ravi Bangoria
Hi Masami :) On 03/22/2018 03:53 PM, Masami Hiramatsu wrote: > On Mon, 19 Mar 2018 13:29:59 +0530 > Ravi Bangoria <ravi.bango...@linux.vnet.ibm.com> wrote: > >> >> Is it okay to allow user to specify array size with type field? > Fro this patch, yes. So IIU

Re: [PATCH v6 21/21] perf-probe: Add array argument support

2018-03-19 Thread Ravi Bangoria
Hi Masami, On 03/17/2018 06:23 PM, Masami Hiramatsu wrote: > Since kprobes events support an array argument, perf-probe > can also support dumping array now. > The syntax are > > [] > or > [] > > where the is ... e.g. array[0..5]. > This can also be available with string type. In this > case,

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

2018-03-18 Thread Ravi Bangoria
Hi Oleg, On 03/14/2018 10:29 PM, Oleg Nesterov wrote: > On 03/13, Ravi Bangoria wrote: >> +static bool sdt_valid_vma(struct trace_uprobe *tu, struct vm_area_struct >> *vma) >> +{ >> +unsigned long vaddr = vma_offset_to_vaddr(vma, tu->ref_ctr_offset); >>

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

2018-03-16 Thread Ravi Bangoria
On 03/16/2018 05:09 PM, Oleg Nesterov wrote: > On 03/16, Ravi Bangoria wrote: >> On 03/15/2018 08:00 PM, Oleg Nesterov wrote: >>> Note to mention that sdt_find_vma() can return NULL but the callers do >>> vma_offset_to_vaddr(vma) without any check. >> If the &q

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

2018-03-19 Thread Ravi Bangoria
Hi Oleg, On 03/16/2018 11:20 PM, Oleg Nesterov wrote: > On 03/16, Ravi Bangoria wrote: >> On 03/15/2018 08:19 PM, Oleg Nesterov wrote: >>> On 03/13, Ravi Bangoria wrote: >>>> For tiny binaries/libraries, different mmap regions points to the >>>> same fil

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

2018-03-01 Thread Ravi Bangoria
On 03/01/2018 07:37 PM, Masami Hiramatsu wrote: > On Wed, 28 Feb 2018 13:23:44 +0530 > Ravi Bangoria <ravi.bango...@linux.vnet.ibm.com> wrote: > >> @@ -502,6 +504,16 @@ static int create_trace_uprobe(int argc, char **argv) >> for (i = 0; i <

[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 <ravi.bango...@linux.vnet.ibm.com> --- include/linux/uprobes.h | 23 +++ kernel/events/uprobes.c | 20 ++-- 2 files changed, 29 insertions(

[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 <ravi.bango...@linux.vnet.ibm.com> --- kernel/events/uprobes.c | 32 +--- 1 file changed, 17 insertions(

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

2018-02-27 Thread Ravi Bangoria
ho 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 <ravi.bango...@linux.vnet.ibm.com> --- kernel/trace/trace_uprobe.c | 105

[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 <ravi.bango...@linux.vnet.ibm.com> --- include/linux/uprobes.h | 2 + kernel/events/uprobes.c | 5 ++ ker

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

2018-02-27 Thread Ravi Bangoria
ps://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 Uprobe: Export few functions / data structures trace_uprob

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

2018-03-06 Thread Ravi Bangoria
On 02/08/2018 09:13 AM, Ravi Bangoria wrote: > > 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 &g

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

[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

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

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

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

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

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

2018-03-01 Thread Ravi Bangoria
On 03/01/2018 07:37 PM, Masami Hiramatsu wrote: > On Wed, 28 Feb 2018 13:23:44 +0530 > Ravi Bangoria wrote: > >> @@ -502,6 +504,16 @@ static int create_trace_uprobe(int argc, char **argv) >> for (i = 0; i < argc && i < MAX_TRACE_ARGS; i++) { >

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

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

2018-03-15 Thread Ravi Bangoria
On 03/15/2018 12:53 PM, Masami Hiramatsu wrote: > > Sorry, that is too complicated than enough. you should try to specify a[0] > instead of a. > > $ sudo ./perf probe -x ~/hello foo1 'a=a[0]:x32[3]' Cool.. that works fine. $ sudo ./perf script    hello  1779 [034]    76.081971:

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

2018-03-15 Thread Ravi Bangoria
tu->offset is unsigned long, not a pointer, thus %lx should be used to print it, not the %px. Fixes: 0e4d819d0893 ("trace_uprobe: Display correct offset in uprobe_events") Suggested-by: Kees Cook Signed-off-by: Ravi Bangoria --- v2 changelog: - Keep prefixed 0s as is.

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

2018-03-15 Thread Ravi Bangoria
Simplify probes_seq_show() function. No change in output before and after patch. Signed-off-by: Ravi Bangoria --- kernel/trace/trace_uprobe.c | 21 +++-- 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/kernel/trace/trace_uprobe.c b/kernel/trace/trace_uprobe.c

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

2018-03-15 Thread Ravi Bangoria
On 03/14/2018 10:29 PM, Oleg Nesterov wrote: > On 03/13, Ravi Bangoria wrote: >> +static bool sdt_valid_vma(struct trace_uprobe *tu, struct vm_area_struct >> *vma) >> +{ >> +unsigned long vaddr = vma_offset_to_vaddr(vma, tu->ref_ctr_offset); >>

[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 --- 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 95909f2..d7ee526 100644 --- a/include/linux

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

2018-03-13 Thread Ravi Bangoria
No functionality changes. Signed-off-by: Ravi Bangoria --- 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 ad06d42..95909f2 100644 --- a/include

[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 --- include/linux/uprobes.h | 9 + kernel/events/uprobes.c | 14 +++--- 2 files changed, 12 insertions(+), 11 deletions(-) diff

[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

[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 Signed-off-by: Fengguang Wu [Fengguang reported/fixed build failure in RFC patch] --- include/linux/uprobes.h | 2 + kernel/events/uprobes.c | 6 ++ kernel/tr

[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 --- tools/perf/util/probe

[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 --- kernel/trace/trace_uprobe.c | 105 +++- 1 file changed, 103 insertions(+)

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

2018-03-13 Thread Ravi Bangoria
No functionality changes. 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

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