| Date | Wed, 22 Apr 2015 08:57:10 -0300 | From | Arnaldo Carvalho de Melo <> | Subject | Re: [PATCH 01/10] perf tools: Move TUI-specific fields into unnamed union |
| |
Em Wed, Apr 22, 2015 at 04:18:12PM +0900, Namhyung Kim escreveu: > +++ b/tools/perf/util/sort.h > @@ -93,18 +93,24 @@ struct hist_entry { > u8 cpumode; > - struct hist_entry_diff diff; > - > - /* XXX These two should move to some tree widget lib */ > - u16 row_offset; > - u16 nr_rows; > + union { > + /* > + * Since perf diff only supports the stdio output, TUI > + * fields are only accessed from perf report (or perf > + * top). So make it an union to reduce memory usage. > + */ > + struct hist_entry_diff diff; > + struct /* for TUI */ { > + u16 row_offset; > + u16 nr_rows; > + }; > + };
Thanks, this way we don't have to touch the diff code, reducing this patch size.
At some later date, we can shorten the accesses to diff.<fields>, if struct hist_entry_diff isn't passed as a parameter, etc. But this certainly is something for later, if at all.
Applying.
- Arnaldo
|