Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3027358pxk; Mon, 28 Sep 2020 06:42:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz4/dJ/v1R51kErT3/bE2RMGtKtZbHuW9jkWSK3GRCw0Er3LwvClsPxS6s4sDVaM2D8ZMlf X-Received: by 2002:a50:fe0f:: with SMTP id f15mr1803505edt.235.1601300544004; Mon, 28 Sep 2020 06:42:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601300543; cv=none; d=google.com; s=arc-20160816; b=CmNAFGGY0ndT/WE/VyyAMVVN0qOMagjngOUwjUsDR9ZR3gXmURxIt4/6++012jsmvI WHn6XHwUlz+thB9010UHrtjl9MVcIoRpyp7qUbzMSM2Qz2pXkJPAUtEoBW1arfy6rzfV ni/ZtaWnoHyuN7Lz8SE57AKeuZMu9Fxb5nKnPbhZm/e6uV9AUdlBdHs7jZbNqtvB6VGh 82S5C+qy9OxGqWt6jWBAOpXFeB9oJkmaRooPJnnDscfg7hzs6fBCEeh4qf4O540UnCaT Z6Wrq5VmKG57cL24CvTRg2UBWaJxWv7V0hWgjQwjceQBGR/yyDXFeGLoBwSzhlWCiS9/ IDmw== 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=Be9X77dK3loBF392caUbhqpeq0u1t0zlwY6mgNKh10E=; b=G46HI4FmNion39MXQO9/alNSSATUMeMAeQBggNGJ4Gic3e1tdf9plVmyaRnDswFFVF HrPmKsRYffqideELX2BT6PTuIDIeh+IFWY5b63gqnQk/3EWzk1BjKIGDf1ts3flB9uY6 3A6SpoB3mfrRZbPDrXBUi6BlhATtZJc77F16PUcdffjspOufMDC6A8jaIZiQqVes36vp cL1pVzoTZysvGL2JX5zWtxICJdnjsxujV2A81TuiOwFvp/zYNwtbhdv5oMYDnkXLDjlE J7Q7WIULgBIhhR/7M73HGZs7jf/21vp/ynpL7bzsE6Ls+HUvKXtjt0Q1X+4Nu477Xji6 IQLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OCtTTk3y; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i25si644559eds.204.2020.09.28.06.41.59; Mon, 28 Sep 2020 06:42:23 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OCtTTk3y; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726526AbgI1NkE (ORCPT + 99 others); Mon, 28 Sep 2020 09:40:04 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:51839 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726310AbgI1NkE (ORCPT ); Mon, 28 Sep 2020 09:40:04 -0400 Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601300403; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Be9X77dK3loBF392caUbhqpeq0u1t0zlwY6mgNKh10E=; b=OCtTTk3ygxOnomdGRQScL5H0bKqeYFga+ZbtSh9f+Y06GXW60+d2lfFJCya2l3vnFPzKcW GoNe0xberI1pIZYTrhsjvdJGtdqaVKQd4LUrS0S1iYxuIlfjiJe380Rf8nMfFhFnKEKUHZ pJr+5Di+bmiPT1tphmO06Byp9is5wUk= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-41-0LNSBslXMyeIX6IDsK5xiQ-1; Mon, 28 Sep 2020 09:39:59 -0400 X-MC-Unique: 0LNSBslXMyeIX6IDsK5xiQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B86478ECE49; Mon, 28 Sep 2020 13:39:44 +0000 (UTC) Received: from krava (unknown [10.40.193.42]) by smtp.corp.redhat.com (Postfix) with SMTP id 669678BB25; Mon, 28 Sep 2020 13:39:43 +0000 (UTC) Date: Mon, 28 Sep 2020 15:39:42 +0200 From: Jiri Olsa To: Hagen Paul Pfeifer 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: <20200928133942.GC3517742@krava> References: <20200927074312.GA3664097@laniakea> <20200928100808.GA3517742@krava> <20200928104311.GA412466@laniakea> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200928104311.GA412466@laniakea> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 28, 2020 at 12:43:11PM +0200, Hagen Paul Pfeifer wrote: > * 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. great, I'll check on that and send full patch later, thanks jirka > > 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; > > } > > >