lkml.org 
[lkml]   [2015]   [Apr]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 01/10] perf tools: Move TUI-specific fields into unnamed union
Date
Since perf diff only supports stdio output, TUI fields are only accessed
from perf report (or perf top). So add a new unnamed union and move
struct hist_entry_tui and those TUI-specific fields.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
tools/perf/util/sort.h | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/tools/perf/util/sort.h b/tools/perf/util/sort.h
index de3303fe726d..7f0c0a8d615d 100644
--- a/tools/perf/util/sort.h
+++ b/tools/perf/util/sort.h
@@ -93,18 +93,24 @@ struct hist_entry {
s32 cpu;
u8 cpumode;

- struct hist_entry_diff diff;
-
/* We are added by hists__add_dummy_entry. */
bool dummy;

- /* XXX These two should move to some tree widget lib */
- u16 row_offset;
- u16 nr_rows;
-
bool init_have_children;
char level;
u8 filtered;
+ 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;
+ };
+ };
char *srcline;
struct symbol *parent;
struct rb_root sorted_chain;
--
2.3.5


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