Re: [PATCH v6 4/7] perf annotate: Do not ignore call instruction with indirect target

2016-09-20 Thread Ravi Bangoria
Hi Arnaldo, On Monday 19 September 2016 09:14 PM, Arnaldo Carvalho de Melo wrote: > Em Fri, Aug 19, 2016 at 06:29:35PM +0530, Ravi Bangoria escreveu: >> Do not ignore call instruction with indirect target when its already >> identified as a call. This is an extension of comm

[PATCH v7 0/6] perf annotate: Cross arch support + few fixes

2016-09-21 Thread Ravi Bangoria
016/8/19/411 Kim, I don't have arm test machine. Can you please help me to test this on arm. Kim Phillips (1): perf annotate: cross arch annotate support fixes for ARM Naveen N. Rao (1): perf annotate: Add support for powerpc Ravi Bangoria (4): perf annotate: Add cross arch annotate s

[PATCH v7 1/6] perf annotate: Add cross arch annotate support

2016-09-21 Thread Ravi Bangoria
recorded. Record on arm: $ ./perf record -a Report -> Annotate on x86: $ ./perf report -i perf.data.arm --vmlinux vmlinux.arm Signed-off-by: Ravi Bangoria --- Changes in v7: - Make norm_arch as global var instead of passing them to each parser. - Address other review comments. tools/p

[PATCH v7 4/6] perf annotate: Support jump instruction with target as second operand

2016-09-21 Thread Ravi Bangoria
stdr9,1032(r31) 74:ld r9,88(r31) After patch: ld r9,1032(r31) cmpdi cr7,r9,0 v bne74 ld r9,2312(r30) stdr9,1032(r31) 74:ld r9,88(r31) Signed-off-by: Ravi Bangoria --- Changes in v7: - Added example in d

[PATCH v7 2/6] perf annotate: Add support for powerpc

2016-09-21 Thread Ravi Bangoria
ears to be error-prone. So, add function to find instruction instead of creating table. This function dynamically create table (list of 'struct ins'), and instead of creating object every time, first check if list already contain object for that instruction. Signed-off-by: Naveen N. Rao

[PATCH v7 5/6] perf annotate: Fix jump target outside of function address range

2016-09-21 Thread Ravi Bangoria
nop 10:mov_DYNAMIC+0x2e8,%rax movl -bashx16,%fs:(%rax) mov-bashxffff,%eax retq Signed-off-by: Ravi Bangoria --- Changes in v7: - No changes tools/perf/ui/browsers/annotate.c | 5 +++-- tools/perf/util/annotate.c| 14 +- to

[PATCH v7 3/6] perf annotate: Show raw form for jump instruction with indirect target

2016-09-21 Thread Ravi Bangoria
ca2c stdr2,24(r1) addis r12,r2,-1 After: ld r12,32088(r12) mtctr r12 v bctr stdr2,24(r1) addis r12,r2,-1 Suggested-by: Michael Ellerman Signed-off-by: Ravi Bangoria --- Changes in v7: - Added example in description tools/perf/util/annotate.c | 3

[PATCH v7 6/6] perf annotate: cross arch annotate support fixes for ARM

2016-09-21 Thread Ravi Bangoria
From: Kim Phillips For ARM we remove the list that contains non-arm insns, and instead add more maintainable branch instruction regex logic. Signed-off-by: Kim Phillips Signed-off-by: Ravi Bangoria --- Changes in v7: - Little bit change in initializing instruction list. tools/perf/util

Re: [PATCH v7 0/6] perf annotate: Cross arch support + few fixes

2016-09-21 Thread Ravi Bangoria
On Thursday 22 September 2016 01:04 AM, Kim Phillips wrote: > On Wed, 21 Sep 2016 21:17:50 +0530 > Ravi Bangoria wrote: > >> Kim, I don't have arm test machine. Can you please help me to test >> this on arm. > This works for me: hitting return on return instru

Re: [PATCH v7 0/6] perf annotate: Cross arch support + few fixes

2016-09-27 Thread Ravi Bangoria
Hello, Any updates? Arnaldo, if patches looks good to you, can you please pickup them. -Ravi On Wednesday 21 September 2016 09:17 PM, Ravi Bangoria wrote: > Currently Perf annotate support code navigation (branches and calls) > only when run on the same architecture where perf.da

[RFC] perf uprobe: Skip prologue if program compiled without optimization

2016-07-28 Thread Ravi Bangoria
perf script test 6300 [001] 5877.879327: probe_test:foo: (400541) i=42 No need to skip prologue for optimized case since debug info is correct for each instructions for -O2 -g. For more details please visit: https://bugzilla.redhat.com/show_bug.cgi?id=612253#c6 Signed-off-by: Ravi Bangor

[PATCH] perf uprobe: Skip prologue if program compiled without optimization

2016-08-01 Thread Ravi Bangoria
perf script test 6300 [001] 5877.879327: probe_test:foo: (400541) i=42 No need to skip prologue for optimized case since debug info is correct for each instructions for -O2 -g. For more details please visit: https://bugzilla.redhat.com/show_bug.cgi?id=612253#c6 Signed-off-by: Ravi Bangoria ---

Re: [RFC] perf uprobe: Skip prologue if program compiled without optimization

2016-08-01 Thread Ravi Bangoria
On Saturday 30 July 2016 08:34 AM, Masami Hiramatsu wrote: On Thu, 28 Jul 2016 20:01:51 +0530 Ravi Bangoria wrote: Function prologue prepares stack and registers before executing function logic. When target program is compiled without optimization, function parameter information is only

Re: [PATCH] perf/powerpc: Fix build-test failure

2016-09-07 Thread Ravi Bangoria
Hi Arnaldo, Can you please pick up this. -Ravi On Wednesday 31 August 2016 01:33 PM, Ravi Bangoria wrote: > 'make -C tools/perf build-test' is failing with below log for poewrpc. > > In file included from > /tmp/tmp.3eEwmGlYaF/perf-4.8.0-rc4/tools/perf/perf.h:15:0, >

Re: [PATCH v6 0/7] perf: Cross arch annotate + few miscellaneous fixes

2016-09-07 Thread Ravi Bangoria
Hello, Any update on this? -Ravi On Friday 19 August 2016 06:29 PM, Ravi Bangoria wrote: > Currently Perf annotate support code navigation (branches and calls) > only when run on the same architecture where perf.data was recorded. > But, for example, record on powerpc server and an

[PATCH] perf/powerpc: Fix build-test failure

2016-08-31 Thread Ravi Bangoria
n includes 'uapi/asm/unistd.h' for powerpc. Don't know how exactly this happened as this change is not part of commit also. Signed-off-by: Ravi Bangoria --- tools/perf/perf-sys.h | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/perf/perf-sys.h b/tools/perf/perf-sys.h index 7e

[PATCH 2/2] perf ppc64le: Fix probe location when using DWARF

2016-08-08 Thread Ravi Bangoria
60904 filename_string=+0(%gpr4):string $ sudo ./perf record -a -e probe:do_sys_open ls [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.197 MB perf.data (11 samples) ] Signed-off-by: Ravi Bangoria --- tools/perf/arch/powerpc/util/sym-handling.c | 27 +++

[PATCH 1/2] perf: Add function to post process kernel trace events

2016-08-08 Thread Ravi Bangoria
Instead of inline code, introduce function to post process kernel probe trace events. Signed-off-by: Ravi Bangoria --- tools/perf/util/probe-event.c | 29 ++--- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/tools/perf/util/probe-event.c b/tools/perf

Re: [PATCH v6 2/7] perf annotate: Add cross arch annotate support

2016-08-26 Thread Ravi Bangoria
Hi Kim, I've tested your patch on x86 and powerpc and it looks fine to me. Can you please put your signed-off-by. Please add Act-by: Ravi Bangoria as well. Regards, -Ravi On Wednesday 24 August 2016 02:06 AM, Kim Phillips wrote: > On Tue, 23 Aug 2016 11:17:16 +0900 > Namhyung

[RFC] perf tool: Fix memory corruption because of zero length symbols

2017-10-24 Thread Ravi Bangoria
Here, when 'addr' is same as 'sym->start', 'offset' becomes 0, which is valid for normal symbols but *invalid* for zero length symbols and thus updating h->addr[offset] causes memory corruption. Fix this by adding one dummy element for zero length symbols. Fix

[PATCH] perf probe: Restrict user to use only one executable with -V

2017-10-26 Thread Ravi Bangoria
fun @ int arg Signed-off-by: Ravi Bangoria --- tools/perf/util/probe-event.c | 5 + 1 file changed, 5 insertions(+) diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c index b7aaf9b..0e04015 100644 --- a/tools/perf/util/probe-even

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

2017-11-12 Thread Ravi Bangoria
ce_info 0 ^ 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 c

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

[PATCH] perf annotate: Remove precision for mnemonics

2017-11-13 Thread Ravi Bangoria
li r11,-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

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] perf record: Fix tool crash with xyarray

2017-10-18 Thread Ravi Bangoria
start_main+0xf0)[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 ---

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

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

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

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

[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

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

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

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

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

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

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

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

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

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

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

2018-08-08 Thread Ravi Bangoria
hronization. So we are referring 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 ++-- ke

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

[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

[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

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

2018-08-08 Thread Ravi Bangoria
;: 3 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

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

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 in

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) >>>> +{ >>>> + i

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'

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(&delayed_uprobe_lock); > + list_for_each_safe(pos, q, &delayed_uprobe_l

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

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-20 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 main(i

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

2018-08-22 Thread Ravi Bangoria
gt; forward. 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 > > S

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

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

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

[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

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

2018-07-30 Thread Ravi Bangoria
hronization. So we are referring 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 ++-- ke

[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

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

2018-07-30 Thread Ravi Bangoria
ick: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 Ravi Bangoria (6): Uprobes: Simplify uprobe_register() body Uprobe: Additional argument arch_upr

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

2018-07-30 Thread Ravi Bangoria
y does 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

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

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

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

2018-07-23 Thread Ravi Bangoria
t; > > 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 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/built

[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 --- 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/tools/perf/.gitignore @@ -31,5 +31,6

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

2018-01-29 Thread Ravi Bangoria
998b70, 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 --- tools/perf/builtin-trace.c | 5

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

[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 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 --- tools/perf/arch/powerpc/Makefile | 21 + .../perf/arch/powerpc/entry/syscalls/mksyscalltbl | 35

[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 --- tools/arch/powerpc/include/uapi/asm/unistd.h | 399 +++ tools/perf/check-headers.sh | 1 + 2 files changed, 400 insertions(+) create mode 100644

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

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: 0xa

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

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

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

[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

[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
a.out (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 ---

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 no

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

[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
referring it as 'reference counter' in kernel / perf code. 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_inf

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

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

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