On 11/29/2017 11:16 PM, Jiri Olsa wrote:
On Wed, Nov 29, 2017 at 08:05:47PM +0800, Jin Yao wrote:v3: --- Update according to Jiri's comments. The major modifications are: 1. Fix the crash issue when performing the git bisect. Move the removing of runtime_saved_values to the switching point (perf util: Remove a set of shadow stats static variables). 2. Still add struct perf_stat_config::*stats|stats_num in earlier patch because 'stats' will be used in 'perf util: Update and print per-thread shadow stats'. If it's moved to 'perf stat: Allocate shadow stats buffer for threads', the compilation would be failed.sure, that's why also that hunk from 'perf util: Update and print per-thread shadow stats' needs to be moved to 'perf stat: Allocate shadow stats buffer for threads' this one: + if (stat_config.stats) + stat = &stat_config.stats[thread]; + else + stat = &rt_stat; + + printout(thread, 0, counter, uval, prefix, run, ena, 1.0, + stat); you already did that in 'perf stat: Allocate shadow stats buffer for threads' for: + if (config->aggr_mode == AGGR_THREAD) { + if (config->stats) + perf_stat__update_shadow_stats(evsel, + count->val, 0, &config->stats[thread]); + else + perf_stat__update_shadow_stats(evsel, + count->val, 0, &rt_stat); + } thanks, jirka
OK, I will move this code from 'perf util: Update and print per-thread shadow stats' to 'perf stat: Allocate shadow stats buffer for threads'.
And I will also add struct perf_stat_config::*stats|stats_num in 'perf stat: Allocate shadow stats buffer for threads'.
I will send v4 soon. Thanks Jin Yao

