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.7 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 17DF0C433EF for ; Fri, 3 Sep 2021 13:52:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E9D61608FB for ; Fri, 3 Sep 2021 13:52:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348320AbhICNxk (ORCPT ); Fri, 3 Sep 2021 09:53:40 -0400 Received: from mga18.intel.com ([134.134.136.126]:46862 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235802AbhICNxe (ORCPT ); Fri, 3 Sep 2021 09:53:34 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10095"; a="206546619" X-IronPort-AV: E=Sophos;i="5.85,265,1624345200"; d="scan'208";a="206546619" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Sep 2021 06:52:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,265,1624345200"; d="scan'208";a="603069684" Received: from linux.intel.com ([10.54.29.200]) by fmsmga001.fm.intel.com with ESMTP; 03 Sep 2021 06:52:31 -0700 Received: from abityuts-desk1.fi.intel.com (abityuts-desk1.fi.intel.com [10.237.68.32]) by linux.intel.com (Postfix) with ESMTP id 8CAA25802B1; Fri, 3 Sep 2021 06:52:30 -0700 (PDT) Message-ID: Subject: Re: [PATCH] tracing: Dynamically allocate the per-elt hist_elt_data array From: Artem Bityutskiy To: Tom Zanussi , Steven Rostedt Cc: linux-kernel@vger.kernel.org Date: Fri, 03 Sep 2021 16:52:29 +0300 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.4 (3.38.4-1.fc33) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2021-09-02 at 15:57 -0500, Tom Zanussi wrote: > Setting the hist_elt_data.field_var_str[] array unconditionally to a > size of SYNTH_FIELD_MAX elements wastes space unnecessarily. The > actual number of elements needed can be calculated at run-time > instead. > > In most cases, this will save a lot of space since it's a per-elt > array which isn't normally close to being full. It also allows us to > increase SYNTH_FIELD_MAX without worrying about even more wastage when > we do that. > > Signed-off-by: Tom Zanussi Many thanks Tom! I've tested this one. Tested-by: Artem Bityutskiy