Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1370888rwd; Tue, 13 Jun 2023 08:16:55 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4pBZhAFoP+DSLQdRDSIXP6WCM2RJ69tT8PQI7oBOMafg10jS7OAFdpCQGLIf4p4AS9m8/3 X-Received: by 2002:a17:907:36c3:b0:974:7713:293f with SMTP id bj3-20020a17090736c300b009747713293fmr15065731ejc.41.1686669415387; Tue, 13 Jun 2023 08:16:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686669415; cv=none; d=google.com; s=arc-20160816; b=gdcXfzg8/nO0RiOG8YDsKy342hMnRk6ca0LEAqk7C5TpDXV0X7aYmY6ypZZlivsPph cFhgNqP2SAujwvK2rmMSduXSwhttZbnsUf0PdYCF4ltOPBw9iUUyS0rz9KtqbtgmZxlt Z+2gJNq7Bjyo9PuAQxke8LmJ7RKXP4+OAXkMaN1Rdvp1OIO8RHTH5BOGYG67o3/BRR21 qkuXbyXwnWpqrL/zH2hQIsad798Y/u9lmoEs+HleWajoVW5hG7AOVNmX/qzqA4etPALk FO/fkKotk+Omg9Ajb2XZsPW5dAQcWW09WZhe7Vo25ziY3QptsWFXKB0oZI2qEYvIsueP i+BQ== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=e0BQd11dRCEfWdwW5Di+n3hZSCLtOAq4ZDJRRba+IC8=; b=z8eHf3o23yfSgH/9bcW1m02EBMftXxLkXvCtEYhn41YuQ7G/JdT3YNt+vCVZSYuGg5 aC8M1QbDEhLZdXPbwHnMfAKLsKGfmQ8F3CnjqKlYauN1sfddIdoObn9tL/wCG8cnbOdt ia4dDb0FZJZEMo+SedBtBQraOadJDLMkKkaDi2UPIj+FPRMJgxcUQ5BMXJWdp0OL0I11 S+goT/0pSnhshzdT7jOFMoDPsfMCDNb8LSAh6ba6RB/lYvYIJEqji1YT3IllZeiYxg91 gXF84V/XQgXASIrKHmlAB36Ic3SiHoC1lZicCNlU8OVB95NhMLliy35lo3gZDrhqewVf 2caw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uvWLJwc2; 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 u25-20020a17090657d900b009786e73f054si7278551ejr.635.2023.06.13.08.16.28; Tue, 13 Jun 2023 08:16:55 -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=uvWLJwc2; 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 S242774AbjFMOdA (ORCPT + 99 others); Tue, 13 Jun 2023 10:33:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239503AbjFMOc7 (ORCPT ); Tue, 13 Jun 2023 10:32:59 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CDA2410E4; Tue, 13 Jun 2023 07:32:58 -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 662E263726; Tue, 13 Jun 2023 14:32:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9ADE3C433D9; Tue, 13 Jun 2023 14:32:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686666777; bh=Bs9C3bFUo4NN1m0OLeWb0RwmmueJ4oO5oodcrAhgfDY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=uvWLJwc2HejUgokqBb1+jj68/rXyTtqmubY/Z2MvuypCboIApJMibjLRFQsZh2mH0 aBmPISwVkxVY+SsfvuUBfYGG5QpI4W3ZTnWZpWbKhs7Sjmw3n9EOa0ihHLerujjIoS vKzob+jjtWtLaypeOXFdh1r811joiCXZ8NAAsuEvhcfhlwh5jKHTWtUcZdx1TdZYO0 Fmc5qThFrcb4jJH0f8KKcaLdwECNn7GSMApuJnGmpbyVEUQUTooQEdprMM42WgBtTV 3FJ2Pfxz6mnv47BRRDVvaB2AdmRbQ4T9C/q/+6EHySNNtSh4sRjBH1HP09pExU1X/r zoirIDQ/ZJXPQ== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 20FF340692; Tue, 13 Jun 2023 11:32:55 -0300 (-03) Date: Tue, 13 Jun 2023 11:32:55 -0300 From: Arnaldo Carvalho de Melo To: Namhyung Kim Cc: Jiri Olsa , Ian Rogers , Adrian Hunter , Peter Zijlstra , Ingo Molnar , LKML , linux-perf-users@vger.kernel.org, Masami Hiramatsu Subject: Re: [PATCH 1/2] perf dwarf-aux: Fix off-by-one in die_get_varname() Message-ID: References: <20230612234102.3909116-1-namhyung@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230612234102.3909116-1-namhyung@kernel.org> X-Url: http://acmel.wordpress.com X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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 Mon, Jun 12, 2023 at 04:41:01PM -0700, Namhyung Kim escreveu: > The die_get_varname() returns "(unknown_type)" string if it failed to > find a type for the variable. But it had a space before the opening > parenthesis and it made the closing parenthesis cut off due to the > off-by-one in the string length (14). Thanks, applied and added: Fixes: 88fd633cdfa19060 ("perf probe: No need to use formatting strbuf method") I introduced this long ago :-\ - Arnaldo > Signed-off-by: Namhyung Kim > --- > tools/perf/util/dwarf-aux.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/perf/util/dwarf-aux.c b/tools/perf/util/dwarf-aux.c > index e4593a71556b..1ac88b79687d 100644 > --- a/tools/perf/util/dwarf-aux.c > +++ b/tools/perf/util/dwarf-aux.c > @@ -1103,7 +1103,7 @@ int die_get_varname(Dwarf_Die *vr_die, struct strbuf *buf) > ret = die_get_typename(vr_die, buf); > if (ret < 0) { > pr_debug("Failed to get type, make it unknown.\n"); > - ret = strbuf_add(buf, " (unknown_type)", 14); > + ret = strbuf_add(buf, "(unknown_type)", 14); > } > > return ret < 0 ? ret : strbuf_addf(buf, "\t%s", dwarf_diename(vr_die)); > -- > 2.41.0.162.gfafddb0af9-goog