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=-6.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 70743C433E1 for ; Wed, 20 May 2020 10:30:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4CE3D204EA for ; Wed, 20 May 2020 10:30:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="eOqHqyKa" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726844AbgETKaR (ORCPT ); Wed, 20 May 2020 06:30:17 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:24443 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726452AbgETKaO (ORCPT ); Wed, 20 May 2020 06:30:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589970613; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LGTpfrIIrUndkAVZ2N+k9ch+ZMAMk2llwppj8ZkxQsA=; b=eOqHqyKaQZd28mxeMDb3uJLEKaoLjIwCpg2ObiNRJUAU+eI5j3Oic9TFGZionyKD4h2Kmb nxI1YKCHxM5eZ5JciCc1xIlmygb7TlVFoXEKFDwgm+UpNjtJYx6cp6oqADGJqJb+mSJb6o 6AMD+IpbYFaV4nltjrHHhovMY47eqgU= 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-514-HjzYvl8oOT65HFROhg83fg-1; Wed, 20 May 2020 06:30:11 -0400 X-MC-Unique: HjzYvl8oOT65HFROhg83fg-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C84FB1800D42; Wed, 20 May 2020 10:30:09 +0000 (UTC) Received: from krava (unknown [10.40.193.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id 408F960BEC; Wed, 20 May 2020 10:30:06 +0000 (UTC) Date: Wed, 20 May 2020 12:30:06 +0200 From: Jiri Olsa To: "Wangshaobo (bobo)" Cc: cj.chengjian@huawei.com, huawei.libin@huawei.com, xiexiuqi@huawei.com, mark.rutland@arm.com, guohanjun@huawei.com, acme@kernel.org, alexander.shishkin@linux.intel.com, wangnan0@huawei.com, bpf@vger.kernel.org, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Subject: Re: [PATCH] perf bpf-loader: Add missing '*' for key_scan_pos Message-ID: <20200520103006.GA157452@krava> References: <20200520033216.48310-1-bobo.shaobowang@huawei.com> <20200520070551.GC110644@krava> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 20, 2020 at 06:22:12PM +0800, Wangshaobo (bobo) wrote: > > 在 2020/5/20 15:05, Jiri Olsa 写道: > > On Wed, May 20, 2020 at 11:32:16AM +0800, Wang ShaoBo wrote: > > > key_scan_pos is a pointer for getting scan position in > > > bpf__obj_config_map() for each BPF map configuration term, > > > but it's misused when error not happened. > > > > > > Fixes: 066dacbf2a32 ("perf bpf: Add API to set values to map entries in a bpf object") > > > Signed-off-by: Wang ShaoBo > > > --- > > > tools/perf/util/bpf-loader.c | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/tools/perf/util/bpf-loader.c b/tools/perf/util/bpf-loader.c > > > index 10c187b8b8ea..460056bc072c 100644 > > > --- a/tools/perf/util/bpf-loader.c > > > +++ b/tools/perf/util/bpf-loader.c > > > @@ -1225,7 +1225,7 @@ bpf__obj_config_map(struct bpf_object *obj, > > > out: > > > free(map_name); > > > if (!err) > > > - key_scan_pos += strlen(map_opt); > > > + *key_scan_pos += strlen(map_opt); > > seems good, was there something failing because of this? > > > > Acked-by: Jiri Olsa > > > > thanks, > > jirka > >   I found this problem when i checked this code, I think it is > >   an implicit question, but if we delete the two line,  the problem > >   also no longer exists. and what's the actual problem, what's broken? jirka > >   thanks, > >   Wang ShaoBo > >