Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp1560683ioo; Sun, 22 May 2022 19:07:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyFOMjz6TdeGSLson9RbtnQw7eBnCoVgvK8Fv0nGDLXWNg4KK0ZArh1uDWutPawny3j1wJ+ X-Received: by 2002:a17:907:6daa:b0:6fe:b530:8f4e with SMTP id sb42-20020a1709076daa00b006feb5308f4emr10264511ejc.423.1653271626069; Sun, 22 May 2022 19:07:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653271626; cv=none; d=google.com; s=arc-20160816; b=nMc5tc9lpllh/i1tw5EyRRzgKr+X2MtE9L/gyRh+e0yqBYhPluPL08ibzptnDBeW2h mK8vOIAEC7PPBjFdXIBHROxBmzOeVu+Jq2U9IlTTYYsZ87lhdr/PaYl9naot7eqy/VA5 vB8EnuBqFIFhfBTFgLEZPSGyuEQHXCE+oGwclCrlDmU/eloREEVwlG0UI8kQ9VpArkTX 7sC1ryAZ4ZRIioa08fp8QCY+wg0hme9f5SDwcftmChdCfypBJc0CIjqf8NYDFTyU17TF jpedv3EyxFUAcL4IMkSlYfKGXVAOI+YqU4m/BSdM8h5FYBZusNg1AjOXOs8wpP6QNJZL I1bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=2SwxBdB8UVLi2tMFV1pZzHg22h0sE4h9X7N8iPLNtH4=; b=X4QW/SFlPOLcqYIWgScsbqB03s75s1sr03yhT1BEM3qpDpkOecL7vPgx4U9R0g5RFP QyFFcJ7OqLKlPVpXrQuYGimT+7DO+JFHc3s/Mo5yD5y7rL1qhPYKIKs8HYpLKb0oioQ4 2VNUR3QVX3mRwIKNoHF40dBak6LjX3EKHgV4zklp1ZbNRxZ80Ab4QdrHWVHsfdVPhDDC MwfWaPcaCZUk5li3Xwfks8VJnGP8P/maVFTc/NRJwcf9aNXdVJlwVX38SJXoN4/2qAA8 elqzahsbZsdnaoAGVyzUh1xgAKqe3CW9h70zF5aj7VDHNEhg/PXQES4rAYu4OSTCPs3c KxOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LOTQ2dYA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hu8-20020a170907a08800b006fe8b68462dsi12011733ejc.931.2022.05.22.19.06.40; Sun, 22 May 2022 19:07:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LOTQ2dYA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244780AbiETOaM (ORCPT + 99 others); Fri, 20 May 2022 10:30:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229991AbiETOaL (ORCPT ); Fri, 20 May 2022 10:30:11 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B25A29D070; Fri, 20 May 2022 07:30:09 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2D64061B07; Fri, 20 May 2022 14:30:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 63CB2C385A9; Fri, 20 May 2022 14:30:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1653057008; bh=OeOgCk8EVTQhPkt9ndP9eIEJfKLKRtvt7Q6gkADqWOI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=LOTQ2dYAAHFkY5UX99hXF9yCuk5nnvINOVXS+kUG1GYHrTBHyQEtrztOX+QMpaz2p ac76gjoTXBlOrqpxS/Ldzjm4SSfQzvApTtRgppb52uE2SzuAg56YuC/rx2vCuowHQM O9Jer8iks/2E1iSkxyuDUE7FnqUdjE3ETBB1xT7I7YMD7xOipuwgnjJOXlX0zOXI/q xpZ2/Q5dtXJMuBUjZyUEE6j/Riio3aV8AoOfWW+3nBFCgpSO74gcxD0fxEjhoYoPXS k8V0FQaqmo5giANlo8X1DeYI9v0uec4wAC8aWX1FtDgap4xixZq2KAwlK8MPDxO6op ZyJzESl3jaB8Q== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id E1C87400B1; Fri, 20 May 2022 11:30:04 -0300 (-03) Date: Fri, 20 May 2022 11:30:04 -0300 From: Arnaldo Carvalho de Melo To: Thomas Richter Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, svens@linux.ibm.com, gor@linux.ibm.com, sumanthk@linux.ibm.com, hca@linux.ibm.com, Namhyung Kim Subject: Re: [PATCH v2] perf/s390: Compiler error on s390 for bench/numa.c Message-ID: References: <20220520081158.2990006-1-tmricht@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220520081158.2990006-1-tmricht@linux.ibm.com> X-Url: http://acmel.wordpress.com X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Fri, May 20, 2022 at 10:11:58AM +0200, Thomas Richter escreveu: > The compilation on s390 results in this error: > > # make DEBUG=y bench/numa.o > ... > bench/numa.c: In function ‘__bench_numa’: > bench/numa.c:1749:81: error: ‘%d’ directive output may be truncated > writing between 1 and 11 bytes into a region of size between > 10 and 20 [-Werror=format-truncation=] > 1749 | snprintf(tname, sizeof(tname), "process%d:thread%d", p, t); > ^~ > ... > bench/numa.c:1749:64: note: directive argument in the range > [-2147483647, 2147483646] > ... > # > > The maximum length of the %d replacement is 11 characters because > of the negative sign. Therefore extend the array by two more > characters. > > Output after: > # make DEBUG=y bench/numa.o > /dev/null 2>&1; ll bench/numa.o > -rw-r--r-- 1 root root 418320 May 19 09:11 bench/numa.o > # > > Fixes: 3aff8ba0a4c9c ("perf bench numa: Avoid possible truncation when using snprintf()") > Suggested-by: Namhyung Kim Thanks, applied. - Arnaldo > Signed-off-by: Thomas Richter > --- > tools/perf/bench/numa.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/perf/bench/numa.c b/tools/perf/bench/numa.c > index d5289fa58a4f..20eed1e53f80 100644 > --- a/tools/perf/bench/numa.c > +++ b/tools/perf/bench/numa.c > @@ -1740,7 +1740,7 @@ static int __bench_numa(const char *name) > "GB/sec,", "total-speed", "GB/sec total speed"); > > if (g->p.show_details >= 2) { > - char tname[14 + 2 * 10 + 1]; > + char tname[14 + 2 * 11 + 1]; > struct thread_data *td; > for (p = 0; p < g->p.nr_proc; p++) { > for (t = 0; t < g->p.nr_threads; t++) { > -- > 2.36.1 -- - Arnaldo