[PATCH v7 4/7] perf util: Link stream pair

2020-09-20 Thread Jin Yao
which streams are matched. Signed-off-by: Jin Yao --- v7: - Rename functions with 'stream__' prefix. v6: - Rebase to perf/core v5: - Remove enum stream_type v4: - New patch in v4. tools/perf/util/stream.c | 40 tools/perf/uti

[PATCH v7 7/7] perf diff: Support hot streams comparison

2020-09-20 Thread Jin Yao
main div.c:44 main div.c:42 compute_flag div.c:28 Signed-off-by: Jin Yao --- v7: - Use new struct evlist_streams in data__file. - Free the streams in data__free. v6: - Rebase to perf/core v5:

[PATCH v7 6/7] perf util: Report hot streams

2020-09-20 Thread Jin Yao
e, cycles: 2, hits: 4.08% -- main div.c:42 compute_flag div.c:28 Signed-off-by: Jin Yao --- v7: - Rename functions with 'evsel_streams__' prefix v6: - Rebase to perf/core v5: - Rebase to perf/core v4: - Remove "Hot chains in

[PATCH v7 0/7] perf: Stream comparison

2020-09-20 Thread Jin Yao
factor the code in a generic way. v3: --- v2 has 14 patches, it's hard to review. v3 is only 7 patches for basic stream comparison. Jin Yao (7): perf util: Create streams perf util: Get the evsel_streams by evsel_idx perf util: Compare two streams perf util: Link stream pair per

[PATCH v7 5/7] perf util: Calculate the sum of total streams hits

2020-09-20 Thread Jin Yao
We have used callchain_node->hit to measure the hot level of one stream. This patch calculates the sum of hits of total streams. Thus in next patch, we can use following formula to report hot percent for one stream. hot percent = callchain_node->hit / sum of total hits Signed-off-by: J

[PATCH v7 2/7] perf util: Get the evsel_streams by evsel_idx

2020-09-20 Thread Jin Yao
In previous patch, we have created evsel_streams array This patch returns the specified evsel_streams according to the evsel_idx. Signed-off-by: Jin Yao --- v7: - Rename functions: evsel_streams__entry v6: - Rebase to perf/core v5: - Rebase to perf/core v4: - Rename

[PATCH v7 3/7] perf util: Compare two streams

2020-09-20 Thread Jin Yao
x27;t consider the case that source code is changed). The matching logic is, compare the chain string first. If it's not matched, fallback to dso address comparison. Signed-off-by: Jin Yao --- v7: - No change v6: - Rebase to perf/core v5: - Remove enum stream_type - Rebase to perf

[PATCH v7 1/7] perf util: Create streams

2020-09-20 Thread Jin Yao
ams array per event, and saves the top N hottest streams in a stream array. So now we can get the per-event top N hottest streams. Signed-off-by: Jin Yao --- v7: - Create a new struct evlist_streams. - Rename functions with appropriate prefix v6: - Rebase to perf/core

Re: [PATCH v6 7/7] perf diff: Support hot streams comparison

2020-09-18 Thread Jin, Yao
Hi Arnaldo, On 9/18/2020 4:26 AM, Arnaldo Carvalho de Melo wrote: Em Fri, Sep 11, 2020 at 04:03:53PM +0800, Jin Yao escreveu: This patch enables perf-diff with "--stream" option. "--stream": Enable hot streams comparison Now let's see examples. perf record -b ...

Re: [PATCH v6 7/7] perf diff: Support hot streams comparison

2020-09-17 Thread Jin, Yao
Hi Arnaldo, On 9/18/2020 4:26 AM, Arnaldo Carvalho de Melo wrote: Em Fri, Sep 11, 2020 at 04:03:53PM +0800, Jin Yao escreveu: This patch enables perf-diff with "--stream" option. "--stream": Enable hot streams comparison Now let's see examples. perf record -b ...

Re: [PATCH v6 0/7] perf: Stream comparison

2020-09-17 Thread Jin, Yao
Hi Arnaldo, On 9/18/2020 4:13 AM, Arnaldo Carvalho de Melo wrote: Em Thu, Sep 17, 2020 at 03:05:56PM +0200, Jiri Olsa escreveu: On Fri, Sep 11, 2020 at 04:03:46PM +0800, Jin Yao wrote: SNIP main div.c:40 main div.c:40 main

Re: [PATCH 0/2] Update CascadelakeX and SkylakeX events list

2020-09-17 Thread Jin, Yao
Hi Ian, On 9/18/2020 9:36 AM, Ian Rogers wrote: On Thu, Sep 17, 2020, 6:21 PM Jin, Yao wrote: Hi Arnaldo, On 9/7/2020 4:01 PM, Jin, Yao wrote: Hi Arnaldo, On 7/17/2020 2:06 PM, Jin, Yao wrote: Hi, On 6/17/2020 3:38 AM, Arnaldo Carvalho de Melo wrote: Em Tue, Jun 16, 2020 at 02:27:40PM

Re: [PATCH 0/2] Update CascadelakeX and SkylakeX events list

2020-09-17 Thread Jin, Yao
Hi Arnaldo, On 9/7/2020 4:01 PM, Jin, Yao wrote: Hi Arnaldo, On 7/17/2020 2:06 PM, Jin, Yao wrote: Hi, On 6/17/2020 3:38 AM, Arnaldo Carvalho de Melo wrote: Em Tue, Jun 16, 2020 at 02:27:40PM +0800, Jin, Yao escreveu: On 6/16/2020 2:16 PM, Ian Rogers wrote: On Mon, Jun 15, 2020 at 6:00 PM

[PATCH v6 2/7] perf util: Get the evsel_streams by evsel_idx

2020-09-11 Thread Jin Yao
In previous patch, we have created evsel_streams array This patch returns the specified evsel_streams according to the evsel_idx. Signed-off-by: Jin Yao --- v6: - Rebase to perf/core v5: - Rebase to perf/core v4: - Rename the patch from 'perf util: Return per-event call

[PATCH v6 0/7] perf: Stream comparison

2020-09-11 Thread Jin Yao
urce line based comparison. Now we only supports the basic functionality of stream comparison. 2. Refactor the code in a generic way. v3: --- v2 has 14 patches, it's hard to review. v3 is only 7 patches for basic stream comparison. Jin Yao (7): perf util: Create streams perf util: Get

[PATCH v6 1/7] perf util: Create streams

2020-09-11 Thread Jin Yao
ams array per event, and saves the top N hottest streams in a stream array. So now we can get the per-event top N hottest streams. Signed-off-by: Jin Yao --- v6: - Rebase to perf/core v5: - Remove enum stram_type - Rebase to perf/core v4: - Refactor the code - Rename patch n

[PATCH v6 5/7] perf util: Calculate the sum of total streams hits

2020-09-11 Thread Jin Yao
We have used callchain_node->hit to measure the hot level of one stream. This patch calculates the sum of hits of total streams. Thus in next patch, we can use following formula to report hot percent for one stream. hot percent = callchain_node->hit / sum of total hits Signed-off-by: J

[PATCH v6 3/7] perf util: Compare two streams

2020-09-11 Thread Jin Yao
x27;t consider the case that source code is changed). The matching logic is, compare the chain string first. If it's not matched, fallback to dso address comparison. Signed-off-by: Jin Yao --- v6: - Rebase to perf/core v5: - Remove enum stream_type - Rebase to perf/core v4: - Remov

[PATCH v6 7/7] perf diff: Support hot streams comparison

2020-09-11 Thread Jin Yao
main div.c:44 main div.c:42 compute_flag div.c:28 Signed-off-by: Jin Yao --- v6: - Rebase to perf/core v5: - Remove enum stream_type - Rebase to perf/core v4: - Remove the "--before" a

[PATCH v6 6/7] perf util: Report hot streams

2020-09-11 Thread Jin Yao
e, cycles: 2, hits: 4.08% -- main div.c:42 compute_flag div.c:28 Signed-off-by: Jin Yao --- v6: - Rebase to perf/core v5: - Rebase to perf/core v4: - Remove "Hot chains in old perf data but source line changed in new perf data&q

[PATCH v6 4/7] perf util: Link stream pair

2020-09-11 Thread Jin Yao
which streams are matched. Signed-off-by: Jin Yao --- v6: - Rebase to perf/core v5: - Remove enum stream_type v4: - New patch in v4. tools/perf/util/stream.c | 40 tools/perf/util/stream.h | 4 2 files changed, 44 insertions(+) diff

Re: [PATCH v5 0/7] perf: Stream comparison

2020-09-10 Thread Jin, Yao
Hi Jiri, On 9/10/2020 5:22 PM, Jiri Olsa wrote: On Mon, Sep 07, 2020 at 12:15:59PM +0800, Jin Yao wrote: SNIP main div.c:39 [ Hot streams in new perf data only ] hot chain 1: cycles: 4, hits: 4.54

Re: [PATCH 0/2] Update CascadelakeX and SkylakeX events list

2020-09-07 Thread Jin, Yao
Hi Arnaldo, On 7/17/2020 2:06 PM, Jin, Yao wrote: Hi, On 6/17/2020 3:38 AM, Arnaldo Carvalho de Melo wrote: Em Tue, Jun 16, 2020 at 02:27:40PM +0800, Jin, Yao escreveu: On 6/16/2020 2:16 PM, Ian Rogers wrote: On Mon, Jun 15, 2020 at 6:00 PM Jin, Yao wrote: Can I get an ACK for this

[PATCH v5 3/7] perf util: Compare two streams

2020-09-06 Thread Jin Yao
x27;t consider the case that source code is changed). The matching logic is, compare the chain string first. If it's not matched, fallback to dso address comparison. Signed-off-by: Jin Yao --- v5: - Remove enum stream_type - Rebase to perf/core v4: - Remove original source line compa

[PATCH v5 7/7] perf diff: Support hot streams comparison

2020-09-06 Thread Jin Yao
main div.c:44 main div.c:42 compute_flag div.c:28 Signed-off-by: Jin Yao --- v5: - Remove enum stream_type - Rebase to perf/core v4: - Remove the "--before" and "--after" opti

[PATCH v5 1/7] perf util: Create streams

2020-09-06 Thread Jin Yao
ams array per event, and saves the top N hottest streams in a stream array. So now we can get the per-event top N hottest streams. Signed-off-by: Jin Yao --- v5: - Remove enum stram_type - Rebase to perf/core v4: - Refactor the code - Rename patch name from 'perf util: Create

[PATCH v5 6/7] perf util: Report hot streams

2020-09-06 Thread Jin Yao
e, cycles: 2, hits: 4.08% -- main div.c:42 compute_flag div.c:28 Signed-off-by: Jin Yao --- v5: - Rebase to perf/core v4: - Remove "Hot chains in old perf data but source line changed in new perf data" tools/perf/util/callchain.c

[PATCH v5 5/7] perf util: Calculate the sum of total streams hits

2020-09-06 Thread Jin Yao
We have used callchain_node->hit to measure the hot level of one stream. This patch calculates the sum of hits of total streams. Thus in next patch, we can use following formula to report hot percent for one stream. hot percent = callchain_node->hit / sum of total hits Signed-off-by: J

[PATCH v5 0/7] perf: Stream comparison

2020-09-06 Thread Jin Yao
only supports the basic functionality of stream comparison. 2. Refactor the code in a generic way. v3: --- v2 has 14 patches, it's hard to review. v3 is only 7 patches for basic stream comparison. Jin Yao (7): perf util: Create streams perf util: Get the evsel_streams by evsel_idx

[PATCH v5 4/7] perf util: Link stream pair

2020-09-06 Thread Jin Yao
which streams are matched. Signed-off-by: Jin Yao --- v5: - Remove enum stream_type v4: - New patch in v4. tools/perf/util/stream.c | 40 tools/perf/util/stream.h | 4 2 files changed, 44 insertions(+) diff --git a/tools/perf/util/stream.c

[PATCH v5 2/7] perf util: Get the evsel_streams by evsel_idx

2020-09-06 Thread Jin Yao
In previous patch, we have created evsel_streams array This patch returns the specified evsel_streams according to the evsel_idx. Signed-off-by: Jin Yao --- v5: - Rebase to perf/core v4: - Rename the patch from 'perf util: Return per-event callchain streams' to 'per

[PATCH] perf stat: Turn off summary for interval mode by default

2020-09-02 Thread Jin Yao
6124542 seconds time elapsed Fixes: c7e5b328a8d4 ("perf stat: Report summary for interval mode") Signed-off-by: Jin Yao --- tools/perf/Documentation/perf-stat.txt | 3 +++ tools/perf/builtin-stat.c | 8 +--- tools/perf/util/stat.h | 1 + 3 files changed, 9 inse

Re: [PATCH v4 1/7] perf util: Create streams

2020-09-02 Thread Jin, Yao
Hi Jiri, On 9/2/2020 4:09 AM, Jiri Olsa wrote: On Tue, Sep 01, 2020 at 10:26:25AM +0800, Jin, Yao wrote: Hi Jiri, On 8/31/2020 9:56 PM, Jiri Olsa wrote: On Tue, Aug 25, 2020 at 07:35:07AM +0800, Jin Yao wrote: SNIP + int nr_streams_max

Re: [PATCH v4 1/7] perf util: Create streams

2020-08-31 Thread Jin, Yao
Hi Jiri, On 8/31/2020 9:56 PM, Jiri Olsa wrote: On Tue, Aug 25, 2020 at 07:35:07AM +0800, Jin Yao wrote: SNIP + int nr_streams_max, + enum stream_type type) +{ + struct evsel_streams *es

Re: [PATCH v3] perf parse-events: Set exclude_guest=1 for user-space counting

2020-08-25 Thread Jin, Yao
Hi Arnaldo, On 8/19/2020 11:05 AM, Like Xu wrote: Hi Arnaldo, On 2020/8/17 10:32, Jin, Yao wrote: Hi Arnaldo, On 8/14/2020 8:47 PM, Arnaldo Carvalho de Melo wrote: Em Fri, Aug 14, 2020 at 09:21:20AM +0800, Jin Yao escreveu: Currently if we run 'perf record -e cycles:u', exclu

[PATCH v4 5/7] perf util: Calculate the sum of total streams hits

2020-08-25 Thread Jin Yao
We have used callchain_node->hit to measure the hot level of one stream. This patch calculates the sum of hits of total streams. Thus in next patch, we can use following formula to report hot percent for one stream. hot percent = callchain_node->hit / sum of total hits Signed-off-by: J

[PATCH v4 7/7] perf diff: Support hot streams comparison

2020-08-25 Thread Jin Yao
main div.c:44 main div.c:42 compute_flag div.c:28 Signed-off-by: Jin Yao --- v4: - Remove the "--before" and "--after" options since they are for source line based comparison. In t

[PATCH v4 4/7] perf util: Link stream pair

2020-08-25 Thread Jin Yao
which streams are matched. Signed-off-by: Jin Yao --- v4: - New patch in v4. tools/perf/util/stream.c | 53 tools/perf/util/stream.h | 4 +++ 2 files changed, 57 insertions(+) diff --git a/tools/perf/util/stream.c b/tools/perf/util/stream.c index

[PATCH v4 3/7] perf util: Compare two streams

2020-08-25 Thread Jin Yao
x27;t consider the case that source code is changed). The matching logic is, compare the chain string first. If it's not matched, fallback to dso address comparison. Signed-off-by: Jin Yao --- v4: - Remove original source line comparison code. tools/perf/util/callch

[PATCH v4 1/7] perf util: Create streams

2020-08-25 Thread Jin Yao
ams array per event, and saves the top N hottest streams in a stream array. So now we can get the per-event top N hottest streams. Signed-off-by: Jin Yao --- v4: - Refactor the code - Rename patch name from 'perf util: Create streams for managing top N hottest callchains'

[PATCH v4 6/7] perf util: Report hot streams

2020-08-25 Thread Jin Yao
e, cycles: 2, hits: 4.08% -- main div.c:42 compute_flag div.c:28 Signed-off-by: Jin Yao --- v4: - Remove "Hot chains in old perf data but source line changed in new perf data" tools/perf/util/callchain.c | 13 tools/perf/util/callc

[PATCH v4 0/7] perf: Stream comparison

2020-08-25 Thread Jin Yao
2. Refactor the code in a generic way. v3: --- v2 has 14 patches, it's hard to review. v3 is only 7 patches for basic stream comparison. Jin Yao (7): perf util: Create streams perf util: Get the evsel_streams by evsel_idx perf util: Compare two streams perf util: Link stream pair

[PATCH v4 2/7] perf util: Get the evsel_streams by evsel_idx

2020-08-25 Thread Jin Yao
In previous patch, we have created evsel_streams array This patch returns the specified evsel_streams according to the evsel_idx. Signed-off-by: Jin Yao --- v4: - Rename the patch from 'perf util: Return per-event callchain streams' to 'perf util: Get the evsel_strea

Re: [PATCH v3] perf parse-events: Set exclude_guest=1 for user-space counting

2020-08-16 Thread Jin, Yao
Hi Arnaldo, On 8/14/2020 8:47 PM, Arnaldo Carvalho de Melo wrote: Em Fri, Aug 14, 2020 at 09:21:20AM +0800, Jin Yao escreveu: Currently if we run 'perf record -e cycles:u', exclude_guest=0. But it doesn't make sense in most cases that we request for user-space counting but

[PATCH v3] perf parse-events: Set exclude_guest=1 for user-space counting

2020-08-13 Thread Jin Yao
1 For Before/After, exclude_guest are both 0 for perf kvm usage. perf test 6 6: Parse event definition strings : Ok Signed-off-by: Jin Yao --- v3: --- For perf kvm, if we have 'exclude_guest=1', we can't get guest events. So we don't set 'exclude_gue

[PATCH v2] perf parse-events: Set exclude_guest for user-space counting

2020-08-13 Thread Jin Yao
Signed-off-by: Jin Yao --- v2: --- Fix the 'perf test 6' failure. tools/perf/tests/parse-events.c | 4 ++-- tools/perf/util/parse-events.c | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/perf/tests/parse-events.c b/tools/perf/tests/parse-events.c index 7

Re: [PATCH] perf parse-events: Set exclude_guest for user-space counting

2020-08-13 Thread Jin, Yao
On 8/13/2020 2:57 PM, Like Xu wrote: Hi Yao, On 2020/8/13 11:11, Jin, Yao wrote: Hi Like, On 8/12/2020 9:02 PM, Like Xu wrote: On 2020/8/12 20:15, Arnaldo Carvalho de Melo wrote: Em Wed, Aug 12, 2020 at 02:59:53PM +0800, Jin Yao escreveu: Currently if we run 'perf record -e cyc

Re: [PATCH] perf parse-events: Set exclude_guest for user-space counting

2020-08-12 Thread Jin, Yao
Hi Arnaldo, On 8/12/2020 8:55 PM, Arnaldo Carvalho de Melo wrote: Em Wed, Aug 12, 2020 at 09:15:04AM -0300, Arnaldo Carvalho de Melo escreveu: Em Wed, Aug 12, 2020 at 02:59:53PM +0800, Jin Yao escreveu: Currently if we run 'perf record -e cycles:u', exclude_guest is 0. But it do

Re: [PATCH] perf parse-events: Set exclude_guest for user-space counting

2020-08-12 Thread Jin, Yao
Hi Like, On 8/12/2020 9:02 PM, Like Xu wrote: On 2020/8/12 20:15, Arnaldo Carvalho de Melo wrote: Em Wed, Aug 12, 2020 at 02:59:53PM +0800, Jin Yao escreveu: Currently if we run 'perf record -e cycles:u', exclude_guest is 0. But it doesn't make sense that we request for user

[PATCH] perf parse-events: Set exclude_guest for user-space counting

2020-08-12 Thread Jin Yao
Currently if we run 'perf record -e cycles:u', exclude_guest is 0. But it doesn't make sense that we request for user-space counting but we also get the guest report. To keep perf semantics consistent and clear, this patch sets exclude_guest for user-space counting. Signed-

Re: [PATCH v1 2/2] perf/core: Fake regs for leaked kernel samples

2020-08-11 Thread Jin, Yao
Hi Peter, On 8/11/2020 4:45 PM, Peter Zijlstra wrote: On Tue, Aug 11, 2020 at 04:31:10PM +0800, Jin, Yao wrote: Hi Peter, On 8/11/2020 3:59 PM, Peter Zijlstra wrote: On Tue, Aug 11, 2020 at 03:50:43PM +0800, Jin, Yao wrote: Could I post v2 which basically refers to your patch but removes

Re: [PATCH v1 2/2] perf/core: Fake regs for leaked kernel samples

2020-08-11 Thread Jin, Yao
Hi Peter, On 8/11/2020 3:59 PM, Peter Zijlstra wrote: On Tue, Aug 11, 2020 at 03:50:43PM +0800, Jin, Yao wrote: Could I post v2 which basically refers to your patch but removes some conditions since I see some issues in test if we use these conditions. 1. Remove '!event->attr.ex

Re: [PATCH v1 2/2] perf/core: Fake regs for leaked kernel samples

2020-08-11 Thread Jin, Yao
Hi Peter, On 8/6/2020 10:26 AM, Jin, Yao wrote: Hi Peter, On 8/5/2020 8:44 PM, pet...@infradead.org wrote: On Wed, Aug 05, 2020 at 10:15:26AM +0800, Jin, Yao wrote: Hi Peter, On 8/4/2020 7:49 PM, pet...@infradead.org wrote: On Fri, Jul 31, 2020 at 10:56:17AM +0800, Jin Yao wrote

Re: [PATCH v1 2/2] perf/core: Fake regs for leaked kernel samples

2020-08-09 Thread Jin, Yao
Hi Peter, On 8/7/2020 5:02 PM, pet...@infradead.org wrote: On Fri, Aug 07, 2020 at 02:24:30PM +0800, Jin, Yao wrote: Hi Peter, On 8/6/2020 7:00 PM, pet...@infradead.org wrote: On Thu, Aug 06, 2020 at 11:18:27AM +0200, pet...@infradead.org wrote: Suppose we have nested virt: L0-hv

Re: [PATCH] perf record: Skip side-band event setup if HAVE_LIBBPF_SUPPORT is not set

2020-08-09 Thread Jin, Yao
escreveu: Em Thu, Aug 06, 2020 at 09:43:57PM +0200, Jiri Olsa escreveu: On Wed, Aug 05, 2020 at 10:29:37AM +0800, Jin Yao wrote: We received an error report that perf-record caused 'Segmentation fault' on a newly system (e.g. on the new installed ubuntu). (gdb) backtrace #0 __read_once_

Re: [PATCH] perf record: Skip side-band event setup if HAVE_LIBBPF_SUPPORT is not set

2020-08-06 Thread Jin, Yao
Hi Jiri, On 8/7/2020 3:43 AM, Jiri Olsa wrote: On Wed, Aug 05, 2020 at 10:29:37AM +0800, Jin Yao wrote: We received an error report that perf-record caused 'Segmentation fault' on a newly system (e.g. on the new installed ubuntu). (gdb) backtrace #0 __read_once_size (size=4, re

Re: [PATCH v1 2/2] perf/core: Fake regs for leaked kernel samples

2020-08-06 Thread Jin, Yao
__set_bit(idx, (unsigned long *)&cpuc->intel_ctrl_guest_mask); How can we know it's guest or host even if exclude_host is set in guest? Thanks Jin Yao Also, ARM64 seems to also implement this stuff, Mark, do you have any insight on how all this is 'supposed' to work?

Re: [PATCH v1 2/2] perf/core: Fake regs for leaked kernel samples

2020-08-06 Thread Jin, Yao
Hi Peter, On 8/6/2020 5:24 PM, pet...@infradead.org wrote: On Thu, Aug 06, 2020 at 11:18:27AM +0200, pet...@infradead.org wrote: On Thu, Aug 06, 2020 at 10:26:29AM +0800, Jin, Yao wrote: +static struct pt_regs *sanitize_sample_regs(struct perf_event *event, struct pt_regs *regs

Re: [PATCH v1 2/2] perf/core: Fake regs for leaked kernel samples

2020-08-06 Thread Jin, Yao
Hi Peter, On 8/6/2020 5:18 PM, pet...@infradead.org wrote: On Thu, Aug 06, 2020 at 10:26:29AM +0800, Jin, Yao wrote: +static struct pt_regs *sanitize_sample_regs(struct perf_event *event, struct pt_regs *regs) +{ + struct pt_regs *sample_regs = regs; + + /* user only

Re: [PATCH v1 2/2] perf/core: Fake regs for leaked kernel samples

2020-08-05 Thread Jin, Yao
Hi Peter, On 8/5/2020 8:44 PM, pet...@infradead.org wrote: On Wed, Aug 05, 2020 at 10:15:26AM +0800, Jin, Yao wrote: Hi Peter, On 8/4/2020 7:49 PM, pet...@infradead.org wrote: On Fri, Jul 31, 2020 at 10:56:17AM +0800, Jin Yao wrote: @@ -6973,7 +6973,8 @@ static struct perf_callchain_entry

[PATCH] perf record: Skip side-band event setup if HAVE_LIBBPF_SUPPORT is not set

2020-08-04 Thread Jin Yao
o skip the side-band event setup if HAVE_LIBBPF_SUPPORT is not set. Signed-off-by: Jin Yao --- tools/perf/builtin-record.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index b6bdccd875bc..ae97f98e2753 100644 --- a/tools/pe

Re: [PATCH v1 2/2] perf/core: Fake regs for leaked kernel samples

2020-08-04 Thread Jin, Yao
Hi Peter, On 8/4/2020 7:49 PM, pet...@infradead.org wrote: On Fri, Jul 31, 2020 at 10:56:17AM +0800, Jin Yao wrote: @@ -6973,7 +6973,8 @@ static struct perf_callchain_entry __empty_callchain = { .nr = 0, }; struct perf_callchain_entry * perf_callchain(struct perf_event *event, struct

Re: [PATCH v1 1/2] Missing instruction_pointer_set() instances

2020-08-04 Thread Jin, Yao
Hi Peter, On 8/4/2020 7:31 PM, pet...@infradead.org wrote: On Fri, Jul 31, 2020 at 10:56:16AM +0800, Jin Yao wrote: There is a potential security issue that perf kernel samples may be leaked even though kernel sampling is disabled. For fixing the potential leakage, the idea is to use

[PATCH v1 2/2] perf/core: Fake regs for leaked kernel samples

2020-07-30 Thread Jin Yao
3.97% div div[.] rand@plt 0.00% div ld-2.27.so [.] __GI___tunables_init 0.00% div ld-2.27.so [.] _start Now there is no kernel address leaked. Inspired-by: Mark Rutland Signed-off-by: Jin Yao --- kernel/events/core.c | 48 ++

[PATCH v1 1/2] Missing instruction_pointer_set() instances

2020-07-30 Thread Jin Yao
on some architectures. Define instruction_pointer_set for these architectures. Signed-off-by: Jin Yao --- arch/alpha/include/asm/ptrace.h | 6 ++ arch/arc/include/asm/ptrace.h| 6 ++ arch/nds32/include/asm/ptrace.h | 7 +++ arch/xtensa/include/asm/ptrace.h | 6 ++ 4 files

Re: [PATCH v2] perf evsel: Don't set sample_regs_intr/sample_regs_user for dummy event

2020-07-29 Thread Jin, Yao
Hi Adrian, Could you help to check if following condition will break PT? "(opts->sample_intr_regs && !evsel->no_aux_samples && !evsel__is_dummy_event(evsel))" Thanks Jin Yao On 7/23/2020 9:01 AM, Jin, Yao wrote: Hi Jiri, Adrian, On 7/22/2020 7:08 PM, Jiri O

Re: [PATCHv2 2/2] perf tools: Fix term parsing for raw syntax

2020-07-26 Thread Jin, Yao
On 7/27/2020 8:21 AM, Jin, Yao wrote: On 7/26/2020 3:52 PM, Jiri Olsa wrote: Jin Yao reported issue with possible conflict between raw events and term values in pmu event syntax. Currently following syntax is resolved as raw event with 0xead value:    uncore_imc_free_running/read

Re: [PATCHv2 2/2] perf tools: Fix term parsing for raw syntax

2020-07-26 Thread Jin, Yao
On 7/26/2020 3:52 PM, Jiri Olsa wrote: Jin Yao reported issue with possible conflict between raw events and term values in pmu event syntax. Currently following syntax is resolved as raw event with 0xead value: uncore_imc_free_running/read/ instead of using 'read'

Re: [PATCH v2] perf evsel: Don't set sample_regs_intr/sample_regs_user for dummy event

2020-07-22 Thread Jin, Yao
Hi Jiri, Adrian, On 7/22/2020 7:08 PM, Jiri Olsa wrote: On Wed, Jul 22, 2020 at 01:00:03PM +0800, Jin, Yao wrote: SNIP If we use -IXMM0, the attr>sample_regs_intr will be set with PERF_REG_EXTENDED_MASK bit. It doesn't make sense to set attr->sample_regs_intr for a software

Re: [PATCH v2] perf evsel: Don't set sample_regs_intr/sample_regs_user for dummy event

2020-07-21 Thread Jin, Yao
Hi Jiri, On 7/20/2020 5:17 PM, Jiri Olsa wrote: On Mon, Jul 20, 2020 at 09:00:13AM +0800, Jin Yao wrote: Since commit 0a892c1c9472 ("perf record: Add dummy event during system wide synthesis"), a dummy event is added to capture mmaps. But if we run perf-record as, # perf

[PATCH v2] perf evsel: Don't set sample_regs_intr/sample_regs_user for dummy event

2020-07-19 Thread Jin Yao
p 1 [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.413 MB perf.data (45 samples) ] v2: --- Rebase to perf/core Fixes: 0a892c1c9472 ("perf record: Add dummy event during system wide synthesis") Signed-off-by: Jin Yao --- tools/perf/util/evsel.c

Re: [PATCH] perf evsel: Don't set sample_regs_intr/sample_regs_user for dummy event

2020-07-17 Thread Jin, Yao
On 7/17/2020 4:24 PM, Jiri Olsa wrote: On Fri, Jul 17, 2020 at 11:33:46AM +0800, Jin, Yao wrote: Hi, On 7/6/2020 8:55 AM, Jin, Yao wrote: Hi Ian, On 7/6/2020 8:47 AM, Ian Rogers wrote: On Fri, Jul 3, 2020 at 5:31 PM Jin, Yao wrote: Hi Jiri, On 7/3/2020 7:00 PM, Jiri Olsa wrote: On

Re: [PATCH 0/2] Update CascadelakeX and SkylakeX events list

2020-07-16 Thread Jin, Yao
Hi, On 6/17/2020 3:38 AM, Arnaldo Carvalho de Melo wrote: Em Tue, Jun 16, 2020 at 02:27:40PM +0800, Jin, Yao escreveu: On 6/16/2020 2:16 PM, Ian Rogers wrote: On Mon, Jun 15, 2020 at 6:00 PM Jin, Yao wrote: Can I get an ACK for this patchset? On 6/3/2020 10:18 AM, Jin Yao wrote: This

Re: [PATCH] perf evsel: Don't set sample_regs_intr/sample_regs_user for dummy event

2020-07-16 Thread Jin, Yao
Hi, On 7/6/2020 8:55 AM, Jin, Yao wrote: Hi Ian, On 7/6/2020 8:47 AM, Ian Rogers wrote: On Fri, Jul 3, 2020 at 5:31 PM Jin, Yao wrote: Hi Jiri, On 7/3/2020 7:00 PM, Jiri Olsa wrote: On Fri, Jul 03, 2020 at 08:42:15AM +0800, Jin Yao wrote: Since commit 0a892c1c9472 ("perf record

Re: [PATCH] perf evsel: Don't set sample_regs_intr/sample_regs_user for dummy event

2020-07-05 Thread Jin, Yao
Hi Ian, On 7/6/2020 8:47 AM, Ian Rogers wrote: On Fri, Jul 3, 2020 at 5:31 PM Jin, Yao wrote: Hi Jiri, On 7/3/2020 7:00 PM, Jiri Olsa wrote: On Fri, Jul 03, 2020 at 08:42:15AM +0800, Jin Yao wrote: Since commit 0a892c1c9472 ("perf record: Add dummy event during system wide synthesis

Re: [PATCH] perf evsel: Don't set sample_regs_intr/sample_regs_user for dummy event

2020-07-03 Thread Jin, Yao
Hi Jiri, On 7/3/2020 7:00 PM, Jiri Olsa wrote: On Fri, Jul 03, 2020 at 08:42:15AM +0800, Jin Yao wrote: Since commit 0a892c1c9472 ("perf record: Add dummy event during system wide synthesis"), a dummy event is added to capture mmaps. But if we run perf-record as, # perf record -

[PATCH] perf evsel: Don't set sample_regs_intr/sample_regs_user for dummy event

2020-07-02 Thread Jin Yao
rd: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.413 MB perf.data (45 samples) ] Fixes: 0a892c1c9472 ("perf record: Add dummy event during system wide synthesis") Signed-off-by: Jin Yao --- tools/perf/util/evsel.c | 4 ++-- 1 file changed, 2 insertions(+), 2

Re: [PATCH 0/2] Update CascadelakeX and SkylakeX events list

2020-06-15 Thread Jin, Yao
Hi Ian, Arnaldo, On 6/16/2020 2:16 PM, Ian Rogers wrote: On Mon, Jun 15, 2020 at 6:00 PM Jin, Yao wrote: Hi Andi, Can I get an ACK for this patchset? Thanks Jin Yao On 6/3/2020 10:18 AM, Jin Yao wrote: This patchset updates CascadelakeX events to v1.08 and updates SkylakeX events to

Re: [PATCH 0/2] Update CascadelakeX and SkylakeX events list

2020-06-15 Thread Jin, Yao
Hi Andi, Can I get an ACK for this patchset? Thanks Jin Yao On 6/3/2020 10:18 AM, Jin Yao wrote: This patchset updates CascadelakeX events to v1.08 and updates SkylakeX events to v1.21. The events have been tested on CascadelakeX and SkylakeX servers with latest perf/core branch. Jin Yao (2

[PATCH 0/2] Update CascadelakeX and SkylakeX events list

2020-06-02 Thread Jin Yao
This patchset updates CascadelakeX events to v1.08 and updates SkylakeX events to v1.21. The events have been tested on CascadelakeX and SkylakeX servers with latest perf/core branch. Jin Yao (2): perf vendor events: Update CascadelakeX events to v1.08 perf vendor events: Update SkylakeX

Re: [PATCH v2 1/2] perf evlist: Ensure grouped events with same cpu map

2020-05-27 Thread Jin, Yao
Hi Jiri, On 5/28/2020 12:28 AM, Jiri Olsa wrote: On Wed, May 27, 2020 at 09:49:11PM +0800, Jin, Yao wrote: Hi Jiri, On 5/27/2020 6:28 PM, Jiri Olsa wrote: On Wed, May 27, 2020 at 02:31:03PM +0800, Jin, Yao wrote: SNIP Thanks Jin Yao Issue is found! It looks we can't set "p

Re: [PATCH v2 1/2] perf evlist: Ensure grouped events with same cpu map

2020-05-27 Thread Jin, Yao
Hi Jiri, On 5/27/2020 6:28 PM, Jiri Olsa wrote: On Wed, May 27, 2020 at 02:31:03PM +0800, Jin, Yao wrote: SNIP Thanks Jin Yao Issue is found! It looks we can't set "pos->leader = pos" in either for_each_group_member() or in for_each_group_evsel() because it may

Re: [PATCH v2 1/2] perf evlist: Ensure grouped events with same cpu map

2020-05-27 Thread Jin, Yao
Hi Jiri, On 5/27/2020 2:31 PM, Jin, Yao wrote: Hi Jiri, On 5/27/2020 11:20 AM, Jin, Yao wrote: Hi Jiri, On 5/26/2020 7:51 PM, Jiri Olsa wrote: On Mon, May 25, 2020 at 02:55:58PM +0800, Jin Yao wrote: SNIP diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index 2a9de6491700

Re: [PATCH v2 1/2] perf evlist: Ensure grouped events with same cpu map

2020-05-26 Thread Jin, Yao
Hi Jiri, On 5/27/2020 11:20 AM, Jin, Yao wrote: Hi Jiri, On 5/26/2020 7:51 PM, Jiri Olsa wrote: On Mon, May 25, 2020 at 02:55:58PM +0800, Jin Yao wrote: SNIP diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index 2a9de6491700..1161cffc0688 100644 --- a/tools/perf/util

Re: [PATCH v2 1/2] perf evlist: Ensure grouped events with same cpu map

2020-05-26 Thread Jin, Yao
Hi Jiri, On 5/26/2020 7:51 PM, Jiri Olsa wrote: On Mon, May 25, 2020 at 02:55:58PM +0800, Jin Yao wrote: SNIP diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index 2a9de6491700..1161cffc0688 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c @@ -1704,3

[PATCH v4 7/7] perf diff: Support hot streams comparison

2020-05-25 Thread Jin Yao
main div.c:44 main div.c:42 compute_flag div.c:28 Signed-off-by: Jin Yao --- tools/perf/Documentation/perf-diff.txt | 4 + tools/perf/builtin-diff.c | 133 ++--- 2 files chang

[PATCH v4 2/7] perf util: Get the evsel_streams by evsel_idx

2020-05-25 Thread Jin Yao
In previous patch, we have created evsel_streams array This patch returns the specified evsel_streams according to the evsel_idx. Signed-off-by: Jin Yao --- tools/perf/util/stream.c | 11 +++ tools/perf/util/stream.h | 3 +++ 2 files changed, 14 insertions(+) diff --git a/tools/perf

[PATCH v4 6/7] perf util: Report hot streams

2020-05-25 Thread Jin Yao
e, cycles: 2, hits: 4.08% -- main div.c:42 compute_flag div.c:28 Signed-off-by: Jin Yao --- tools/perf/util/callchain.c | 13 tools/perf/util/callchain.h | 2 + tools/perf/util/stream.c| 125 tools/perf/util

[PATCH v4 0/7] perf: Stream comparison

2020-05-25 Thread Jin Yao
way. v3: --- v2 has 14 patches, it's hard to review. v3 is only 7 patches for basic stream comparison. Jin Yao (7): perf util: Create streams perf util: Get the evsel_streams by evsel_idx perf util: Compare two streams perf util: Link stream pair perf util: Calculate the sum of

[PATCH v4 3/7] perf util: Compare two streams

2020-05-25 Thread Jin Yao
x27;t consider the case that source code is changed). The matching logic is, compare the chain string first. If it's not matched, fallback to dso address comparison. Signed-off-by: Jin Yao --- tools/perf/util/callchain.c | 54 + tools/perf/util/callch

[PATCH v4 5/7] perf util: Calculate the sum of total streams hits

2020-05-25 Thread Jin Yao
We have used callchain_node->hit to measure the hot level of one stream. This patch calculates the sum of hits of total streams. Then in next patch, we can use following formula to report hot percent for one stream. hot percent = callchain_node->hit / sum of total hits Signed-off-by: J

[PATCH v4 4/7] perf util: Link stream pair

2020-05-25 Thread Jin Yao
which streams are matched. Signed-off-by: Jin Yao --- tools/perf/util/stream.c | 53 tools/perf/util/stream.h | 4 +++ 2 files changed, 57 insertions(+) diff --git a/tools/perf/util/stream.c b/tools/perf/util/stream.c index 7f538d1085ef..76896a790798

[PATCH v4 1/7] perf util: Create streams

2020-05-25 Thread Jin Yao
p N hottest streams in a stream array. So now we can get the per-event top N hottest streams. Signed-off-by: Jin Yao --- tools/perf/util/Build| 1 + tools/perf/util/stream.c | 152 +++ tools/perf/util/stream.h | 30 3 files changed, 183 inserti

[PATCH v2 1/2] perf evlist: Ensure grouped events with same cpu map

2020-05-24 Thread Jin Yao
;{A,B}','{C,D,E}',F. Fixes: 6a4bb04caacc8 ("perf tools: Enable grouping logic for parsed events") Signed-off-by: Jin Yao --- tools/perf/builtin-stat.c | 3 +++ tools/perf/util/evlist.c | 49 +++ tools/perf/util/evlist.h | 5

[PATCH v2 2/2] perf test: Add test case for group members

2020-05-24 Thread Jin Yao
The evlist may consist of some event + group combinations. For example, perf stat -e "A,{B,C},D". This patch testes the event in evlist to see if it has the correct leader and correct nr_members. Signed-off-by: Jin Yao --- tools/perf/tests/parse-eve

Re: [PATCH] perf evlist: Ensure grouped events with same cpu map

2020-05-24 Thread Jin, Yao
Hi Jiri, On 5/22/2020 5:53 PM, Jiri Olsa wrote: On Thu, May 21, 2020 at 02:22:40PM +0800, Jin Yao wrote: SNIP --- tools/perf/builtin-stat.c | 3 +++ tools/perf/util/evlist.c | 32 tools/perf/util/evlist.h | 5 + 3 files changed, 40 insertions

[PATCH] perf evlist: Ensure grouped events with same cpu map

2020-05-20 Thread Jin Yao
alid. So when get_group_fd tries to access FD(leader, 1, 0), access violation will happen. This patch ensures that the grouped events with same cpu maps before we go to get_group_fd. If the cpu maps are not matched, we force to disable the group. Fixes: 6a4bb04caacc8 ("perf tools: E

Re: [PATCH] perf evsel: Get group fd from CPU0 for system wide event

2020-05-20 Thread Jin, Yao
Hi Jiri, On 5/20/2020 3:50 PM, Jiri Olsa wrote: On Wed, May 20, 2020 at 01:36:40PM +0800, Jin, Yao wrote: Hi Jiri, On 5/18/2020 11:28 AM, Jin, Yao wrote: Hi Jiri, On 5/15/2020 4:33 PM, Jiri Olsa wrote: On Fri, May 15, 2020 at 02:04:57PM +0800, Jin, Yao wrote: SNIP I think I get the root

Re: [PATCH] perf evsel: Get group fd from CPU0 for system wide event

2020-05-19 Thread Jin, Yao
Hi Jiri, On 5/18/2020 11:28 AM, Jin, Yao wrote: Hi Jiri, On 5/15/2020 4:33 PM, Jiri Olsa wrote: On Fri, May 15, 2020 at 02:04:57PM +0800, Jin, Yao wrote: SNIP I think I get the root cause. That should be a serious bug in get_group_fd, access violation! For a group mixed with system-wide

[PATCH v6 1/5] perf stat: Fix wrong per-thread runtime stat for interval mode

2020-05-19 Thread Jin Yao
83 ("perf stat: Update or print per-thread stats") Signed-off-by: Jin Yao --- tools/perf/builtin-stat.c | 70 +++ 1 file changed, 41 insertions(+), 29 deletions(-) diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index e0c1ad23c768..f

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