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=-7.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SIGNED_OFF_BY, 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 225B3C388F7 for ; Tue, 3 Nov 2020 12:13:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C665222384 for ; Tue, 3 Nov 2020 12:13:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604405612; bh=luWx/6jx47ZiEJeefvFyHfIO5/JRBC2XwbsWLHc+1lI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=0ssu/RbMOnO4F6PHpy/9dgnODYUwdBzhU9RBDlaTULNu0AR4RC6ZwKWMW4k29d4vk bmw+mLMQyr4U7PifebJGpWURz2EzJuaavru9pfoouFAxEPxrQPWlC8OByxcyrwYHQS n9QaIX4rYHjdarzlHJ/7AGYRX7661T7CzirYDtZA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728973AbgKCMNb (ORCPT ); Tue, 3 Nov 2020 07:13:31 -0500 Received: from mail.kernel.org ([198.145.29.99]:36974 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727923AbgKCMNb (ORCPT ); Tue, 3 Nov 2020 07:13:31 -0500 Received: from quaco.ghostprotocols.net (unknown [179.97.37.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8818321D40; Tue, 3 Nov 2020 12:13:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604405610; bh=luWx/6jx47ZiEJeefvFyHfIO5/JRBC2XwbsWLHc+1lI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=DbJDeZxfGYeFPGcYSsZY1ZUAyn6ZFAvMyQ2Iwfw8pCML7QjwwCi3HcC4NlSRYaXya gLjQ4zAf1l2k/FLeZqWnqayBa42hm9+KNpj5+6zKTdmespamQq6M59mKlbVIUIffV1 hvgbzJ2fYHxe1NpcjtKScJIWQ+lXt8nH/FPP3ySc= Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 426CA40452; Tue, 3 Nov 2020 09:13:28 -0300 (-03) Date: Tue, 3 Nov 2020 09:13:28 -0300 From: Arnaldo Carvalho de Melo To: Jiri Olsa Cc: Song Liu , linux-kernel@vger.kernel.org, stable , Jin Yao , Jiri Olsa , Arnaldo Carvalho de Melo Subject: Re: [PATCH] perf: increase size of buf in perf_evsel__hists_browse() Message-ID: <20201103121328.GC151027@kernel.org> References: <20201030235431.534417-1-songliubraving@fb.com> <20201031202920.GC3380099@krava> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201031202920.GC3380099@krava> X-Url: http://acmel.wordpress.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Sat, Oct 31, 2020 at 09:29:20PM +0100, Jiri Olsa escreveu: > On Fri, Oct 30, 2020 at 04:54:31PM -0700, Song Liu wrote: > > Making perf with gcc-9.1.1 generates the following warning: > > > > CC ui/browsers/hists.o > > ui/browsers/hists.c: In function 'perf_evsel__hists_browse': > > ui/browsers/hists.c:3078:61: error: '%d' directive output may be \ > > truncated writing between 1 and 11 bytes into a region of size \ > > between 2 and 12 [-Werror=format-truncation=] > > > > 3078 | "Max event group index to sort is %d (index from 0 to %d)", > > | ^~ > > ui/browsers/hists.c:3078:7: note: directive argument in the range [-2147483648, 8] > > 3078 | "Max event group index to sort is %d (index from 0 to %d)", > > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > In file included from /usr/include/stdio.h:937, > > from ui/browsers/hists.c:5: > > > > IOW, the string in line 3078 might be too long for buf[] of 64 bytes. > > > > Fix this by increasing the size of buf[] to 128. > > > > Fixes: dbddf1747441 ("perf report/top TUI: Support hotkeys to let user select any event for sorting") > > Cc: stable # v5.7+ > > Cc: Jin Yao > > Cc: Jiri Olsa > > Cc: Arnaldo Carvalho de Melo > > Cc: Arnaldo Carvalho de Melo > > Signed-off-by: Song Liu > > Acked-by: Jiri Olsa Thanks, applied. - Arnaldo