From patchwork Sat Oct 25 06:51:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Nan X-Patchwork-Id: 39513 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f70.google.com (mail-wg0-f70.google.com [74.125.82.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0BDA82145E for ; Sat, 25 Oct 2014 06:55:42 +0000 (UTC) Received: by mail-wg0-f70.google.com with SMTP id a1sf1307736wgh.5 for ; Fri, 24 Oct 2014 23:55:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :in-reply-to:references:mime-version:cc:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:content-type :content-transfer-encoding; bh=Clmt0stq+7rscVlhtu58hSdW3+qDLelgdSg46PtrXsE=; b=MirOFeLcf3gRPVoVen6rl+DA8X/eZqBJQR+7j2IRbBhsoiibiwiTsp4dNbIIsLRMjX CaPnOKmrOPIPQx1hSSB1T3ijHaHFVMx0tlLJZad08pH6R6x3kmVS6LQ4r9QVslAVGBwC vlbwhpkfVVVY3wzFV5NP8ZlzPks5rpsySW8RRGaPxAlj/k72mhCCZbJs98KbXIlFPuid z5Os45JCnfgfcniiBArkqXqcL8rZu9jcjNODn6l0oLJo2XwZSZD7+iTwo+QEmiHW9GG8 WwpPl1UfD2Dkj5ycVnnX0eAFA994U7NcHj0DgbrYFttEgdpSubJ6nTN+o/QIGrggY4o0 ZLGg== X-Gm-Message-State: ALoCoQlXerP9+ePkBsWGu87Ec275hUaFYtR7CLfq6T7lrMtqpZMdx9m2/3tShg5JXE28+Ar1N6oq X-Received: by 10.112.95.133 with SMTP id dk5mr3298482lbb.3.1414220142203; Fri, 24 Oct 2014 23:55:42 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.170.133 with SMTP id am5ls538497lac.54.gmail; Fri, 24 Oct 2014 23:55:41 -0700 (PDT) X-Received: by 10.112.182.1 with SMTP id ea1mr9088094lbc.16.1414220141559; Fri, 24 Oct 2014 23:55:41 -0700 (PDT) Received: from mail-la0-f51.google.com (mail-la0-f51.google.com. [209.85.215.51]) by mx.google.com with ESMTPS id k1si10062759lbv.25.2014.10.24.23.55.41 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 24 Oct 2014 23:55:41 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) client-ip=209.85.215.51; Received: by mail-la0-f51.google.com with SMTP id q1so496088lam.24 for ; Fri, 24 Oct 2014 23:55:41 -0700 (PDT) X-Received: by 10.152.116.102 with SMTP id jv6mr9221577lab.40.1414220140660; Fri, 24 Oct 2014 23:55:40 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.84.229 with SMTP id c5csp2152lbz; Fri, 24 Oct 2014 23:55:39 -0700 (PDT) X-Received: by 10.68.251.99 with SMTP id zj3mr9397765pbc.105.1414220139117; Fri, 24 Oct 2014 23:55:39 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id yn9si5882134pac.118.2014.10.24.23.55.38 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Oct 2014 23:55:39 -0700 (PDT) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XhvEd-0003YJ-Ul; Sat, 25 Oct 2014 06:53:59 +0000 Received: from szxga02-in.huawei.com ([119.145.14.65]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XhvEa-0003O3-1K for linux-arm-kernel@lists.infradead.org; Sat, 25 Oct 2014 06:53:56 +0000 Received: from 172.24.2.119 (EHLO lggeml423-hub.china.huawei.com) ([172.24.2.119]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CBG64392; Sat, 25 Oct 2014 14:52:53 +0800 (CST) Received: from kernel-host.huawei (10.107.197.247) by lggeml423-hub.china.huawei.com (10.72.61.33) with Microsoft SMTP Server id 14.3.158.1; Sat, 25 Oct 2014 14:52:43 +0800 From: Wang Nan To: , Subject: [PATCH v7 1/2] kprobes: copy ainsn after alloc aggr kprobe Date: Sat, 25 Oct 2014 14:51:04 +0800 Message-ID: <1414219865-35988-2-git-send-email-wangnan0@huawei.com> X-Mailer: git-send-email 1.8.4 In-Reply-To: <1414219865-35988-1-git-send-email-wangnan0@huawei.com> References: <1414219865-35988-1-git-send-email-wangnan0@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.107.197.247] X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141024_235356_252688_CC1AEC75 X-CRM114-Status: UNSURE ( 6.89 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.1 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [119.145.14.65 listed in list.dnswl.org] -1.4 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 SPF_PASS SPF: sender matches SPF record Cc: lizefan@huawei.com, linux@arm.linux.org.uk, taras.kondratiuk@linaro.org, will.deacon@arm.com, linux-kernel@vger.kernel.org, rabin@rab.in, ben.dooks@codethink.co.uk, dave.long@linaro.org, cl@linux.com, davem@davemloft.net, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: wangnan0@huawei.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Copy old kprobe to newly alloced optimized_kprobe before arch_prepare_optimized_kprobe(). Original kprove can brings more information to optimizer. v1 -> v2: - Bugfix: copy p->addr when alloc_aggr_kprobe. Signed-off-by: Wang Nan --- kernel/kprobes.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kernel/kprobes.c b/kernel/kprobes.c index 3995f54..e9868ec 100644 --- a/kernel/kprobes.c +++ b/kernel/kprobes.c @@ -730,7 +730,13 @@ static struct kprobe *alloc_aggr_kprobe(struct kprobe *p) return NULL; INIT_LIST_HEAD(&op->list); + + /* + * copy gives arch_prepare_optimized_kprobe + * more information + */ op->kp.addr = p->addr; + copy_kprobe(p, &op->kp); arch_prepare_optimized_kprobe(op); return &op->kp;