From patchwork Wed Oct 22 11:32: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: 39270 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f69.google.com (mail-ee0-f69.google.com [74.125.83.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5031020341 for ; Wed, 22 Oct 2014 11:34:16 +0000 (UTC) Received: by mail-ee0-f69.google.com with SMTP id b57sf1529878eek.0 for ; Wed, 22 Oct 2014 04:34:15 -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=cU7K7BkIUyPK478j8VTC4SlVizvfqmLMA0efKavRxgw=; b=HMO+ZbBKIbpBNlV7Au/XVPNHFaidj3ofFOslkGivMcL4CvbDXvKmEk3+1KMETYj0BY LZH7lZYmwRjctJjU1YmezhyDIKKwCfrxKZCRzNcwxE791orwisSktE8qCaw1QxhvTpPe mnah/iomilYBbn8ooqfOIu2jcEMHmqJ5nfm3PxO1o1zDeHa5Z4JXCljkwvmoXR1E1M99 qEGA4eNLeANe42u1BuoiqDSZhESJNXnefFKw43PYvlV+UphHCwGCaDZGXKLZ2wQskjpZ IbMvrHinf4+pTOe4v3u9IItkAzbhHws6WyHqS5aXNjEJ/+ctj6lboG9bIqXsFSwbtY/J r9kg== X-Gm-Message-State: ALoCoQkcvdKJbcrCGX33Esnzxr/o1Xl6x08UxYHsqMRRCi1q1D1G9OxrTQ6ecmB5jYZymZnlEEVU X-Received: by 10.152.27.38 with SMTP id q6mr547383lag.5.1413977655302; Wed, 22 Oct 2014 04:34:15 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.8.194 with SMTP id t2ls174744laa.14.gmail; Wed, 22 Oct 2014 04:34:15 -0700 (PDT) X-Received: by 10.112.130.41 with SMTP id ob9mr40334838lbb.74.1413977655129; Wed, 22 Oct 2014 04:34:15 -0700 (PDT) Received: from mail-la0-f52.google.com (mail-la0-f52.google.com. [209.85.215.52]) by mx.google.com with ESMTPS id k16si22975051laa.47.2014.10.22.04.34.14 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 22 Oct 2014 04:34:14 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.52 as permitted sender) client-ip=209.85.215.52; Received: by mail-la0-f52.google.com with SMTP id hz20so2756022lab.11 for ; Wed, 22 Oct 2014 04:34:14 -0700 (PDT) X-Received: by 10.112.189.10 with SMTP id ge10mr40726065lbc.23.1413977654449; Wed, 22 Oct 2014 04:34:14 -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 c5csp53364lbz; Wed, 22 Oct 2014 04:34:13 -0700 (PDT) X-Received: by 10.68.194.136 with SMTP id hw8mr42033004pbc.17.1413977652948; Wed, 22 Oct 2014 04:34:12 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gd2si13892660pbb.180.2014.10.22.04.34.12 for ; Wed, 22 Oct 2014 04:34:12 -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 S933091AbaJVLeH (ORCPT + 27 others); Wed, 22 Oct 2014 07:34:07 -0400 Received: from szxga01-in.huawei.com ([119.145.14.64]:43714 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932896AbaJVLeE (ORCPT ); Wed, 22 Oct 2014 07:34:04 -0400 Received: from 172.24.2.119 (EHLO lggeml425-hub.china.huawei.com) ([172.24.2.119]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CDF48895; Wed, 22 Oct 2014 19:33:51 +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, 22 Oct 2014 19:33:39 +0800 From: Wang Nan To: , , , , , , Ben Dooks , Christoph Lameter , Rabin Vincent , "David S. Miller" CC: , , "Li Zefan" Subject: [PATCH v6 6/7] kprobes: copy ainsn after alloc aggr kprobe Date: Wed, 22 Oct 2014 19:32:04 +0800 Message-ID: <1413977525-51480-7-git-send-email-wangnan0@huawei.com> X-Mailer: git-send-email 1.8.4 In-Reply-To: <1413977525-51480-1-git-send-email-wangnan0@huawei.com> References: <1413977525-51480-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.215.52 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. 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;