From patchwork Wed Aug 27 13:02:31 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Nan X-Patchwork-Id: 36102 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f69.google.com (mail-pa0-f69.google.com [209.85.220.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 59E0420564 for ; Wed, 27 Aug 2014 13:15:54 +0000 (UTC) Received: by mail-pa0-f69.google.com with SMTP id kx10sf1263740pab.0 for ; Wed, 27 Aug 2014 06:15:52 -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:cc:subject:date:message-id :in-reply-to:references:mime-version:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=JjllWYzj0vM683dKVGGF3sVerd7FwtwZmV/W6+i7heY=; b=cTfeg3MjpAGMl1YkvLopb9JKQ/u7Fn68XZ0HWyiD2ihemn51TcEPFNpUdjAfBFAs2u mIKutmQyKwOKqwTL+J1B8IuVbJ8PdhdF1UgKku03+sGDHhCdNakjK2O9xd95Zpzm/Ne1 Kx33GNkIOdYE7/L8IFdm8crQJNXpDAMPedR7kapF/o+Z2i6ekqwMiPdo0EGRfk5Hhh3n lKC3i9TI14W5aNYzKhq0fBdsNcgN9reoM2FuSjH0AOLb9Lbm7XrUaHs5yjVcfLKitnGx gFgWCmmqWx20y53h5S6mob4/kgLLE7cGfPbl3XVi6XQO8xxCg/VZKk13lWYkvbsffbVf MQHg== X-Gm-Message-State: ALoCoQmyD3X5e6OLC1Q7WSRu2yAtPJpLvaoy41nX/X8qhre3/HOd1i6Fi44JPDonvBWE7vVw3WnU X-Received: by 10.66.65.131 with SMTP id x3mr20192993pas.13.1409145352050; Wed, 27 Aug 2014 06:15:52 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.103.177 with SMTP id y46ls102244qge.79.gmail; Wed, 27 Aug 2014 06:15:51 -0700 (PDT) X-Received: by 10.52.239.108 with SMTP id vr12mr14512244vdc.30.1409145351899; Wed, 27 Aug 2014 06:15:51 -0700 (PDT) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by mx.google.com with ESMTPS id jq10si197063vdb.75.2014.08.27.06.15.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 27 Aug 2014 06:15:51 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.179 as permitted sender) client-ip=209.85.220.179; Received: by mail-vc0-f179.google.com with SMTP id hq11so62148vcb.24 for ; Wed, 27 Aug 2014 06:15:51 -0700 (PDT) X-Received: by 10.220.169.72 with SMTP id x8mr289154vcy.45.1409145351371; Wed, 27 Aug 2014 06:15:51 -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.221.45.67 with SMTP id uj3csp80149vcb; Wed, 27 Aug 2014 06:15:50 -0700 (PDT) X-Received: by 10.68.229.193 with SMTP id ss1mr22208434pbc.158.1409145350481; Wed, 27 Aug 2014 06:15:50 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e3si684627pdf.48.2014.08.27.06.15.49 for ; Wed, 27 Aug 2014 06:15:50 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934490AbaH0NPr (ORCPT + 26 others); Wed, 27 Aug 2014 09:15:47 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:22624 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933270AbaH0NPp (ORCPT ); Wed, 27 Aug 2014 09:15:45 -0400 Received: from 172.24.2.119 (EHLO lggeml425-hub.china.huawei.com) ([172.24.2.119]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id BYR81785; Wed, 27 Aug 2014 21:14:17 +0800 (CST) Received: from kernel-host.huawei (10.107.197.247) by lggeml425-hub.china.huawei.com (10.72.61.35) with Microsoft SMTP Server id 14.3.158.1; Wed, 27 Aug 2014 21:14:08 +0800 From: Wang Nan To: Russell King , "David A. Long" , Jon Medhurst , Taras Kondratiuk , Ben Dooks , "Ananth N Mavinakayanahalli" , Anil S Keshavamurthy , "David S. Miller" , Masami Hiramatsu , Will Deacon CC: Wang Nan , Pei Feiyue , , Subject: [PATCH v5 2/3] kprobes: copy ainsn after alloc aggr kprobe Date: Wed, 27 Aug 2014 21:02:31 +0800 Message-ID: <1409144552-12751-3-git-send-email-wangnan0@huawei.com> X-Mailer: git-send-email 1.8.4 In-Reply-To: <1409144552-12751-1-git-send-email-wangnan0@huawei.com> References: <1409144552-12751-1-git-send-email-wangnan0@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.107.197.247] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.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.220.179 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 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Copy old kprobe to newly alloced optimized_kprobe before arch_prepare_optimized_kprobe(). Original kprove can brings more information to optimizer. Signed-off-by: Wang Nan Cc: Russell King Cc: "David A. Long" Cc: Jon Medhurst Cc: Taras Kondratiuk Cc: Ben Dooks Cc: Ananth N Mavinakayanahalli Cc: Anil S Keshavamurthy Cc: "David S. Miller" Cc: Masami Hiramatsu Cc: Will Deacon --- kernel/kprobes.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/kernel/kprobes.c b/kernel/kprobes.c index 3995f54..33cf568 100644 --- a/kernel/kprobes.c +++ b/kernel/kprobes.c @@ -730,7 +730,12 @@ static struct kprobe *alloc_aggr_kprobe(struct kprobe *p) return NULL; INIT_LIST_HEAD(&op->list); - op->kp.addr = p->addr; + + /* + * copy gives arch_prepare_optimized_kprobe + * more information + */ + copy_kprobe(p, &op->kp); arch_prepare_optimized_kprobe(op); return &op->kp;