From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751279AbbDSEGv (ORCPT ); Sun, 19 Apr 2015 00:06:51 -0400 Received: from mail-pa0-f48.google.com ([209.85.220.48]:34419 "EHLO mail-pa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751429AbbDSEFZ (ORCPT ); Sun, 19 Apr 2015 00:05:25 -0400 From: Namhyung Kim To: Arnaldo Carvalho de Melo Cc: Ingo Molnar , Peter Zijlstra , Jiri Olsa , LKML , David Ahern Subject: [PATCH 2/7] perf diff: Make hist_entry_diff fields union Date: Sun, 19 Apr 2015 13:04:10 +0900 Message-Id: <1429416255-12070-3-git-send-email-namhyung@kernel.org> X-Mailer: git-send-email 2.3.5 In-Reply-To: <1429416255-12070-1-git-send-email-namhyung@kernel.org> References: <1429416255-12070-1-git-send-email-namhyung@kernel.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- tools/perf/util/sort.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) 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; + }; }; /** -- 2.3.5