Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp434457ybk; Wed, 20 May 2020 03:26:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxaAsdzZdhXrKjOVqDtm27SouFyrg1T/Agf2Zf5NHNaMmUPWN4UFyz2VrEQkiOeACjWrhSX X-Received: by 2002:a50:f40d:: with SMTP id r13mr2635198edm.93.1589970392877; Wed, 20 May 2020 03:26:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589970392; cv=none; d=google.com; s=arc-20160816; b=Dsa1NoD+j4Ttkp+DY6fN/2/MI5AN2PvPt5a/BjeeSHlIuv0UH2yu38p4+m2kzCGBA7 tYUXzCtA9Fh335ySA1htfJdmzGD2MJuYDbzBBukep9XCmZ4pIwiGqqi5a0w96IKVAEc7 1kg7j5tRgeC+VRXm7rPYOfVmp4qyv3TVmOPWpEezvP1n8PPwRunSB90PTsklabTr9hl4 vEtchVivNzUXcM04Zs8nbpC8JtlMiMmjwtqs6E2zWvFXJUllX4hZrup7kC/2+XrZP7CM GV+2awnCY9ZNiHvaxY8V7qlP0dyfYt3Clw/4VR6KUvXzwyijXSsXB8ZJIssi1n4xViqK 0k0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=iiwcfSlk9X922qbqxqOwh7uWoWiFfpawShlXFbaFFLk=; b=y1k6wy0AGpJ3Sabe8LCihR0Tgb6KowltKnb/PjhDp2Za+yy/FwLEPq3B5yyjqbYrp9 urogwGvpWIL370bYiAccCZXuSVUn15TJshD6jtQuSxhQIJeXDd0t3P6nza89K7Exn3Vq MUIq0nWB9WTAVfY4U14uN8VKUTEqMDJmaxDuokVvO+hcWs1OBwoS98XLmbciySEDInX4 IrYjVrKxDWLakFtn/MnO8CqOzrbQZ0g7HUvhxmZuUH+aQaPhiJSDk+65GCxqtuwZaLpe RZ0jhMD+ipt1P68jcHfFeInNx4Lnrv3DRJhJkA4r572myVzacXs5xfVPIuSlNRPRyKja Ed2g== 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 i23si1413292edg.437.2020.05.20.03.26.10; Wed, 20 May 2020 03:26:32 -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 S1726837AbgETKWX (ORCPT + 99 others); Wed, 20 May 2020 06:22:23 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:35600 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726435AbgETKWX (ORCPT ); Wed, 20 May 2020 06:22:23 -0400 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 1DACEE65830E18F0CE88; Wed, 20 May 2020 18:22:20 +0800 (CST) Received: from [127.0.0.1] (10.166.213.10) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.487.0; Wed, 20 May 2020 18:22:13 +0800 Subject: Re: [PATCH] perf bpf-loader: Add missing '*' for key_scan_pos To: Jiri Olsa CC: , , , , , , , , , , References: <20200520033216.48310-1-bobo.shaobowang@huawei.com> <20200520070551.GC110644@krava> From: "Wangshaobo (bobo)" Message-ID: Date: Wed, 20 May 2020 18:22:12 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.1.0 MIME-Version: 1.0 In-Reply-To: <20200520070551.GC110644@krava> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.166.213.10] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 在 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.   thanks,   Wang ShaoBo