Re: [PATCH v4] perf diff: Report noisy for cycles diff
On 8/15/2019 9:23 PM, Jiri Olsa wrote: On Tue, Aug 13, 2019 at 03:30:37PM +0800, Jin Yao wrote: This patch prints the stddev and hist for the cycles diff of program block. It can help us to understand if the cycles is noisy or not. This patch is inspired by Andi Kleen's patch https://lwn.net/Articles/600471/ now that we have sparks support, we could respin it ;-) jirka The sparks can be used in more places for reporting the data noisy. :) Thanks Jin Yao
Re: [PATCH v4] perf diff: Report noisy for cycles diff
On 8/15/2019 9:22 PM, Jiri Olsa wrote: On Tue, Aug 13, 2019 at 03:30:37PM +0800, Jin Yao wrote: SNIP static void hpp__entry_unpair(struct hist_entry *he, int idx, char *buf, size_t size) { @@ -1662,6 +1794,10 @@ static void data__hpp_register(struct data__file *d, int idx) fmt->color = hpp__color_cycles; fmt->sort = hist_entry__cmp_nop; break; + case PERF_HPP_DIFF__CYCLES_HIST: + fmt->color = hpp__color_cycles_hist; + fmt->sort = hist_entry__cmp_nop; + break; default: fmt->sort = hist_entry__cmp_nop; break; @@ -1688,8 +1824,15 @@ static int ui_init(void) * PERF_HPP_DIFF__RATIO * PERF_HPP_DIFF__WEIGHTED_DIFF */ - data__hpp_register(d, i ? compute_2_hpp[compute] : - PERF_HPP_DIFF__BASELINE); + if (cycles_hist && (compute == COMPUTE_CYCLES)) { + data__hpp_register(d, i ? PERF_HPP_DIFF__CYCLES : + PERF_HPP_DIFF__BASELINE); + data__hpp_register(d, i ? PERF_HPP_DIFF__CYCLES_HIST : + PERF_HPP_DIFF__BASELINE); + } else { + data__hpp_register(d, i ? compute_2_hpp[compute] : + PERF_HPP_DIFF__BASELINE); + } I tink that something like this might be less confusing instead of above: if (cycles_hist && i && (compute == COMPUTE_CYCLES)) data__hpp_register(d, PERF_HPP_DIFF__CYCLES); other than that the patch looks ok to me jirka Yes, your code is more beautiful. Thanks so much! :) Thanks Jin Yao
Re: [PATCH v4] perf diff: Report noisy for cycles diff
On Tue, Aug 13, 2019 at 03:30:37PM +0800, Jin Yao wrote: > This patch prints the stddev and hist for the cycles diff of > program block. It can help us to understand if the cycles > is noisy or not. > > This patch is inspired by Andi Kleen's patch > https://lwn.net/Articles/600471/ now that we have sparks support, we could respin it ;-) jirka
Re: [PATCH v4] perf diff: Report noisy for cycles diff
On Tue, Aug 13, 2019 at 03:30:37PM +0800, Jin Yao wrote: SNIP > static void > hpp__entry_unpair(struct hist_entry *he, int idx, char *buf, size_t size) > { > @@ -1662,6 +1794,10 @@ static void data__hpp_register(struct data__file *d, > int idx) > fmt->color = hpp__color_cycles; > fmt->sort = hist_entry__cmp_nop; > break; > + case PERF_HPP_DIFF__CYCLES_HIST: > + fmt->color = hpp__color_cycles_hist; > + fmt->sort = hist_entry__cmp_nop; > + break; > default: > fmt->sort = hist_entry__cmp_nop; > break; > @@ -1688,8 +1824,15 @@ static int ui_init(void) >* PERF_HPP_DIFF__RATIO >* PERF_HPP_DIFF__WEIGHTED_DIFF >*/ > - data__hpp_register(d, i ? compute_2_hpp[compute] : > - PERF_HPP_DIFF__BASELINE); > + if (cycles_hist && (compute == COMPUTE_CYCLES)) { > + data__hpp_register(d, i ? PERF_HPP_DIFF__CYCLES : > + PERF_HPP_DIFF__BASELINE); > + data__hpp_register(d, i ? PERF_HPP_DIFF__CYCLES_HIST : > + PERF_HPP_DIFF__BASELINE); > + } else { > + data__hpp_register(d, i ? compute_2_hpp[compute] : > + PERF_HPP_DIFF__BASELINE); > + } I tink that something like this might be less confusing instead of above: if (cycles_hist && i && (compute == COMPUTE_CYCLES)) data__hpp_register(d, PERF_HPP_DIFF__CYCLES); other than that the patch looks ok to me jirka