lkml.org 
[lkml]   [2020]   [Nov]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 04/13 v4] perf tools: Replace aggregation ID with a struct
On Fri, Nov 13, 2020 at 07:26:45PM +0200, James Clark wrote:

SNIP

> @@ -754,7 +766,7 @@ static void print_aggr_thread(struct perf_stat_config *config,
> FILE *output = config->output;
> int nthreads = perf_thread_map__nr(counter->core.threads);
> int ncpus = perf_cpu_map__nr(counter->core.cpus);
> - int thread, sorted_threads, id;
> + int thread, sorted_threads;
> struct perf_aggr_thread_value *buf;
>
> buf = sort_aggr_thread(counter, nthreads, ncpus, &sorted_threads, _target);
> @@ -767,13 +779,12 @@ static void print_aggr_thread(struct perf_stat_config *config,
> if (prefix)
> fprintf(output, "%s", prefix);
>
> - id = buf[thread].id;

would it be less changes in here if you kept id with new type?

jirka

> if (config->stats)
> - printout(config, id, 0, buf[thread].counter, buf[thread].uval,
> + printout(config, buf[thread].id, 0, buf[thread].counter, buf[thread].uval,
> prefix, buf[thread].run, buf[thread].ena, 1.0,
> - &config->stats[id]);
> + &config->stats[buf[thread].id.id]);
> else
> - printout(config, id, 0, buf[thread].counter, buf[thread].uval,
> + printout(config, buf[thread].id, 0, buf[thread].counter, buf[thread].uval,
> prefix, buf[thread].run, buf[thread].ena, 1.0,
> &rt_stat);
> fputc('\n', output);

SNIP

\
 
 \ /
  Last update: 2020-11-15 22:20    [W:0.093 / U:23.260 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site