From: Namhyung Kim Date: Sun, 19 Apr 2015 04:04:10 +0000 (+0900) Subject: perf diff: Make hist_entry_diff fields union X-Git-Tag: v4.2-rc1~177^2~50^2~97 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=a0b404f4c0820a934ae1b6ce39d8a4a0f01a7a20;p=karo-tx-linux.git perf diff: Make hist_entry_diff fields union The period_ratio_delta, period_ratio and wdiff are never by used at the same time. Instead, Just one of them is accessed according to a comparison method. So make it union to reduce memory footprint. Signed-off-by: Namhyung Kim Cc: David Ahern Cc: Jiri Olsa Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/1429416255-12070-3-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/util/sort.h b/tools/perf/util/sort.h index af192f172fa2..de3303fe726d 100644 --- a/tools/perf/util/sort.h +++ b/tools/perf/util/sort.h @@ -58,15 +58,16 @@ struct he_stat { struct hist_entry_diff { bool computed; + union { + /* PERF_HPP__DELTA */ + double period_ratio_delta; - /* PERF_HPP__DELTA */ - double period_ratio_delta; - - /* PERF_HPP__RATIO */ - double period_ratio; + /* PERF_HPP__RATIO */ + double period_ratio; - /* HISTC_WEIGHTED_DIFF */ - s64 wdiff; + /* HISTC_WEIGHTED_DIFF */ + s64 wdiff; + }; }; /**