Re: [PATCH] perf: allow specifying proc-map-timeout in config file

2018-12-04 Thread Song Liu
ase our default value. This patch permits setting a > different default with the core.proc-map-timeout config file parameter. > > Signed-off-by: Mark Drayton Looks good to me. Acked-by: Song Liu > --- > tools/perf/Documentation/perf-config.txt | 6 + > tools/perf/b

[PATCH v2 perf,bpf 3/3] perf util: basic handling of PERF_RECORD_BPF_EVENT

2018-12-04 Thread Song Liu
This patch adds basic handling of PERF_RECORD_BPF_EVENT in perf util. Future patches add more logic that leverages these events. Signed-off-by: Song Liu --- tools/perf/util/event.c | 22 ++ tools/perf/util/event.h | 26 ++ tools/perf/util/evsel.c

Re: perf tools: remove option --tail-synthesize ?

2018-11-22 Thread Song Liu
> On Nov 21, 2018, at 5:50 PM, Wangnan (F) wrote: > > > > On 2018/11/21 21:11, Arnaldo Carvalho de Melo wrote: >> Em Wed, Nov 21, 2018 at 07:45:28AM +, Song Liu escreveu: >>> Hi, >>> >>> I found perf-record --tail-synthesize without --ov

Re: perf tools: remove option --tail-synthesize ?

2018-11-21 Thread Song Liu
> On Nov 21, 2018, at 2:47 AM, Jiri Olsa wrote: > > On Wed, Nov 21, 2018 at 07:45:28AM +0000, Song Liu wrote: >> Hi, >> >> I found perf-record --tail-synthesize without --overwrite breaks symbols >> for perf-script, perf-report, etc. For example: >>

perf tools: remove option --tail-synthesize ?

2018-11-20 Thread Song Liu
Hi, I found perf-record --tail-synthesize without --overwrite breaks symbols for perf-script, perf-report, etc. For example: [root@]# ~/perf record -ag --tail-synthesize -- sleep 1 [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 1.129 MB perf.data (3531 samples)

Re: [PATCH v14 1/3]: perf util: map data buffer for preserving collected data

2018-11-01 Thread Song Liu
On Sun, Oct 14, 2018 at 11:44 PM Alexey Budankov wrote: > > > The map->data buffer is used to preserve map->base profiling data > for writing to disk. AIO map->cblock is used to queue corresponding > map->data buffer for asynchronous writing. > > Signed-off-by:

Re: [PATCH v14 2/3]: perf record: enable asynchronous trace writing

2018-11-01 Thread Song Liu
@@ record__switch_output(struct record *rec, bool at_exit) > /* Same Size: "2015122520103046"*/ > char timestamp[] = "InvalidTimestamp"; > > + record__aio_mmap_read_sync(rec); > + > record__synthesize(rec, true); > if (target__none(>opts.target)) > record__synthesize_workload(rec, true); > @@ -1157,6 +1357,8 @@ static int __cmd_record(struct record *rec, int argc, > const char **argv) > record__synthesize_workload(rec, true); > > out_child: > + record__aio_mmap_read_sync(rec); > + > if (forks) { > int exit_status; > > @@ -1681,6 +1883,11 @@ static struct option __record_options[] = { > "signal"), > OPT_BOOLEAN(0, "dry-run", _run, > "Parse options then exit"), > +#ifdef HAVE_AIO_SUPPORT > + OPT_CALLBACK_NOOPT(0, "aio", , > +NULL, "Enable asynchronous trace writing mode", > +record__aio_parse), > +#endif > OPT_END() > }; > > @@ -1873,6 +2080,9 @@ int cmd_record(int argc, const char **argv) > goto out; > } > > + if (verbose > 0) > + pr_info("nr_cblocks: %d\n", rec->opts.nr_cblocks); > + nit: I guess we don't really need this pr_info()? Other than this, Acked-by: Song Liu

Re: [PATCH v14 3/3]: perf record: extend trace writing to multi AIO

2018-11-01 Thread Song Liu
"Parse options then exit"), > #ifdef HAVE_AIO_SUPPORT > - OPT_CALLBACK_NOOPT(0, "aio", , > -NULL, "Enable asynchronous trace writing mode", > + OPT_CALLBACK_OPTARG(0, "aio", , > +_cblocks_default, "n", "Use control blocks in > asynchronous trace writing mode (default: 1, max: 4)", > record__aio_parse), > #endif > OPT_END() > @@ -2080,6 +2112,8 @@ int cmd_record(int argc, const char **argv) > goto out; > } > > + if (rec->opts.nr_cblocks > 4) > + rec->opts.nr_cblocks = 4; nit: I feel this logic belongs to record__aio_parse(). And we should have static int nr_cblocks_max = 4; Other than this Acked-by: Song Liu

Re: [RFC][PATCH] perf: Rewrite core context handling

2018-10-23 Thread Song Liu
Hi Peter, > On Oct 10, 2018, at 3:45 AM, Peter Zijlstra wrote: > > Hi all, > > There have been various issues and limitations with the way perf uses > (task) contexts to track events. Most notable is the single hardware PMU > task context, which has resulted in a number of yucky things (both >

Re: [RFC][PATCH] perf: Rewrite core context handling

2018-10-17 Thread Song Liu
> On Oct 17, 2018, at 11:33 AM, Peter Zijlstra wrote: > > On Wed, Oct 17, 2018 at 07:19:55PM +0200, Peter Zijlstra wrote: >> On Wed, Oct 17, 2018 at 04:43:27PM +, Song Liu wrote: >> >>>> That makes task and cpu contexts wildly different, which wi

Re: [RFC][PATCH] perf: Rewrite core context handling

2018-10-17 Thread Song Liu
> On Oct 17, 2018, at 4:06 AM, Peter Zijlstra wrote: > > On Tue, Oct 16, 2018 at 06:28:10PM +0000, Song Liu wrote: >>> How about this: >>> >>> 1. Keep multiple perf_cpu_context per CPU, just like before this patch. >>> >>> 2. For p

Re: [RFC][PATCH] perf: Rewrite core context handling

2018-10-16 Thread Song Liu
Hi Peter, > On Oct 15, 2018, at 3:09 PM, Song Liu wrote: > > > >> On Oct 15, 2018, at 1:34 AM, Peter Zijlstra wrote: >> >> On Mon, Oct 15, 2018 at 10:26:06AM +0300, Alexey Budankov wrote: >>> Hi, >>> >>> On 10.10.2018 13:45, Pete

Re: [RFC][PATCH] perf: Rewrite core context handling

2018-10-16 Thread Song Liu
> On Oct 16, 2018, at 11:10 AM, Peter Zijlstra wrote: > > On Tue, Oct 16, 2018 at 04:34:05PM +0000, Song Liu wrote: >>>> 3. perf_event_pmu_context owns RB tree of events. Since we don't >>>> need rotation across multiple hardware PMUs, t

Re: [RFC][PATCH] perf: Rewrite core context handling

2018-10-16 Thread Song Liu
> On Oct 16, 2018, at 2:50 AM, Peter Zijlstra wrote: > > On Sat, Oct 13, 2018 at 08:31:37AM +0000, Song Liu wrote: > >> The only suggestion I have right now is on which struct owns which >> data: >> >> 1. perf_cpu_context owns two p

Re: [RFC][PATCH] perf: Rewrite core context handling

2018-10-15 Thread Song Liu
> On Oct 15, 2018, at 1:34 AM, Peter Zijlstra wrote: > > On Mon, Oct 15, 2018 at 10:26:06AM +0300, Alexey Budankov wrote: >> Hi, >> >> On 10.10.2018 13:45, Peter Zijlstra wrote: >>> Hi all, >>> >>> There have been various issues and limitations with the way perf uses >>> (task) contexts to

Re: [RFC][PATCH] perf: Rewrite core context handling

2018-10-13 Thread Song Liu
> On Oct 12, 2018, at 2:50 AM, Peter Zijlstra wrote: > > > Can we please not top-post? > > On Thu, Oct 11, 2018 at 10:37:14PM +, Song Liu wrote: >> Thanks Peter! These are really really helpful. >> >> I am trying to think through the case of a gro

Re: [RFC][PATCH] perf: Rewrite core context handling

2018-10-11 Thread Song Liu
a wrote: > > On Thu, Oct 11, 2018 at 07:50:23AM +, Song Liu wrote: >> Hi Peter, >> >> I am trying to understand this. Pardon me if any question is silly. >> >> I am not sure I fully understand the motivation here. I guess we >> see problem whe

Re: [RFC][PATCH] perf: Rewrite core context handling

2018-10-11 Thread Song Liu
Hi Peter, I am trying to understand this. Pardon me if any question is silly. I am not sure I fully understand the motivation here. I guess we see problem when there are two (or more) independent hardware PMUs per cpu? Then on a given cpu, there are two (or more) perf_cpu_context, but only

Re: [PATCH] selftests: bpf: install script with_addr.sh

2018-10-10 Thread Song Liu
r.sh gets installed, add it to > TEST_PROGS_EXTENDED variable. > > Fixes: 50b3ed57dee9 ("selftests/bpf: test bpf flow dissection") > Signed-off-by: Anders Roxell Acked-by: Song Liu > --- > tools/testing/selftests/bpf/Makefile | 2 ++ > 1 file changed, 2 insertions(+) > >

Re: [PATCH 1/2] bpftool: Allow to add compiler flags via EXTRA_CFLAGS variable

2018-10-08 Thread Song Liu
On Mon, Oct 8, 2018 at 1:24 AM Jiri Olsa wrote: > > Adding EXTRA_CFLAGS allowing user to specify extra flags > for CFLAGS variable. > > Signed-off-by: Jiri Olsa Acked-by: Song Liu > --- > tools/bpf/bpftool/Makefile | 4 > 1 file changed, 4 insertions(+) > >

Re: [PATCH v2 RESEND] trace_uprobe: support reference counter in fd-based uprobe

2018-10-04 Thread Song Liu
> On Oct 2, 2018, at 1:12 AM, Peter Zijlstra wrote: > > On Mon, Oct 01, 2018 at 10:36:36PM -0700, Song Liu wrote: >> Changes v1 -> v2: Fix PMU_FORMAT_ATTR as Peter suggested >> >> This patch enables uprobes with reference counter in fd-ba

[PATCH/RFC v4 1/2] perf: Sharing PMU counters across compatible events

2018-10-03 Thread Song Liu
vent_dup. Cc: Tejun Heo Cc: Peter Zijlstra Cc: Jiri Olsa Signed-off-by: Song Liu --- include/linux/perf_event.h | 61 kernel/events/core.c | 294 ++--- 2 files changed, 332 insertions(+), 23 deletions(-) diff --git a/include/linux/perf_event.h

[PATCH/RFC v4 2/2] perf tools: monitoring per task counter with per cgroup event

2018-10-03 Thread Song Liu
. Alternatively, we can also create a mechanism in the kernel that is very similar to cgroup perf events. I am also open to other suggestions. Signed-off-by: Song Liu Cc: Tejun Heo Cc: Peter Zijlstra Cc: Jiri Olsa --- tools/perf/builtin-stat.c | 26 ++ tools/perf/util/cgroup.c | 76

[PATCH/RFC v4 0/2] perf: Sharing PMU counters across compatible events

2018-10-03 Thread Song Liu
s virtual master event. The virtual master event does require careful handling. But it is makes the logic of event add/del cleaner. Cc: Tejun Heo Cc: Peter Zijlstra Cc: Jiri Olsa Song Liu (2): perf: Sharing PMU counters across compatible events perf tools: monitoring per task counter with p

[PATCH v2 RESEND] trace_uprobe: support reference counter in fd-based uprobe

2018-10-01 Thread Song Liu
mat/ is updated to reflect this new feature. Signed-off-by: Song Liu Reviewed-and-tested-by: Ravi Bangoria Cc: Oleg Nesterov Cc: Steven Rostedt (VMware) Cc: Peter Zijlstra --- include/linux/trace_events.h| 3 +- kernel/events/core.c| 49 ++--- ker

Re: [PATCH v3 1/1] perf: Sharing PMU counters across compatible events

2018-10-01 Thread Song Liu
> On Sep 27, 2018, at 9:53 PM, Song Liu wrote: > > Hi Ravi, > >> On Sep 27, 2018, at 9:33 PM, Ravi Bangoria >> wrote: >> >> Hi Song, >> >> On 09/25/2018 03:55 AM, Song Liu wrote: >>> This patch tries to enable PMU sharing. To

[PATCH v2] trace_uprobe: support reference counter in fd-based uprobe

2018-09-28 Thread Song Liu
mat/ is updated to reflect this new feature. Signed-off-by: Song Liu Reviewed-and-tested-by: Ravi Bangoria Cc: Masami Hiramatsu Cc: Oleg Nesterov Cc: Srikar Dronamraju Cc: Naveen N. Rao Cc: Steven Rostedt (VMware) Cc: Peter Zijlstra --- include/linux/trace_events.h| 3 +- kernel/eve

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

2018-09-28 Thread Song Liu
> On Sep 28, 2018, at 12:52 AM, Peter Zijlstra wrote: > > On Fri, Sep 28, 2018 at 07:23:20AM +0000, Song Liu wrote: >> Hi Peter, >>> #ifdef CONFIG_UPROBE_EVENTS >>> +PMU_FORMAT_ATTR(ref_ctr_offset, "config:63-24"); >> >> I guess

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

2018-09-28 Thread Song Liu
Hi Peter, > On Sep 24, 2018, at 2:12 PM, Song Liu wrote: > > This patch enables uprobes with reference counter in fd-based uprobe. > Highest 40 bits of perf_event_attr.config is used to stored offset > of the reference counter (semaphore). > > Format information in

Re: [PATCH v3 1/1] perf: Sharing PMU counters across compatible events

2018-09-27 Thread Song Liu
Hi Ravi, > On Sep 27, 2018, at 9:33 PM, Ravi Bangoria > wrote: > > 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

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

2018-09-25 Thread Song Liu
gt; > [auto build test ERROR on tip/perf/core] > [also build test ERROR on v4.19-rc5 next-20180925] > [if your patch is applied to the wrong git tree, please drop us a note to > help improve the system] > > url: > https://github.com/0day-ci/linux/commits/Song-Liu/trace_uprob

Re: [PATCH bpf-next 2/9] bpf: rework cgroup storage pointer passing

2018-09-25 Thread Song Liu
_cgroup_storage structure, instead of > a pointer to the actual buffer. > > It will help us to handle per-cpu storage later, which has > a different way of accessing to the actual data. > > Signed-off-by: Roman Gushchin > Cc: Daniel Borkmann > Cc: Alexei Starovoitov Acke

[PATCH v3 0/1] perf: Sharing PMU counters across compatible events

2018-09-24 Thread Song Liu
cases. This version introduces virtual master event. The virtual master event does require careful handling. But it is makes the logic of event add/del cleaner. Cc: Tejun Heo Cc: Peter Zijlstra Cc: Jiri Olsa Cc: Alexey Budankov Song Liu (1): perf: Sharing PMU counters across compatible

[PATCH v3 1/1] perf: Sharing PMU counters across compatible events

2018-09-24 Thread Song Liu
vent_dup. Cc: Tejun Heo Cc: Peter Zijlstra Cc: Jiri Olsa Cc: Alexey Budankov Signed-off-by: Song Liu --- include/linux/perf_event.h | 61 kernel/events/core.c | 281 +++-- 2 files changed, 332 insertions(+), 10 deletions(-) diff --git a/include

[PATCH RESEND] trace_uprobe: support reference counter in fd-based uprobe

2018-09-24 Thread Song Liu
-by: Song Liu Reviewed-and-tested-by: Ravi Bangoria Cc: Masami Hiramatsu Cc: Oleg Nesterov Cc: Srikar Dronamraju Cc: Naveen N. Rao Cc: Steven Rostedt (VMware) --- include/linux/trace_events.h| 3 +- kernel/events/core.c| 49 ++--- kernel/trace

Re: [PATCH v2 1/1] perf: Sharing PMU counters across compatible events

2018-09-11 Thread Song Liu
> On Sep 10, 2018, at 1:15 AM, Jiri Olsa wrote: > > On Thu, Aug 30, 2018 at 06:51:07PM +0000, Song Liu wrote: >> >> >>> On Aug 30, 2018, at 8:18 AM, Jiri Olsa wrote: >>> >>> On Wed, Aug 15, 2018 at 10:03:13AM -0700, Song Liu wrote: >>&

Re: [PATCH v2 1/1] perf: Sharing PMU counters across compatible events

2018-09-11 Thread Song Liu
> On Sep 10, 2018, at 1:13 AM, Jiri Olsa wrote: > > On Thu, Aug 30, 2018 at 06:35:37PM +0000, Song Liu wrote: >> >> >>> On Aug 30, 2018, at 8:13 AM, Jiri Olsa wrote: >>> >>> On Wed, Aug 15, 2018 at 10:03:13AM -0700, Song Liu wrote: >&g

Re: [PATCH v2 1/1] perf: Sharing PMU counters across compatible events

2018-08-30 Thread Song Liu
> On Aug 30, 2018, at 8:18 AM, Jiri Olsa wrote: > > On Wed, Aug 15, 2018 at 10:03:13AM -0700, Song Liu wrote: > > SNIP > >> @@ -6100,7 +6333,7 @@ static void perf_output_read_group(struct >> perf_output_handle *handle, >> >> if (

Re: [PATCH v2 1/1] perf: Sharing PMU counters across compatible events

2018-08-30 Thread Song Liu
> On Aug 30, 2018, at 8:13 AM, Jiri Olsa wrote: > > On Wed, Aug 15, 2018 at 10:03:13AM -0700, Song Liu wrote: > > SNIP > >> >> +perf_event_remove_dup(event, ctx); >> /* >> * We can have double detach due to exit/hot-unplug +

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

2018-08-28 Thread Song Liu
Hi all, What's our plan with this work? Will this be routed via Steven's tree? Thanks, Song On Wed, Aug 22, 2018 at 5:39 AM Srikar Dronamraju wrote: > > * Ravi Bangoria [2018-08-20 10:12:47]: > > > Userspace Statically Defined Tracepoints[1] are dtrace style markers > > inside userspace

Re: [PATCH v9 2/4] Uprobes/sdt: Prevent multiple reference counter for same uprobe

2018-08-21 Thread Song Liu
On Sun, Aug 19, 2018 at 10:54 PM, Song Liu wrote: > On Sun, Aug 19, 2018 at 9:42 PM, Ravi Bangoria > wrote: >> 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 referen

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

2018-08-21 Thread Song Liu
On Sun, Aug 19, 2018 at 10:53 PM, Song Liu wrote: > On Sun, Aug 19, 2018 at 9:42 PM, Ravi Bangoria > wrote: >> Userspace Statically Defined Tracepoints[1] are dtrace style markers >> inside userspace applications. Applications like PostgreSQL, MySQL, >> Pthread, Perl, Pyt

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

2018-08-21 Thread Song Liu
/tick': > 3 sdt_tick:loop2 >2.561851452 seconds time elapsed > > Signed-off-by: Ravi Bangoria > Acked-by: Masami Hiramatsu > Acked-by: Srikar Dronamraju Reviewed-and-tested-by: Song Liu > --- > tools/perf/util/probe-event.c | 39 ++

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

2018-08-21 Thread Song Liu
one exception though: > When user is trying to replace the old entry with the new > one, we allow this if the new entry does not conflict with > any other existing entries. > > Signed-off-by: Ravi Bangoria > Acked-by: Srikar Dronamraju > Reviewed-by: Song Liu Reviewed-and-test

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

2018-08-20 Thread Song Liu
On Mon, Aug 20, 2018 at 9:42 PM, Ravi Bangoria wrote: > 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

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

2018-08-20 Thread Song Liu
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(int argc, char *argv[]) { for_uprobe(argc); while (1) { sleep(1);

Re: [PATCH v9 2/4] Uprobes/sdt: Prevent multiple reference counter for same uprobe

2018-08-19 Thread Song Liu
Srikar Dronamraju > Reviewed-by: Oleg Nesterov Reviewed-by: Song Liu > --- > kernel/events/uprobes.c | 19 +++ > 1 file changed, 19 insertions(+) > > diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c > index 35065febcb6c..ecee371a59c7 100644 > --

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

2018-08-19 Thread Song Liu
ation and code. But the > term 'semaphore' is misleading in this context. This is just a counter > used to hold number of tracers tracing on a marker. This is not really > used for any synchronization. So we are calling it a 'reference counter' > in kernel / perf code. > > Signed

[PATCH v2 0/1] perf: Sharing PMU counters across compatible events

2018-08-15 Thread Song Liu
ent does require careful handling. But it is makes the logic of event add/del cleaner. Cc: Tejun Heo Cc: Peter Zijlstra Cc: Jiri Olsa Cc: Alexey Budankov Song Liu (1): perf: Sharing PMU counters across compatible events include/linux/perf_event.h | 61 kernel/events/core.c |

[PATCH v2 1/1] perf: Sharing PMU counters across compatible events

2018-08-15 Thread Song Liu
vent_dup. Cc: Tejun Heo Cc: Peter Zijlstra Cc: Jiri Olsa Cc: Alexey Budankov Signed-off-by: Song Liu --- include/linux/perf_event.h | 61 kernel/events/core.c | 289 +++-- 2 files changed, 340 insertions(+), 10 deletions(-) diff --git a/include

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

2018-08-14 Thread Song Liu
On Mon, Aug 13, 2018 at 9:37 PM, Ravi Bangoria wrote: > 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

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

2018-08-13 Thread Song Liu
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() >> > hook and avoid delayed_uprobe_install() in uprobe_mmap(). >> >> I'm sorry. I didn't get this. > > Sorry for

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

2018-08-13 Thread Song Liu
On Sun, Aug 12, 2018 at 10:47 PM, Ravi Bangoria wrote: > Hi Song, > > On 08/11/2018 01:27 PM, Song Liu wrote: >>> + >>> +static void delayed_uprobe_delete(struct delayed_uprobe *du) >>> +{ >>> + if (!du) >>> + return; >&

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

2018-08-13 Thread Song Liu
On Mon, Aug 13, 2018 at 1:49 AM, Srikar Dronamraju wrote: > * Ravi Bangoria [2018-08-13 13:49:44]: > >> 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 c

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

2018-08-11 Thread Song Liu
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. Song On Wed, Aug 8, 2018 at 9:18 PM, Ravi Bangoria wrote: > We assume to have only one reference counter for one uprobe. > Don't allow user

Re: [PATCH v8 4/6] Uprobes/sdt: Prevent multiple reference counter for same uprobe

2018-08-11 Thread Song Liu
On Wed, Aug 8, 2018 at 9:18 PM, Ravi Bangoria wrote: > 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

Re: [PATCH v8 2/6] Uprobe: Additional argument arch_uprobe to uprobe_write_opcode()

2018-08-11 Thread Song Liu
On Wed, Aug 8, 2018 at 9:18 PM, Ravi Bangoria wrote: > Add addition argument 'arch_uprobe' to uprobe_write_opcode(). > We need this in later set of patches. > > Signed-off-by: Ravi Bangoria Reviewed-by: Song Liu > --- > arch/arm/probes/uprobes/core.c | 2 +- > arch/

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

2018-08-11 Thread Song Liu
On Wed, Aug 8, 2018 at 9:18 PM, Ravi Bangoria wrote: > 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 Reviewed-by: Song Liu > --

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

2018-08-11 Thread Song Liu
On Wed, Aug 8, 2018 at 9:18 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, Node.js, libvirt, QEMU, glib etc > have these markers embedded in

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

2018-08-11 Thread Song Liu
On Fri, Aug 10, 2018 at 12:58 PM, Steven Rostedt wrote: > On Thu, 9 Aug 2018 16:38:28 +0200 > Oleg Nesterov wrote: > >> I need to read this (hopefully final) version carefully. I'll try to do >> this before next Monday. >> > > Monday may be the opening of the merge window (more likely Sunday).

Re: [PATCH] tracing/kprobe: Release kprobe print_fmt properly

2018-07-09 Thread Song Liu
rf_kprobe' PMU") > Signed-off-by: Jiri Olsa Thanks for the fix! Acked-by: Song Liu > --- > kernel/trace/trace_kprobe.c | 6 +- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c > index

Re: [PATCH] perf: Sharing PMU counters across compatible events

2018-06-25 Thread Song Liu
Dear Peter, Could you please share you feedbacks/comments on this work? Thanks, Song On Fri, Jun 8, 2018 at 3:47 PM, 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_ev

[PATCH] perf: Sharing PMU counters across compatible events

2018-06-08 Thread Song Liu
vent_dup. Cc: Tejun Heo Cc: Peter Zijlstra Cc: Jiri Olsa Cc: Alexey Budankov Signed-off-by: Song Liu --- include/linux/perf_event.h | 61 ++ kernel/events/core.c | 284 +++-- 2 files changed, 335 insertions(+), 10 deletions(-) diff -

[PATCH] perf: Sharing PMU counters across compatible events

2018-06-08 Thread Song Liu
cleaner. This version has been stable in my tests. Cc: Tejun Heo Cc: Peter Zijlstra Cc: Jiri Olsa Cc: Alexey Budankov Song Liu (1): perf: Sharing PMU counters across compatible events include/linux/perf_event.h | 61 ++ kernel/events/core.c | 284

Re: [patch 7/8] genirq/affinity: Defer affinity setting if irq chip is busy

2018-06-05 Thread Song Liu
cfe3147b42 ("x86/vector: Simplify vector move cleanup") > Signed-off-by: Thomas Gleixner > Cc: sta...@vger.kernel.org Tested-by: Song Liu > --- > kernel/irq/manage.c | 37 +++-- > 1 file changed, 35 insertions(+), 2 deletions(-) > &g

Re: [patch 6/8] x86/platform/uv: Use apic_ack_irq()

2018-06-05 Thread Song Liu
Tested-by: Song Liu On Mon, Jun 4, 2018 at 8:33 AM, Thomas Gleixner wrote: >

Re: [patch 5/8] x86/ioapic: Use apic_ack_irq()

2018-06-05 Thread Song Liu
Tested-by: Song Liu On Mon, Jun 4, 2018 at 8:33 AM, Thomas Gleixner wrote: >

Re: [patch 4/8] irq_remapping: Use apic_ack_irq()

2018-06-05 Thread Song Liu
Tested-by: Song Liu On Mon, Jun 4, 2018 at 8:33 AM, Thomas Gleixner wrote: >

Re: [patch 3/8] x86/apic: Provide apic_ack_irq()

2018-06-05 Thread Song Liu
. > > Reuse the new function in apic_ack_edge(). > > Preparatory change for the real fix > > Fixes: dccfe3147b42 ("x86/vector: Simplify vector move cleanup") > Signed-off-by: Thomas Gleixner > Cc: sta...@vger.kernel.org Tested-by: Song Liu > --- > arch/x86/i

Re: [patch 2/8] genirq/generic_pending: Do not lose pending affinity update

2018-06-05 Thread Song Liu
t; > Check the return value of irq_do_set_affinity() for -EBUSY, which indicates > a pending cleanup, and rearm the pending move in the irq dexcriptor so it's > tried again when the next interrupt arrives. > > Fixes: 996c591227d9 ("x86/irq: Plug vector cleanup race") > Signed-off-by: Thomas

Re: [patch 1/8] x86/apic/vector: Prevent hlist corruption and leaks

2018-06-05 Thread Song Liu
llow up patches. > > Fixes: 69cde0004a4b ("x86/vector: Use matrix allocator for vector assignment") > Reported-by: Dmitry Safonov <0x7f454...@gmail.com> > Reported-by: Tariq Toukan > Reported-by: Song Liu > Signed-off-by: Thomas Gleixner > Cc: sta...@vger.kernel.org

Re: [PATCH] x86,switch_mm: skip atomic operations for init_mm

2018-06-02 Thread Song Liu
> On Jun 2, 2018, at 1:14 PM, Andy Lutomirski wrote: > > On Fri, Jun 1, 2018 at 10:04 PM Rik van Riel wrote: >> >> On Fri, 2018-06-01 at 20:35 -0700, Andy Lutomirski wrote: >>> On Fri, Jun 1, 2018 at 3:13 PM Rik van Riel wrote: On Fri, 1 Jun 2018 14:21:58 -0700 Andy

Re: [PATCH bpf 2/2] bpf: enforce usage of __aligned_u64 in the UAPI header

2018-05-29 Thread Song Liu
On Sun, May 27, 2018 at 4:28 AM, Eugene Syromiatnikov wrote: > Use __aligned_u64 instead of __u64 everywhere in the UAPI header, > similarly to v4.17-rc1~94^2~58^2 "RDMA: Change all uapi headers to use > __aligned_u64 instead of __u64". > > This commit doesn't change structure layouts, but

Re: WARNING and PANIC in irq_matrix_free

2018-05-29 Thread Song Liu
> On May 29, 2018, at 1:35 AM, Thomas Gleixner wrote: > > On Mon, 28 May 2018, Song Liu wrote: >>> On May 28, 2018, at 1:09 PM, Thomas Gleixner wrote: >>> >>> On Mon, 28 May 2018, Song Liu wrote: >>>> This doesn't fix the issue with bnxt.

Re: WARNING and PANIC in irq_matrix_free

2018-05-28 Thread Song Liu
> On May 28, 2018, at 3:53 AM, Thomas Gleixner wrote: > > On Fri, 25 May 2018, Song Liu wrote: >> On Wed, May 23, 2018 at 1:49 AM, Thomas Gleixner wrote: >>> On Wed, 23 May 2018, Tariq Toukan wrote: >>>> I have your patch merged into my inte

Re: [RFC 2/2] perf: Sharing PMU counters across compatible events

2018-05-28 Thread Song Liu
On May 28, 2018, at 4:24 AM, Peter Zijlstra wrote: > > On Fri, May 04, 2018 at 04:11:02PM -0700, Song Liu wrote: >> On the critical paths, perf_events are added to/removed from the >> active_dup list of the perf_event. The first event added to the list >> will be the ma

Re: [RFC 2/2] perf: Sharing PMU counters across compatible events

2018-05-28 Thread Song Liu
> On May 28, 2018, at 4:15 AM, Peter Zijlstra wrote: > > On Fri, May 04, 2018 at 04:11:02PM -0700, Song Liu wrote: >> Connection among perf_event and perf_event_dup are built with function >> rebuild_event_dup_list(cpuctx). This function is only called when events >>

Re: [PATCH v2] mm/THP: use hugepage_vma_check() in khugepaged_enter_vma_merge()

2018-05-28 Thread Song Liu
> On May 28, 2018, at 3:57 AM, Kirill A. Shutemov wrote: > > On Tue, May 22, 2018 at 12:44:30PM -0700, Song Liu wrote: >> khugepaged_enter_vma_merge() is using a different approach to check >> whether a vma is valid for khugepaged_enter(): >>

[PATCH v3] mm/THP: use hugepage_vma_check() in khugepaged_enter_vma_merge()

2018-05-28 Thread Song Liu
ge(). vma->vm_flags is not yet updated in khugepaged_enter_vma_merge(), so we need to pass the new vm_flags to hugepage_vma_check() through a separate argument. Signed-off-by: Song Liu --- mm/khugepaged.c | 53 - 1 file changed, 24 inse

Re: WARNING and PANIC in irq_matrix_free

2018-05-28 Thread Song Liu
> On May 28, 2018, at 7:27 AM, Thomas Gleixner wrote: > > On Mon, 28 May 2018, Tariq Toukan wrote: >> On 28/05/2018 1:53 PM, Thomas Gleixner wrote: >>> On Fri, 25 May 2018, Song Liu wrote: >>>> On Wed, May 23, 2018 at 1:49 AM, Thomas Gleixner >>

Re: [PATCH v2 net-next] tcp: use data length instead of skb->len in tcp_probe

2018-05-25 Thread Song Liu
> On May 25, 2018, at 3:14 AM, Yafang Shao <laoar.s...@gmail.com> wrote: > > skb->len is meaningless to user. > data length could be more helpful, with which we can easily filter out > the packet without payload. > > Signed-off-by: Yafang Shao <laoar.s.

Re: [PATCH, net-next 2/2] bpf: avoid -Wmaybe-uninitialized warning

2018-05-25 Thread Song Liu
ILD_ID_VALID; > } > > - if (!in_nmi_ctx) { > + if (!work) { > up_read(>mm->mmap_sem); > } else { > work->sem = >mm->mmap_sem; > -- > 2.9.0 > Acked-by: Song Liu <songliubrav...@fb.com>

Re: [PATCH, net-next 1/2] bpf: btf: avoid -Wreturn-type warning

2018-05-25 Thread Song Liu
olve_sink(const struct > btf_verifier_env *env, > !btf_type_is_array(next_type) && > !btf_type_is_struct(next_type); > default: > - BUG_ON(1); > + BUG(); > } > } > > -- > 2.9.0 > Acked-by: Song Liu <songliubrav...@fb.com>

Re: WARNING and PANIC in irq_matrix_free

2018-05-25 Thread Song Liu
Adding Broadcom developers to the thread. Hi Michael, Vasundhara, and Andy, Could you please help look into the case I found? ethtool crashes the system for both net/master and net-next/master. Thanks, Song On Fri, May 25, 2018 at 1:10 PM, Song Liu <liu.song@gmail.com> wrote: > H

Re: WARNING and PANIC in irq_matrix_free

2018-05-25 Thread Song Liu
Hi, We are seeing something probably related. We run ethtool on a system with Broadcom NIC to increase number of combined queues. [root@ ~]# ethtool -l eth0 Channel parameters for eth0: Pre-set maximums: RX: 9 TX: 8 Other: 0

[tip:perf/core] perf/core: Fix bad use of igrab()

2018-05-25 Thread tip-bot for Song Liu
Commit-ID: 9511bce9fe8e5e6c0f923c09243a713eba560141 Gitweb: https://git.kernel.org/tip/9511bce9fe8e5e6c0f923c09243a713eba560141 Author: Song Liu <songliubrav...@fb.com> AuthorDate: Tue, 17 Apr 2018 23:29:07 -0700 Committer: Ingo Molnar <mi...@kernel.org> CommitDate: Fri, 25

[tip:perf/core] perf/core: Fix group scheduling with mixed hw and sw events

2018-05-25 Thread tip-bot for Song Liu
Commit-ID: a1150c202207cc8501bebc45b63c264f91959260 Gitweb: https://git.kernel.org/tip/a1150c202207cc8501bebc45b63c264f91959260 Author: Song Liu <songliubrav...@fb.com> AuthorDate: Thu, 3 May 2018 12:47:16 -0700 Committer: Ingo Molnar <mi...@kernel.org> CommitDate: Fri, 25 Ma

Re: [PATCH net-next] tcp: use data length instead of skb->len in tcp_probe

2018-05-24 Thread Song Liu
> On May 24, 2018, at 5:48 AM, Yafang Shao wrote: > > skb->len is meaningless to user. > data length could be more helpful, with which we can easily filter out > the packet without payload. > > Signed-off-by: Yafang Shao > --- >

Re: [PATCH] perf: fix group with mixed hw and sw events

2018-05-22 Thread Song Liu
Dear Peter, Could you please share your comments on this minor fix? Best, Song > On May 3, 2018, at 12:47 PM, Song Liu <songliubrav...@fb.com> wrote: > > When hw and sw events are mixed in the same group, they are all attached > to the hw perf_event_context. This sometim

Re: [PATCH 2/2] perf/core: fix bad use of igrab in kernel/event/core.c

2018-05-22 Thread Song Liu
> On Apr 18, 2018, at 11:17 PM, Alexander Shishkin > <alexander.shish...@linux.intel.com> wrote: > > On Tue, Apr 17, 2018 at 11:29:07PM -0700, Song Liu wrote: >> As Miklos reported and suggested: >> >> This pattern repeats two times in trace_uprobe.c and

[PATCH v2] mm/THP: use hugepage_vma_check() in khugepaged_enter_vma_merge()

2018-05-22 Thread Song Liu
ge(). vma->vm_flags is not yet updated in khugepaged_enter_vma_merge(), so we need to pass the new vm_flags to hugepage_vma_check() through a separate argument. Signed-off-by: Song Liu <songliubrav...@fb.com> --- mm/khugepaged.c | 26 -- 1 file changed, 12 inserti

Re: [PATCH] mm/THP: use hugepage_vma_check() in khugepaged_enter_vma_merge()

2018-05-22 Thread Song Liu
On May 22, 2018, at 5:13 AM, Michal Hocko <mho...@kernel.org> wrote: > > [CC Kirill] > > On Mon 21-05-18 12:38:53, Song Liu wrote: >> khugepaged_enter_vma_merge() is using a different approach to check >> whether a vma is valid for khugepaged_enter()

[PATCH] mm/THP: use hugepage_vma_check() in khugepaged_enter_vma_merge()

2018-05-21 Thread Song Liu
l not call khugepaged_enter(). This patch fixes these problems by reusing hugepage_vma_check() in khugepaged_enter_vma_merge(). Signed-off-by: Song Liu <songliubrav...@fb.com> --- mm/khugepaged.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/mm/khugepaged.c b

Re: [RFC] mm, THP: Map read-only text segments using large THP pages

2018-05-20 Thread Song Liu
On Thu, May 17, 2018 at 10:31 AM, William Kucharski wrote: > > >> On May 17, 2018, at 9:23 AM, Matthew Wilcox wrote: >> >> I'm certain it is. The other thing I believe is true that we should be >> able to share page tables (my motivation is

[RFC 2/2] perf: Sharing PMU counters across compatible events

2018-05-04 Thread Song Liu
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 cpuctx, to remember all the duplicated events under this cpuctx. All the events under this cpuctx has a "dup_id" pointing to its

[RFC 0/2] perf: Sharing PMU counters across compatible events

2018-05-04 Thread Song Liu
direction of PMU counter sharing? Thanks in advance. Song Song Liu (2): perf: add move_dup() for PMU sharing. perf: Sharing PMU counters across compatible events arch/x86/events/core.c | 8 ++ include/linux/perf_event.h | 57 + include/linux/trace_events.h| 3

[RFC 1/2] perf: add move_dup() for PMU sharing.

2018-05-04 Thread Song Liu
To share PMU across different counters, we need a "master event" that handles interaction with hardware or other software parts. It is necessary to switch master event to another event. To make this move compatible with the PMU, it is necessary to move connection or data from one perf_event to

[PATCH] perf: fix group with mixed hw and sw events

2018-05-03 Thread Song Liu
r Zijlstra <pet...@infradead.org> Signed-off-by: Song Liu <songliubrav...@fb.com> --- include/linux/perf_event.h | 8 kernel/events/core.c | 21 +++-- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/include/linux/perf_event.h b/incl

Re: linux-next: manual merge of the bpf-next tree with the bpf tree

2018-05-02 Thread Song Liu
> On May 1, 2018, at 10:50 PM, Stephen Rothwell <s...@canb.auug.org.au> wrote: > > Hi Song, > > On Wed, 2 May 2018 04:40:20 + Song Liu <songliubrav...@fb.com> wrote: >> >>> - CHECK(build_id_matches < 1, "build id match", >

Re: linux-next: manual merge of the bpf-next tree with the bpf tree

2018-05-01 Thread Song Liu
> On May 1, 2018, at 7:09 PM, Stephen Rothwell wrote: > > Hi all, > > Today's linux-next merge of the bpf-next tree got a conflict in: > > tools/testing/selftests/bpf/test_progs.c > > between commit: > > a4e21ff8d9a3 ("bpf: minor fix to selftest

  1   2   3   >