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 wrote: > >> >> Is it okay to allow user to specify array size with type field? > Fro this patch, yes. So IIUC, perf _tool_ will allow user to record array

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 wrote: > >> No functionality changes. > Please add a detailed explanation why this patch is needed. All commits > should be self sufficient and stand on their own.

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 wrote: > >> No functionality changes. > Again, please add an explanation to why this patch is done. Sure. Will add. Thanks for the review, Ravi > -- Steve > >> Signed-off-by: Ravi Bangoria

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 wrote: >> -static inline struct map_info *free_map_info(struct map_info *info) >> +static inline struct uprobe_map_info * >> +uprobe_free_map_info(stru

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 wrote: > >> These exported data structure and functions will be used by other >> files in later patches. > I'm reluctantly OK with the above. > >> No funct

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 wrote: > >> +static void sdt_increment_ref_ctr(struct trace_uprobe *tu) >> +{ >> +struct uprobe_map_info *info; >> +struct vm_area_struct

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: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 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 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 wrote: > >> On 03/14/2018 07:20 PM, Masami Hiramatsu wrote: >>> On Tue, 13 Mar 2018 18:26:03 +0530 >>> Ravi Bangoria wrote: >>> &g

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

[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

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

2018-05-04 Thread Ravi Bangoria
Hi Masami, On 05/04/2018 10:18 AM, Masami Hiramatsu wrote: >> +void uprobe_down_write_dup_mmap(void) >> +{ >> +percpu_down_write(_mmap_sem); >> +} >> + >> +void uprobe_up_write_dup_mmap(void) >> +{ >> +percpu_up_write(_mmap_sem); >> +} >> + > I'm not sure why these hunks are not done in

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

2018-05-07 Thread Ravi Bangoria
Hi Masami, On 05/04/2018 07:51 PM, Ravi Bangoria wrote: > >>> +} >>> + >>> +static void sdt_increment_ref_ctr(struct trace_uprobe *tu) >>> +{ >>> + struct uprobe_map_info *info; >>> + >>> + uprobe_down_write_dup

[PATCH v2] perf buildid-cache: Warn --purge-all failures

2018-05-09 Thread Ravi Bangoria
Warn perf buildid-cache --purge-all failures in non verbose mode. Ex, $ sudo chown root:root /home/ravi/.debug -R $ sudo chmod 700 /home/ravi/.debug/ -R $ ./perf buildid-cache -P Couldn't remove some caches. Error: Permission denied. Suggested-by: Masami Hiramatsu Signed-off-by: Ravi

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

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

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

2018-05-08 Thread Ravi Bangoria
Hi Masami, On 05/07/2018 09:26 PM, Masami Hiramatsu wrote: > On Mon, 7 May 2018 13:51:21 +0530 > Ravi Bangoria wrote: > >> Hi Masami, >> >> On 05/04/2018 07:51 PM, Ravi Bangoria wrote: >>>>> +} >>>>> + >>>>> +static voi

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

2018-05-09 Thread Ravi Bangoria
On 05/08/2018 09:12 PM, Masami Hiramatsu wrote: > On Thu, 3 May 2018 14:24:04 +0530 > Ravi Bangoria wrote: > >> Hi Masami, >> >> On 04/23/2018 12:32 PM, Masami Hiramatsu wrote: >>> On Tue, 17 Apr 2018 09:43:46 +0530 >>> Ravi Bangoria wrote: >>

[PATCH] perf buildid-cache: Warn --purge-all failures

2018-05-09 Thread Ravi Bangoria
Warn perf buildid-cache --purge-all failures in non verbose mode. Ex, $ sudo chown root:root /home/ravi/.debug -R $ ./perf buildid-cache -P Error: Permission denied. Suggested-by: Masami Hiramatsu Signed-off-by: Ravi Bangoria --- tools/perf/builtin-buildid-cache.c | 8 ++-- 1 file

[PATCH 3/3] powerpc/sstep: Fix emulate_step test if VSX not present

2018-05-20 Thread Ravi Bangoria
: lxvd2x : PASS (!CPU_FTR_VSX) emulate_step_test: stxvd2x: PASS (!CPU_FTR_VSX) Signed-off-by: Ravi Bangoria --- arch/powerpc/lib/test_emulate_step.c | 21 +++-- 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/lib/test_emulate_step.c b

[PATCH 1/3] powerpc/sstep: Introduce GETTYPE macro

2018-05-20 Thread Ravi Bangoria
Replace 'op->type & INSTR_TYPE_MASK' expression with GETTYPE(op->type) macro. Signed-off-by: Ravi Bangoria --- arch/powerpc/include/asm/sstep.h | 2 ++ arch/powerpc/kernel/align.c | 2 +- arch/powerpc/lib/sstep.c | 6 +++--- 3 files changed, 6 insertions(+), 4 deletion

[PATCH 0/3] powerpc/sstep: Fix kernel crash if VSX is not present

2018-05-20 Thread Ravi Bangoria
a new macro to simplify code a bit. 2nd patch fixes the kernel crash when VSX is not supported or disabled. 3rd patch fixes emulate_step() tests Ravi Bangoria (3): powerpc/sstep: Introduce GETTYPE macro powerpc/sstep: Fix kernel crash if VSX is not present powerpc/sstep: Fix emulate_step

[PATCH 2/3] powerpc/sstep: Fix kernel crash if VSX is not present

2018-05-20 Thread Ravi Bangoria
Reported-by: Michael Ellerman Signed-off-by: Ravi Bangoria --- arch/powerpc/lib/sstep.c | 9 + 1 file changed, 9 insertions(+) diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c index db6bba259d91..23b7ddf04521 100644 --- a/arch/powerpc/lib/sstep.c +++ b/arch/powerpc/lib

[PATCH] perf test powerpc: Fix 'Object code reading' test

2017-08-31 Thread Ravi Bangoria
e elf sections") in binutils. 2. When the sample is from hypervisor. Hypervisor symbols can not be resolved within guest and thus thread__find_addr_map() fails for such symbols. Fix this by ignoring hypervisor symbols in the test. Signed-off-by: Ravi Bangoria --- tools/perf/tests/code-reading.c |

[PATCH v2] perf test powerpc: Fix 'Object code reading' test

2017-08-31 Thread Ravi Bangoria
e elf sections") in binutils. 2. When the sample is from hypervisor. Hypervisor symbols can not be resolved within guest and thus thread__find_addr_map() fails for such symbols. Fix this by ignoring hypervisor symbols in the test. Signed-off-by: Ravi Bangoria --- Changes in v2: - Ad

[PATCH] perf record: Fix tool crash with xyarray

2017-10-18 Thread Ravi Bangoria
)[0x7f7fd8571830] ./perf(_start+0x29)[0x427a59] This is because functions xyarray__max_x() and xyarray__max_y() are returning incorrect values, causing crash while accessing xyarray. Fixes: d74be4767367 ("perf xyarray: Save max_x, max_y") Signed-off-by: Ravi Bangoria --- tools/perf/util

[PATCH v2] perf callchain: Compare dsos (as well) for CCKEY_FUNCTION

2017-10-05 Thread Ravi Bangoria
Signed-off-by: Ravi Bangoria --- Changes in v2: - Remove unnecessary checks for 'map' tools/perf/util/callchain.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/perf/util/callchain.c b/tools/perf/util/callchain.c index be09d77..a971caf 100644 --- a/tools/perf

[RFC] perf callchain: Compare dsos (as well) for CCKEY_FUNCTION

2017-10-04 Thread Ravi Bangoria
Signed-off-by: Ravi Bangoria --- tools/perf/util/callchain.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/perf/util/callchain.c b/tools/perf/util/callchain.c index 510b513..6d5a483 100644 --- a/tools/perf/util/callchain.c +++ b/tools/perf/util/callchain.c

[PATCH] perf callchain: Compare dsos (as well) for CCKEY_FUNCTION

2017-10-04 Thread Ravi Bangoria
Signed-off-by: Ravi Bangoria --- tools/perf/util/callchain.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/perf/util/callchain.c b/tools/perf/util/callchain.c index be09d77..6d7f645 100644 --- a/tools/perf/util/callchain.c +++ b/tools/perf/util/callchain.c

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 [2018-01-06 11:12:46]: > >> Recently, how the pointers being printed with %p has been changed >> by commit ad67b74d2469 ("printk: hash addresses printed with %p"). >> This is causing

Re: [PATCH] powerpc/perf: Dereference bhrb entries safely

2017-12-18 Thread Ravi Bangoria
Hi Balbir, Sorry was away for few days. On 12/14/2017 05:54 PM, Balbir Singh wrote: > On Tue, Dec 12, 2017 at 11:29 PM, Ravi Bangoria > wrote: >> It may very well happen that branch instructions recorded by >> bhrb entries already get unmapped before they get processed by &g

[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 --- 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 100644 --- a/kernel/trace/trace_uprobe.c ++

Re: [PATCH v4] Use more flexible pattern matching for CPU identification for mapfile.csv

2017-12-04 Thread Ravi Bangoria
of various distibutions of Linux having to > wait for a new release of the kernel's perf tool to be built with > these trivial patches is inconvenient. > Tested-by: Ravi Bangoria Thanks, Ravi

[PATCH] perf tool: Fix build failure when NO_AUXTRACE=1

2017-11-12 Thread Ravi Bangoria
^ Fix it by guarding function under HAVE_AUXTRACE_SUPPORT. Fixes: 47e5a26a916b ("perf script: Fix --per-event-dump for auxtrace synth evsels") Signed-off-by: Ravi Bangoria --- tools/perf/builtin-script.c | 4 1 file changed, 4

Re: [PATCH 16/35] perf annotate: Add samples into struct annotation_line

2017-11-13 Thread Ravi Bangoria
Hi Jiri, This patch seems to be causing segfault with "perf top --stdio". Steps to reproduce: 1. start "perf top --stdio" in one terminal 2. run some simple workload in another terminal, let it get finished. 3. annotate function from previous workload in perf top (press 'a' followed by 's')

[PATCH] perf annotate: Remove precision for mnemonics

2017-11-13 Thread Ravi Bangoria
,-1 xscvdp vs1,vs1 add. r10,r10,r11 After: li r11,-1 xscvdpsxds vs1,vs1 add. r10,r10,r11 Reported-by: Donald Stence Signed-off-by: Ravi Bangoria --- tools/perf/util/annotate.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tools/perf/u

Re: [PATCH 16/35] perf annotate: Add samples into struct annotation_line

2017-11-14 Thread Ravi Bangoria
Hi Jiri, On 11/14/2017 03:01 PM, Jiri Olsa wrote: On Mon, Nov 13, 2017 at 09:14:38PM +0100, Jiri Olsa wrote: On Mon, Nov 13, 2017 at 09:16:20PM +0530, Ravi Bangoria wrote: Hi Jiri, This patch seems to be causing segfault with "perf top --stdio". Steps to reproduce: 1. start

[PATCH] powerpc/sysrq: Fix oops whem ppmu is not registered

2017-09-19 Thread Ravi Bangoria
x6c Signed-off-by: Ravi Bangoria Reviewed-by: Kamalesh Babulal --- arch/powerpc/perf/core-book3s.c | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/powerpc/perf/core-book3s.c b/arch/powerpc/perf/core-book3s.c index 2e3eb74..9e3da16 100644 --- a/arch/powerpc/perf/core-book3s.c ++

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

[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
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 --- 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
bb99d8 )) 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/trace/trace_uprobe.c b/ke

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

[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

[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: Rewrite fil

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

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 wrote: > >> User can remove files from cache using --remove/--purge options >> but both needs list of files as an argument. It's not convenient >> when y

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

2018-04-16 Thread Ravi Bangoria
-by: Ravi Bangoria --- 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-buildid-cache.txt b/tools/perf/Documentation

[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 Reviewed-by: Masami Hiramatsu

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

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

2018-04-16 Thread Ravi Bangoria
From: 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

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

2018-04-16 Thread Ravi Bangoria
From: 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

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

2018-04-16 Thread Ravi Bangoria
From: 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

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

2018-04-16 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 v3 7/9] trace_uprobe/sdt: Fix multiple update of same reference counter

2018-04-16 Thread Ravi Bangoria
From: Ravi Bangoria 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 addition of size of all elf sections

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

2018-04-16 Thread Ravi Bangoria
From: Ravi Bangoria 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 ... Semaphore: 0x10020036 # ./perf

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

2018-04-16 Thread Ravi Bangoria
From: Ravi Bangoria 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 Defined Tracepoints (USDT). Document usage

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

2018-04-16 Thread Ravi Bangoria
From: Ravi Bangoria 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 in them. These markers are added

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

[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 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 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 wrote: > >> @@ -2054,15 +2060,21 @@ char *synthesize_probe_trace_command(struct >> probe_trace_event *tev) >> } >> >

[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

[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 --- tools/lib/subcmd/parse-options.c

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

2018-04-09 Thread Ravi Bangoria
-by: Ravi Bangoria --- 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-buildid-cache.txt b/tools/perf

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

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 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 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: [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 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 later on? No point in stretching this

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 >> wrote: >>> Simplify probes_seq_show() function. We are using %lx to display >>> the offset and we don't

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 > wrote: >> >> On 02/08/2018 09:13 AM, Ravi Bangoria wrote: >>> Wang, ping :) >>> >>> Kees, I don't hear back from Wang and no one has reported any issues wi

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

[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

[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
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 --- kernel/trace/trace_uprobe.c | 105 ++-- 1 file changed, 102 in

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

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

2018-02-06 Thread Ravi Bangoria
uprobe_events p:probe_a/main /tmp/a.out:0x0594 After patch: # echo "p:probe_a/main /tmp/a.out:0x594" > uprobe_events # cat uprobe_events p:probe_a/main /tmp/a.out:0x594 Fixes: 0e4d819d0893 ("trace_uprobe: Display correct offset in uprobe_events") Suggeste

[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 --- kernel/trace/trace_uprobe.c | 21 +++-- 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/kernel/trace

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

[PATCH] perf probe: Fix build failure for get_target_map()

2017-07-17 Thread Ravi Bangoria
x it by changing parameters of get_target_map(). Fixes: 801bc8193463 ("perf probe: Allow placing uprobes in alternate namespaces.") Signed-off-by: Ravi Bangoria --- tools/perf/arch/powerpc/util/sym-handling.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/

Re: [PATCH] perf/annotate: Fix branch instruction with multiple operands

2017-06-01 Thread Ravi Bangoria
linux]$ git log | grep -i originally-by: | wc -l > 58 > [acme@jouet linux]$ > > Originally-by: Ravi Bangoria > > Ravi? > > I'm trying to catch up on my patch queue, so haven't read this > thoroughly to have an idea if this is fair or OK, can you guys comment > on

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