From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 01D39C4361B for ; Mon, 7 Dec 2020 18:06:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AFB8D2371F for ; Mon, 7 Dec 2020 18:06:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726451AbgLGSFh (ORCPT ); Mon, 7 Dec 2020 13:05:37 -0500 Received: from frasgout.his.huawei.com ([185.176.79.56]:2218 "EHLO frasgout.his.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725822AbgLGSFg (ORCPT ); Mon, 7 Dec 2020 13:05:36 -0500 Received: from fraeml745-chm.china.huawei.com (unknown [172.18.147.226]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4CqWPS0Kgjz67McX; Tue, 8 Dec 2020 02:02:52 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml745-chm.china.huawei.com (10.206.15.226) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Mon, 7 Dec 2020 19:04:55 +0100 Received: from [10.210.169.98] (10.210.169.98) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Mon, 7 Dec 2020 18:04:53 +0000 Subject: Re: [PATCH v6 08/10] perf metricgroup: Support printing metric groups for system PMUs To: Arnaldo Carvalho de Melo CC: , , , , , , , , , , , , , , , , , , References: <1607080216-36968-1-git-send-email-john.garry@huawei.com> <1607080216-36968-9-git-send-email-john.garry@huawei.com> <20201207172319.GD129853@kernel.org> From: John Garry Message-ID: Date: Mon, 7 Dec 2020 18:04:21 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.1.2 MIME-Version: 1.0 In-Reply-To: <20201207172319.GD129853@kernel.org> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.210.169.98] X-ClientProxiedBy: lhreml719-chm.china.huawei.com (10.201.108.70) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/12/2020 17:23, Arnaldo Carvalho de Melo wrote: >> +struct metricgroup_print_sys_idata { >> + struct strlist *metriclist; >> + bool metricgroups; >> + char *filter; >> + bool raw; >> + bool details; >> + struct rblist *groups; >> +}; > I'm doing some reorg to avoid these holes: > > [acme@five perf]$ pahole -C metricgroup_print_sys_idata ~/bin/perf > struct metricgroup_print_sys_idata { > struct strlist * metriclist; /* 0 8 */ > _Bool metricgroups; /* 8 1 */ > > /* XXX 7 bytes hole, try to pack */ > > char * filter; /* 16 8 */ > _Bool raw; /* 24 1 */ > _Bool details; /* 25 1 */ > > /* XXX 6 bytes hole, try to pack */ > > struct rblist * groups; /* 32 8 */ > > /* size: 40, cachelines: 1, members: 6 */ > /* sum members: 27, holes: 2, sum holes: 13 */ > /* last cacheline: 40 bytes */ > }; > [acme@five perf]$ > > It ended up as: > > [acme@five perf]$ pahole -C metricgroup_print_sys_idata ~/bin/perf > struct metricgroup_print_sys_idata { > struct strlist * metriclist; /* 0 8 */ > char * filter; /* 8 8 */ > struct rblist * groups; /* 16 8 */ > _Bool metricgroups; /* 24 1 */ > _Bool raw; /* 25 1 */ > _Bool details; /* 26 1 */ > > /* size: 32, cachelines: 1, members: 6 */ > /* padding: 5 */ > /* last cacheline: 32 bytes */ > }; > [acme@five perf]$o > Hi Arnaldo, OK, I'll be less wasteful in my struct organization. Thanks, John