From patchwork Tue Nov 18 06:32:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Nan X-Patchwork-Id: 40998 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2EE0F246D4 for ; Tue, 18 Nov 2014 06:36:02 +0000 (UTC) Received: by mail-la0-f69.google.com with SMTP id gq15sf1649997lab.0 for ; Mon, 17 Nov 2014 22:36:01 -0800 (PST) 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=cTQFBdj2lsbOq9zCouC9xM/c7lMT34lCEc1F96E4+Kkdf/71mI4tAWQLfI9lfK0IwU SeIGZOE4nempT1iNS3or+KLwYMpgKBhwZWgsisYzGQuTcFoN6f4641vTFKJF5FtqFVs4 9L952j72blJfRTxtcT6QFCOURKTh/4DUeyweSJvCF0e/RyJQZjflUcq71Msvzt1z5yk2 G2wgC4HKrYyxQNZXn2650kMyLF+asn46PhtcT30830XIF0rr9CxttF+WwHNTO41PKH23 CNLjzM8Lwc0UIDE20GuQuGcs4OYyAct6/c1y6XKVF3rzdIgrvQ6/DPgqgjhWUbRt9N4o BCMA== X-Gm-Message-State: ALoCoQkXFqru6AW0jJhXrtp0XprND//bRX4ikDDW9u6FhUuosi9PPNQ+3nlP6tSJBDrRjO8677tj X-Received: by 10.112.199.167 with SMTP id jl7mr3270023lbc.5.1416292561053; Mon, 17 Nov 2014 22:36:01 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.42.170 with SMTP id p10ls156356lal.35.gmail; Mon, 17 Nov 2014 22:36:00 -0800 (PST) X-Received: by 10.112.132.67 with SMTP id os3mr5737501lbb.90.1416292560817; Mon, 17 Nov 2014 22:36:00 -0800 (PST) Received: from mail-la0-f41.google.com (mail-la0-f41.google.com. [209.85.215.41]) by mx.google.com with ESMTPS id b9si29010290lah.61.2014.11.17.22.36.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Nov 2014 22:36:00 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.41 as permitted sender) client-ip=209.85.215.41; Received: by mail-la0-f41.google.com with SMTP id gf13so7716986lab.0 for ; Mon, 17 Nov 2014 22:36:00 -0800 (PST) X-Received: by 10.152.37.69 with SMTP id w5mr32941978laj.67.1416292560678; Mon, 17 Nov 2014 22:36:00 -0800 (PST) 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.184.201 with SMTP id ew9csp1282372lbc; Mon, 17 Nov 2014 22:35:59 -0800 (PST) X-Received: by 10.70.130.47 with SMTP id ob15mr35055423pdb.112.1416292558893; Mon, 17 Nov 2014 22:35:58 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id fb8si37235901pac.108.2014.11.17.22.35.58 for ; Mon, 17 Nov 2014 22:35:58 -0800 (PST) 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 S1753895AbaKRGfz (ORCPT + 26 others); Tue, 18 Nov 2014 01:35:55 -0500 Received: from szxga02-in.huawei.com ([119.145.14.65]:15947 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753166AbaKRGfx (ORCPT ); Tue, 18 Nov 2014 01:35:53 -0500 Received: from 172.24.2.119 (EHLO lggeml422-hub.china.huawei.com) ([172.24.2.119]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CCN17788; Tue, 18 Nov 2014 14:35:35 +0800 (CST) Received: from kernel-host.huawei (10.107.197.247) by lggeml422-hub.china.huawei.com (10.72.61.32) with Microsoft SMTP Server id 14.3.158.1; Tue, 18 Nov 2014 14:35:24 +0800 From: Wang Nan To: , , , , , , , , , CC: , , Subject: [PATCH v8 1/2] kprobes: copy ainsn after alloc aggr kprobe Date: Tue, 18 Nov 2014 14:32:38 +0800 Message-ID: <1416292359-75893-2-git-send-email-wangnan0@huawei.com> X-Mailer: git-send-email 1.8.4 In-Reply-To: <1416292359-75893-1-git-send-email-wangnan0@huawei.com> References: <1416292359-75893-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.41 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;