From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756198AbbDVL5S (ORCPT ); Wed, 22 Apr 2015 07:57:18 -0400 Received: from mail.kernel.org ([198.145.29.136]:54805 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932185AbbDVL5O (ORCPT ); Wed, 22 Apr 2015 07:57:14 -0400 Date: Wed, 22 Apr 2015 08:57:10 -0300 From: Arnaldo Carvalho de Melo To: Namhyung Kim Cc: Ingo Molnar , Peter Zijlstra , Jiri Olsa , LKML , David Ahern Subject: Re: [PATCH 01/10] perf tools: Move TUI-specific fields into unnamed union Message-ID: <20150422115710.GB25482@kernel.org> References: <1429687101-4360-1-git-send-email-namhyung@kernel.org> <1429687101-4360-2-git-send-email-namhyung@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1429687101-4360-2-git-send-email-namhyung@kernel.org> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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., if struct hist_entry_diff isn't passed as a parameter, etc. But this certainly is something for later, if at all. Applying. - Arnaldo