Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965229AbbKDBnB (ORCPT ); Tue, 3 Nov 2015 20:43:01 -0500 Received: from szxga02-in.huawei.com ([119.145.14.65]:40897 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965059AbbKDBnA (ORCPT ); Tue, 3 Nov 2015 20:43:00 -0500 Message-ID: <5639625B.7020302@huawei.com> Date: Wed, 4 Nov 2015 09:41:47 +0800 From: "Wangnan (F)" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Arnaldo Carvalho de Melo CC: Namhyung Kim , , , , , , , , , , , , , Subject: Re: [PATCH 10/31] perf test: Enforce LLVM test for BPF test References: <1444826502-49291-1-git-send-email-wangnan0@huawei.com> <1444826502-49291-11-git-send-email-wangnan0@huawei.com> <20151014154842.GC4085@danjae.kornet> <561F94EE.2060503@huawei.com> <20151103182411.GT21609@kernel.org> In-Reply-To: <20151103182411.GT21609@kernel.org> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.111.66.109] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090203.56396275.001B,ss=1,re=0.000,fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2011-05-27 18:58:46 X-Mirapoint-Loop-Id: b4a26b4cfa55a3615b37d4f2354ee3f4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1452 Lines: 41 On 2015/11/4 2:24, Arnaldo Carvalho de Melo wrote: > Em Thu, Oct 15, 2015 at 07:58:38PM +0800, Wangnan (F) escreveu: >>>> +void test__llvm_prepare(void) >>>> +{ >>>> + p_test_llvm__bpf_result = mmap(NULL, SHARED_BUF_INIT_SIZE, >>>> + PROT_READ | PROT_WRITE, >>>> + MAP_SHARED | MAP_ANONYMOUS, -1, 0); >>>> + if (!p_test_llvm__bpf_result) >>> It should check MAP_FAILED instead. >>> >> Fixed by this way: > Can you please try refreshing this patchset on top of what is now in > acme/perf/core? > > Also why do we need those struct test->{prepare,cleanup} pointers? You > introduced it and then, on the next patch that touches 'perf test' and > uses test__llvm_{prepare,cleanup} you call them directly, which I think > should be enough, i.e. keep them as functions to call from inside > the test called from run_test(), right? > > - Arnaldo > This prepare/cleanup functions are introduced because I want BPF test reuse the result of LLVM test, so it don't need to compile those BPF scripts twice. This is the reason I use shared memory. However, now I think compiling twice is acceptable and can make things simpler. I'll update this patchset in my next pull request. Thank you. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/