lkml.org 
[lkml]   [2015]   [Apr]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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


\
 
 \ /
  Last update: 2015-04-22 14:21    [W:0.217 / U:0.376 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site