Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2915032pxk; Mon, 28 Sep 2020 03:45:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyGbb60N+/ciTfQ5kDU6g6r1syf58l+XZflFlfh1ChOl9oWNsJSXZqqgFACupAxidnYarFG X-Received: by 2002:a17:906:3e0c:: with SMTP id k12mr953808eji.189.1601289920418; Mon, 28 Sep 2020 03:45:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601289920; cv=none; d=google.com; s=arc-20160816; b=Ns2C44oIL9TE6s9eH2vah2aWMaZazJ5DzmHaU+O3jDVNZbMJHqJ4txPlb0tD1rrO27 6gavPHANl8vt00qQHTcTIzoD2BlVSeruDsuHaBYjZbDO0ArlHI33xg5z/h/dqFe76W49 I1mz4SZSyf3P2MTzV/gCn7GNIgbQScr6p3oDOI5JqBSuZs2kmLvEQhYkXEYN1Rw69Ash G5O8babN9C3PT0e5nDxRVYf920I/q7lhTN8BHSo2zAGAbxJeK/PXXXGNwkXpODsh4pLW OEuDlzmPFLjXhXavgKHTSjD2ov+trDpLszq+iA8xsRSiZ7rwP4cqWB8/GGrVYalktjpM b3hg== 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; bh=WbYQeACb/b1+vA2yCpp32WQpbIGxVYUgbIHqcZnfrAU=; b=cGxlJLzBnr1lUyWC271Wk0Y9L2argSq06vccG+sYPeOFhO0pC+0cSvL4fOYx0bHftH huPkOBzYFlgtRMw70VKnTI0gJ0bjPTYq1JcB4w1FujjHlyLB+V1pZ3FuMh1WK87yopN2 QLdN/yxsn1rYvUNtSSC3KMjGW0/C3M/bTiR8ulHmgkR//jDbHQHN+9buzPyFzSfBX6Hv 5A5MaFRKpoZxr938wCzyRp0PL5zR47bUrGI6CA1aVqAgm1FhGBtyGCWy6BBeD6D1fY8V hY+kh5ErLDISDFyNCvM2l50XUC1+8UCpLalBVB/Luz8B7Uz6I779wPCti6XuGBvX7xev pw8A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d12si354761ejj.237.2020.09.28.03.44.58; Mon, 28 Sep 2020 03:45:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726788AbgI1KnW (ORCPT + 99 others); Mon, 28 Sep 2020 06:43:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726667AbgI1KnT (ORCPT ); Mon, 28 Sep 2020 06:43:19 -0400 Received: from mout-p-201.mailbox.org (mout-p-201.mailbox.org [IPv6:2001:67c:2050::465:201]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6366AC061755 for ; Mon, 28 Sep 2020 03:43:19 -0700 (PDT) Received: from smtp2.mailbox.org (smtp2.mailbox.org [80.241.60.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4C0JyX4lcYzQlLc; Mon, 28 Sep 2020 12:43:16 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter01.heinlein-hosting.de (spamfilter01.heinlein-hosting.de [80.241.56.115]) (amavisd-new, port 10030) with ESMTP id 3Z61HEDtY_hU; Mon, 28 Sep 2020 12:43:13 +0200 (CEST) Date: Mon, 28 Sep 2020 12:43:11 +0200 From: Hagen Paul Pfeifer To: Jiri Olsa Cc: linux-kernel@vger.kernel.org, Jiri Olsa , Arnaldo Carvalho de Melo Subject: Re: perf script, libperf: python binding bug (bytearrays vs. strings) Message-ID: <20200928104311.GA412466@laniakea> References: <20200927074312.GA3664097@laniakea> <20200928100808.GA3517742@krava> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200928100808.GA3517742@krava> X-Key-Id: 98350C22 X-Key-Fingerprint: 490F 557B 6C48 6D7E 5706 2EA2 4A22 8D45 9835 0C22 X-GPG-Key: gpg --recv-keys --keyserver wwwkeys.eu.pgp.net 98350C22 X-MBO-SPAM-Probability: X-Rspamd-Score: -2.82 / 15.00 / 15.00 X-Rspamd-Queue-Id: 88079170E X-Rspamd-UID: c898f5 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Jiri Olsa | 2020-09-28 12:08:08 [+0200]: >patch below fixes it for me, but seems strange this was >working till now.. maybe you're the only one using this >with python3 ;-) and I thought python2 is obsolete and not maintained anymore ... ;-) Anyway, the patch fixed everything: no more garbage for Python2 and Python3 as well as no bytearray type Python3! Tested-by: Hagen Paul Pfeifer Thank you Jiri! Probably this patch should be applied on stable too!? Not sure when the problem was introduced. Hagen >jirka > > >--- >diff --git a/tools/perf/util/print_binary.c b/tools/perf/util/print_binary.c >index 599a1543871d..13fdc51c61d9 100644 >--- a/tools/perf/util/print_binary.c >+++ b/tools/perf/util/print_binary.c >@@ -50,7 +50,7 @@ int is_printable_array(char *p, unsigned int len) > > len--; > >- for (i = 0; i < len; i++) { >+ for (i = 0; i < len && p[i]; i++) { > if (!isprint(p[i]) && !isspace(p[i])) > return 0; > } >